diff --git a/README.md b/README.md index 07002fb..d48a6fc 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,10 @@ PHP 5.5 and later ## Installation & Usage ### Composer -To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: - -``` -{ - "require": { - "gitee-php/gitee-sdk": "^5.4" - } -} +```bash +composer require gitee-php/gitee-sdk ``` -Then run `composer install` - ### Manual Installation Download the files and include `autoload.php`: @@ -120,6 +112,11 @@ Class | Method | HTTP request | Description *ActivityApi* | [**putV5ReposOwnerRepoNotifications**](docs/Api/ActivityApi.md#putv5reposownerreponotifications) | **PUT** /v5/repos/{owner}/{repo}/notifications | 标记一个仓库里的通知为已读 *ActivityApi* | [**putV5UserStarredOwnerRepo**](docs/Api/ActivityApi.md#putv5userstarredownerrepo) | **PUT** /v5/user/starred/{owner}/{repo} | star 一个仓库 *ActivityApi* | [**putV5UserSubscriptionsOwnerRepo**](docs/Api/ActivityApi.md#putv5usersubscriptionsownerrepo) | **PUT** /v5/user/subscriptions/{owner}/{repo} | watch 一个仓库 +*ChecksApi* | [**getV5ReposOwnerRepoCheckRunsCheckRunId**](docs/Api/ChecksApi.md#getv5reposownerrepocheckrunscheckrunid) | **GET** /v5/repos/{owner}/{repo}/check-runs/{check_run_id} | 获取检查项详情 +*ChecksApi* | [**getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations**](docs/Api/ChecksApi.md#getv5reposownerrepocheckrunscheckrunidannotations) | **GET** /v5/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations | 获取检查项代码注释 +*ChecksApi* | [**getV5ReposOwnerRepoCommitsRefCheckRuns**](docs/Api/ChecksApi.md#getv5reposownerrepocommitsrefcheckruns) | **GET** /v5/repos/{owner}/{repo}/commits/{ref}/check-runs | 获取某个提交的检查项 +*ChecksApi* | [**patchV5ReposOwnerRepoCheckRunsCheckRunId**](docs/Api/ChecksApi.md#patchv5reposownerrepocheckrunscheckrunid) | **PATCH** /v5/repos/{owner}/{repo}/check-runs/{check_run_id} | 更新检查项 +*ChecksApi* | [**postV5ReposOwnerRepoCheckRuns**](docs/Api/ChecksApi.md#postv5reposownerrepocheckruns) | **POST** /v5/repos/{owner}/{repo}/check-runs | 创建检查项 *EmailsApi* | [**getV5Emails**](docs/Api/EmailsApi.md#getv5emails) | **GET** /v5/emails | 获取授权用户的全部邮箱 *EnterprisesApi* | [**deleteV5EnterprisesEnterpriseMembersUsername**](docs/Api/EnterprisesApi.md#deletev5enterprisesenterprisemembersusername) | **DELETE** /v5/enterprises/{enterprise}/members/{username} | 移除企业成员 *EnterprisesApi* | [**deleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId**](docs/Api/EnterprisesApi.md#deletev5enterprisesenterpriseweekreportsreportidcommentsid) | **DELETE** /v5/enterprises/{enterprise}/week_reports/{report_id}/comments/{id} | 删除周报某个评论 @@ -188,6 +185,7 @@ Class | Method | HTTP request | Description *LabelsApi* | [**getV5ReposOwnerRepoIssuesNumberLabels**](docs/Api/LabelsApi.md#getv5reposownerrepoissuesnumberlabels) | **GET** /v5/repos/{owner}/{repo}/issues/{number}/labels | 获取仓库任务的所有标签 *LabelsApi* | [**getV5ReposOwnerRepoLabels**](docs/Api/LabelsApi.md#getv5reposownerrepolabels) | **GET** /v5/repos/{owner}/{repo}/labels | 获取仓库所有任务标签 *LabelsApi* | [**getV5ReposOwnerRepoLabelsName**](docs/Api/LabelsApi.md#getv5reposownerrepolabelsname) | **GET** /v5/repos/{owner}/{repo}/labels/{name} | 根据标签名称获取单个标签 +*LabelsApi* | [**getV5ReposOwnerRepoProjectLabels**](docs/Api/LabelsApi.md#getv5reposownerrepoprojectlabels) | **GET** /v5/repos/{owner}/{repo}/project_labels | 获取仓库所有标签 *LabelsApi* | [**patchV5ReposOwnerRepoLabelsOriginalName**](docs/Api/LabelsApi.md#patchv5reposownerrepolabelsoriginalname) | **PATCH** /v5/repos/{owner}/{repo}/labels/{original_name} | 更新一个仓库任务标签 *LabelsApi* | [**postV5ReposOwnerRepoIssuesNumberLabels**](docs/Api/LabelsApi.md#postv5reposownerrepoissuesnumberlabels) | **POST** /v5/repos/{owner}/{repo}/issues/{number}/labels | 创建Issue标签 *LabelsApi* | [**postV5ReposOwnerRepoLabels**](docs/Api/LabelsApi.md#postv5reposownerrepolabels) | **POST** /v5/repos/{owner}/{repo}/labels | 创建仓库任务标签 @@ -252,28 +250,30 @@ Class | Method | HTTP request | Description *RepositoriesApi* | [**deleteV5ReposOwnerRepo**](docs/Api/RepositoriesApi.md#deletev5reposownerrepo) | **DELETE** /v5/repos/{owner}/{repo} | 删除一个仓库 *RepositoriesApi* | [**deleteV5ReposOwnerRepoBaiduStatisticKey**](docs/Api/RepositoriesApi.md#deletev5reposownerrepobaidustatistickey) | **DELETE** /v5/repos/{owner}/{repo}/baidu_statistic_key | 删除仓库的百度统计 key *RepositoriesApi* | [**deleteV5ReposOwnerRepoBranchesBranchProtection**](docs/Api/RepositoriesApi.md#deletev5reposownerrepobranchesbranchprotection) | **DELETE** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 取消保护分支的设置 -*RepositoriesApi* | [**deleteV5ReposOwnerRepoBranchesWildcardSetting**](docs/Api/RepositoriesApi.md#deletev5reposownerrepobrancheswildcardsetting) | **DELETE** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 删除仓库保护分支策略 +*RepositoriesApi* | [**deleteV5ReposOwnerRepoBranchesWildcardSetting**](docs/Api/RepositoriesApi.md#deletev5reposownerrepobrancheswildcardsetting) | **DELETE** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 删除保护分支规则 *RepositoriesApi* | [**deleteV5ReposOwnerRepoCollaboratorsUsername**](docs/Api/RepositoriesApi.md#deletev5reposownerrepocollaboratorsusername) | **DELETE** /v5/repos/{owner}/{repo}/collaborators/{username} | 移除仓库成员 *RepositoriesApi* | [**deleteV5ReposOwnerRepoCommentsId**](docs/Api/RepositoriesApi.md#deletev5reposownerrepocommentsid) | **DELETE** /v5/repos/{owner}/{repo}/comments/{id} | 删除Commit评论 *RepositoriesApi* | [**deleteV5ReposOwnerRepoContentsPath**](docs/Api/RepositoriesApi.md#deletev5reposownerrepocontentspath) | **DELETE** /v5/repos/{owner}/{repo}/contents/{path} | 删除文件 *RepositoriesApi* | [**deleteV5ReposOwnerRepoKeysEnableId**](docs/Api/RepositoriesApi.md#deletev5reposownerrepokeysenableid) | **DELETE** /v5/repos/{owner}/{repo}/keys/enable/{id} | 停用仓库公钥 *RepositoriesApi* | [**deleteV5ReposOwnerRepoKeysId**](docs/Api/RepositoriesApi.md#deletev5reposownerrepokeysid) | **DELETE** /v5/repos/{owner}/{repo}/keys/{id} | 删除一个仓库公钥 *RepositoriesApi* | [**deleteV5ReposOwnerRepoReleasesId**](docs/Api/RepositoriesApi.md#deletev5reposownerreporeleasesid) | **DELETE** /v5/repos/{owner}/{repo}/releases/{id} | 删除仓库Release +*RepositoriesApi* | [**deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId**](docs/Api/RepositoriesApi.md#deletev5reposownerreporeleasesreleaseidattachfilesattachfileid) | **DELETE** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id} | 删除仓库下指定 Release 的指定附件 *RepositoriesApi* | [**getV5EnterprisesEnterpriseRepos**](docs/Api/RepositoriesApi.md#getv5enterprisesenterpriserepos) | **GET** /v5/enterprises/{enterprise}/repos | 获取企业的所有仓库 *RepositoriesApi* | [**getV5OrgsOrgRepos**](docs/Api/RepositoriesApi.md#getv5orgsorgrepos) | **GET** /v5/orgs/{org}/repos | 获取一个组织的仓库 *RepositoriesApi* | [**getV5ReposOwnerRepo**](docs/Api/RepositoriesApi.md#getv5reposownerrepo) | **GET** /v5/repos/{owner}/{repo} | 获取用户的某个仓库 *RepositoriesApi* | [**getV5ReposOwnerRepoBaiduStatisticKey**](docs/Api/RepositoriesApi.md#getv5reposownerrepobaidustatistickey) | **GET** /v5/repos/{owner}/{repo}/baidu_statistic_key | 获取仓库的百度统计 key +*RepositoriesApi* | [**getV5ReposOwnerRepoBlamePath**](docs/Api/RepositoriesApi.md#getv5reposownerrepoblamepath) | **GET** /v5/repos/{owner}/{repo}/blame/{path} | Blame *RepositoriesApi* | [**getV5ReposOwnerRepoBranches**](docs/Api/RepositoriesApi.md#getv5reposownerrepobranches) | **GET** /v5/repos/{owner}/{repo}/branches | 获取所有分支 *RepositoriesApi* | [**getV5ReposOwnerRepoBranchesBranch**](docs/Api/RepositoriesApi.md#getv5reposownerrepobranchesbranch) | **GET** /v5/repos/{owner}/{repo}/branches/{branch} | 获取单个分支 *RepositoriesApi* | [**getV5ReposOwnerRepoCollaborators**](docs/Api/RepositoriesApi.md#getv5reposownerrepocollaborators) | **GET** /v5/repos/{owner}/{repo}/collaborators | 获取仓库的所有成员 *RepositoriesApi* | [**getV5ReposOwnerRepoCollaboratorsUsername**](docs/Api/RepositoriesApi.md#getv5reposownerrepocollaboratorsusername) | **GET** /v5/repos/{owner}/{repo}/collaborators/{username} | 判断用户是否为仓库成员 *RepositoriesApi* | [**getV5ReposOwnerRepoCollaboratorsUsernamePermission**](docs/Api/RepositoriesApi.md#getv5reposownerrepocollaboratorsusernamepermission) | **GET** /v5/repos/{owner}/{repo}/collaborators/{username}/permission | 查看仓库成员的权限 -*RepositoriesApi* | [**getV5ReposOwnerRepoComments**](docs/Api/RepositoriesApi.md#getv5reposownerrepocomments) | **GET** /v5/repos/{owner}/{repo}/comments | 获取仓库的Commit评论 +*RepositoriesApi* | [**getV5ReposOwnerRepoComments**](docs/Api/RepositoriesApi.md#getv5reposownerrepocomments) | **GET** /v5/repos/{owner}/{repo}/comments | 获取仓库的 Commit 评论 *RepositoriesApi* | [**getV5ReposOwnerRepoCommentsId**](docs/Api/RepositoriesApi.md#getv5reposownerrepocommentsid) | **GET** /v5/repos/{owner}/{repo}/comments/{id} | 获取仓库的某条Commit评论 *RepositoriesApi* | [**getV5ReposOwnerRepoCommits**](docs/Api/RepositoriesApi.md#getv5reposownerrepocommits) | **GET** /v5/repos/{owner}/{repo}/commits | 仓库的所有提交 *RepositoriesApi* | [**getV5ReposOwnerRepoCommitsRefComments**](docs/Api/RepositoriesApi.md#getv5reposownerrepocommitsrefcomments) | **GET** /v5/repos/{owner}/{repo}/commits/{ref}/comments | 获取单个Commit的评论 *RepositoriesApi* | [**getV5ReposOwnerRepoCommitsSha**](docs/Api/RepositoriesApi.md#getv5reposownerrepocommitssha) | **GET** /v5/repos/{owner}/{repo}/commits/{sha} | 仓库的某个提交 -*RepositoriesApi* | [**getV5ReposOwnerRepoCompareBaseHead**](docs/Api/RepositoriesApi.md#getv5reposownerrepocomparebasehead) | **GET** /v5/repos/{owner}/{repo}/compare/{base}...{head} | 两个Commits之间对比的版本差异 +*RepositoriesApi* | [**getV5ReposOwnerRepoCompareBaseHead**](docs/Api/RepositoriesApi.md#getv5reposownerrepocomparebasehead) | **GET** /v5/repos/{owner}/{repo}/compare/{base}...{head} | Commits 对比 *RepositoriesApi* | [**getV5ReposOwnerRepoContentsPath**](docs/Api/RepositoriesApi.md#getv5reposownerrepocontentspath) | **GET** /v5/repos/{owner}/{repo}/contents(/{path}) | 获取仓库具体路径下的内容 *RepositoriesApi* | [**getV5ReposOwnerRepoContributors**](docs/Api/RepositoriesApi.md#getv5reposownerrepocontributors) | **GET** /v5/repos/{owner}/{repo}/contributors | 获取仓库贡献者 *RepositoriesApi* | [**getV5ReposOwnerRepoForks**](docs/Api/RepositoriesApi.md#getv5reposownerrepoforks) | **GET** /v5/repos/{owner}/{repo}/forks | 查看仓库的Forks @@ -282,12 +282,18 @@ Class | Method | HTTP request | Description *RepositoriesApi* | [**getV5ReposOwnerRepoKeysId**](docs/Api/RepositoriesApi.md#getv5reposownerrepokeysid) | **GET** /v5/repos/{owner}/{repo}/keys/{id} | 获取仓库的单个公钥 *RepositoriesApi* | [**getV5ReposOwnerRepoPages**](docs/Api/RepositoriesApi.md#getv5reposownerrepopages) | **GET** /v5/repos/{owner}/{repo}/pages | 获取Pages信息 *RepositoriesApi* | [**getV5ReposOwnerRepoPushConfig**](docs/Api/RepositoriesApi.md#getv5reposownerrepopushconfig) | **GET** /v5/repos/{owner}/{repo}/push_config | 获取仓库推送规则设置 +*RepositoriesApi* | [**getV5ReposOwnerRepoRawPath**](docs/Api/RepositoriesApi.md#getv5reposownerreporawpath) | **GET** /v5/repos/{owner}/{repo}/raw/{path} | 获取 raw 文件(100MB 以内) *RepositoriesApi* | [**getV5ReposOwnerRepoReadme**](docs/Api/RepositoriesApi.md#getv5reposownerreporeadme) | **GET** /v5/repos/{owner}/{repo}/readme | 获取仓库README *RepositoriesApi* | [**getV5ReposOwnerRepoReleases**](docs/Api/RepositoriesApi.md#getv5reposownerreporeleases) | **GET** /v5/repos/{owner}/{repo}/releases | 获取仓库的所有Releases *RepositoriesApi* | [**getV5ReposOwnerRepoReleasesId**](docs/Api/RepositoriesApi.md#getv5reposownerreporeleasesid) | **GET** /v5/repos/{owner}/{repo}/releases/{id} | 获取仓库的单个Releases *RepositoriesApi* | [**getV5ReposOwnerRepoReleasesLatest**](docs/Api/RepositoriesApi.md#getv5reposownerreporeleaseslatest) | **GET** /v5/repos/{owner}/{repo}/releases/latest | 获取仓库的最后更新的Release +*RepositoriesApi* | [**getV5ReposOwnerRepoReleasesReleaseIdAttachFiles**](docs/Api/RepositoriesApi.md#getv5reposownerreporeleasesreleaseidattachfiles) | **GET** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files | 获取仓库下的指定 Release 的所有附件 +*RepositoriesApi* | [**getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId**](docs/Api/RepositoriesApi.md#getv5reposownerreporeleasesreleaseidattachfilesattachfileid) | **GET** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id} | 获取仓库下指定 Release 的单个附件 +*RepositoriesApi* | [**getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload**](docs/Api/RepositoriesApi.md#getv5reposownerreporeleasesreleaseidattachfilesattachfileiddownload) | **GET** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id}/download | 下载指定 Release 的单个附件 *RepositoriesApi* | [**getV5ReposOwnerRepoReleasesTagsTag**](docs/Api/RepositoriesApi.md#getv5reposownerreporeleasestagstag) | **GET** /v5/repos/{owner}/{repo}/releases/tags/{tag} | 根据Tag名称获取仓库的Release -*RepositoriesApi* | [**getV5ReposOwnerRepoTags**](docs/Api/RepositoriesApi.md#getv5reposownerrepotags) | **GET** /v5/repos/{owner}/{repo}/tags | 列出仓库所有的tags +*RepositoriesApi* | [**getV5ReposOwnerRepoTags**](docs/Api/RepositoriesApi.md#getv5reposownerrepotags) | **GET** /v5/repos/{owner}/{repo}/tags | 列出仓库所有的 tags +*RepositoriesApi* | [**getV5ReposOwnerRepoTarball**](docs/Api/RepositoriesApi.md#getv5reposownerrepotarball) | **GET** /v5/repos/{owner}/{repo}/tarball | 下载仓库 tar.gz +*RepositoriesApi* | [**getV5ReposOwnerRepoZipball**](docs/Api/RepositoriesApi.md#getv5reposownerrepozipball) | **GET** /v5/repos/{owner}/{repo}/zipball | 下载仓库 zip *RepositoriesApi* | [**getV5UserRepos**](docs/Api/RepositoriesApi.md#getv5userrepos) | **GET** /v5/user/repos | 列出授权用户的所有仓库 *RepositoriesApi* | [**getV5UsersUsernameRepos**](docs/Api/RepositoriesApi.md#getv5usersusernamerepos) | **GET** /v5/users/{username}/repos | 获取某个用户的公开仓库 *RepositoriesApi* | [**patchV5ReposOwnerRepo**](docs/Api/RepositoriesApi.md#patchv5reposownerrepo) | **PATCH** /v5/repos/{owner}/{repo} | 更新仓库设置 @@ -297,6 +303,7 @@ Class | Method | HTTP request | Description *RepositoriesApi* | [**postV5OrgsOrgRepos**](docs/Api/RepositoriesApi.md#postv5orgsorgrepos) | **POST** /v5/orgs/{org}/repos | 创建组织仓库 *RepositoriesApi* | [**postV5ReposOwnerRepoBaiduStatisticKey**](docs/Api/RepositoriesApi.md#postv5reposownerrepobaidustatistickey) | **POST** /v5/repos/{owner}/{repo}/baidu_statistic_key | 设置/更新仓库的百度统计 key *RepositoriesApi* | [**postV5ReposOwnerRepoBranches**](docs/Api/RepositoriesApi.md#postv5reposownerrepobranches) | **POST** /v5/repos/{owner}/{repo}/branches | 创建分支 +*RepositoriesApi* | [**postV5ReposOwnerRepoCommits**](docs/Api/RepositoriesApi.md#postv5reposownerrepocommits) | **POST** /v5/repos/{owner}/{repo}/commits | 提交多个文件变更 *RepositoriesApi* | [**postV5ReposOwnerRepoCommitsShaComments**](docs/Api/RepositoriesApi.md#postv5reposownerrepocommitsshacomments) | **POST** /v5/repos/{owner}/{repo}/commits/{sha}/comments | 创建Commit评论 *RepositoriesApi* | [**postV5ReposOwnerRepoContentsPath**](docs/Api/RepositoriesApi.md#postv5reposownerrepocontentspath) | **POST** /v5/repos/{owner}/{repo}/contents/{path} | 新建文件 *RepositoriesApi* | [**postV5ReposOwnerRepoForks**](docs/Api/RepositoriesApi.md#postv5reposownerrepoforks) | **POST** /v5/repos/{owner}/{repo}/forks | Fork一个仓库 @@ -304,14 +311,15 @@ Class | Method | HTTP request | Description *RepositoriesApi* | [**postV5ReposOwnerRepoOpen**](docs/Api/RepositoriesApi.md#postv5reposownerrepoopen) | **POST** /v5/repos/{owner}/{repo}/open | 开通Gitee Go *RepositoriesApi* | [**postV5ReposOwnerRepoPagesBuilds**](docs/Api/RepositoriesApi.md#postv5reposownerrepopagesbuilds) | **POST** /v5/repos/{owner}/{repo}/pages/builds | 请求建立Pages *RepositoriesApi* | [**postV5ReposOwnerRepoReleases**](docs/Api/RepositoriesApi.md#postv5reposownerreporeleases) | **POST** /v5/repos/{owner}/{repo}/releases | 创建仓库Release +*RepositoriesApi* | [**postV5ReposOwnerRepoReleasesReleaseIdAttachFiles**](docs/Api/RepositoriesApi.md#postv5reposownerreporeleasesreleaseidattachfiles) | **POST** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files | 上传附件到仓库指定 Release *RepositoriesApi* | [**postV5ReposOwnerRepoTags**](docs/Api/RepositoriesApi.md#postv5reposownerrepotags) | **POST** /v5/repos/{owner}/{repo}/tags | 创建一个仓库的 Tag *RepositoriesApi* | [**postV5ReposOwnerRepoTrafficData**](docs/Api/RepositoriesApi.md#postv5reposownerrepotrafficdata) | **POST** /v5/repos/{owner}/{repo}/traffic-data | 获取最近30天的七日以内访问量 *RepositoriesApi* | [**postV5UserRepos**](docs/Api/RepositoriesApi.md#postv5userrepos) | **POST** /v5/user/repos | 创建一个仓库 *RepositoriesApi* | [**putV5ReposOwnerRepoBranchesBranchProtection**](docs/Api/RepositoriesApi.md#putv5reposownerrepobranchesbranchprotection) | **PUT** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 设置分支保护 -*RepositoriesApi* | [**putV5ReposOwnerRepoBranchesSettingNew**](docs/Api/RepositoriesApi.md#putv5reposownerrepobranchessettingnew) | **PUT** /v5/repos/{owner}/{repo}/branches/setting/new | 新建仓库保护分支策略 -*RepositoriesApi* | [**putV5ReposOwnerRepoBranchesWildcardSetting**](docs/Api/RepositoriesApi.md#putv5reposownerrepobrancheswildcardsetting) | **PUT** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 分支保护策略设置 +*RepositoriesApi* | [**putV5ReposOwnerRepoBranchesSettingNew**](docs/Api/RepositoriesApi.md#putv5reposownerrepobranchessettingnew) | **PUT** /v5/repos/{owner}/{repo}/branches/setting/new | 新建保护分支规则 +*RepositoriesApi* | [**putV5ReposOwnerRepoBranchesWildcardSetting**](docs/Api/RepositoriesApi.md#putv5reposownerrepobrancheswildcardsetting) | **PUT** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 更新保护分支规则 *RepositoriesApi* | [**putV5ReposOwnerRepoClear**](docs/Api/RepositoriesApi.md#putv5reposownerrepoclear) | **PUT** /v5/repos/{owner}/{repo}/clear | 清空一个仓库 -*RepositoriesApi* | [**putV5ReposOwnerRepoCollaboratorsUsername**](docs/Api/RepositoriesApi.md#putv5reposownerrepocollaboratorsusername) | **PUT** /v5/repos/{owner}/{repo}/collaborators/{username} | 添加仓库成员 +*RepositoriesApi* | [**putV5ReposOwnerRepoCollaboratorsUsername**](docs/Api/RepositoriesApi.md#putv5reposownerrepocollaboratorsusername) | **PUT** /v5/repos/{owner}/{repo}/collaborators/{username} | 添加仓库成员或更新仓库成员权限 *RepositoriesApi* | [**putV5ReposOwnerRepoContentsPath**](docs/Api/RepositoriesApi.md#putv5reposownerrepocontentspath) | **PUT** /v5/repos/{owner}/{repo}/contents/{path} | 更新文件 *RepositoriesApi* | [**putV5ReposOwnerRepoKeysEnableId**](docs/Api/RepositoriesApi.md#putv5reposownerrepokeysenableid) | **PUT** /v5/repos/{owner}/{repo}/keys/enable/{id} | 启用仓库公钥 *RepositoriesApi* | [**putV5ReposOwnerRepoPages**](docs/Api/RepositoriesApi.md#putv5reposownerrepopages) | **PUT** /v5/repos/{owner}/{repo}/pages | 上传设置 Pages SSL 证书和域名 @@ -348,8 +356,12 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AttachFile](docs/Model/AttachFile.md) + - [Blame](docs/Model/Blame.md) - [Blob](docs/Model/Blob.md) - [Branch](docs/Model/Branch.md) + - [CheckAnnotation](docs/Model/CheckAnnotation.md) + - [CheckRun](docs/Model/CheckRun.md) - [Code](docs/Model/Code.md) - [CodeComment](docs/Model/CodeComment.md) - [CodeForks](docs/Model/CodeForks.md) @@ -362,11 +374,14 @@ Class | Method | HTTP request | Description - [Content](docs/Model/Content.md) - [ContentBasic](docs/Model/ContentBasic.md) - [Contributor](docs/Model/Contributor.md) + - [DiffFile](docs/Model/DiffFile.md) - [EnterpriseBasic](docs/Model/EnterpriseBasic.md) - [EnterpriseMember](docs/Model/EnterpriseMember.md) - [Event](docs/Model/Event.md) + - [GitUser](docs/Model/GitUser.md) - [GiteeMetrics](docs/Model/GiteeMetrics.md) - [Group](docs/Model/Group.md) + - [GroupBasic](docs/Model/GroupBasic.md) - [GroupDetail](docs/Model/GroupDetail.md) - [GroupFollowers](docs/Model/GroupFollowers.md) - [GroupMember](docs/Model/GroupMember.md) @@ -380,12 +395,16 @@ Class | Method | HTTP request | Description - [NamespaceMini](docs/Model/NamespaceMini.md) - [Note](docs/Model/Note.md) - [OperateLog](docs/Model/OperateLog.md) + - [PostV5ReposOwnerRepoCommits](docs/Model/PostV5ReposOwnerRepoCommits.md) + - [PostV5ReposOwnerRepoCommitsActions](docs/Model/PostV5ReposOwnerRepoCommitsActions.md) + - [PostV5ReposOwnerRepoCommitsAuthor](docs/Model/PostV5ReposOwnerRepoCommitsAuthor.md) - [ProgramBasic](docs/Model/ProgramBasic.md) - [Project](docs/Model/Project.md) - [ProjectBasic](docs/Model/ProjectBasic.md) - [ProjectLabel](docs/Model/ProjectLabel.md) - [ProjectMember](docs/Model/ProjectMember.md) - [ProjectMemberPermission](docs/Model/ProjectMemberPermission.md) + - [ProjectMini](docs/Model/ProjectMini.md) - [ProjectPushConfig](docs/Model/ProjectPushConfig.md) - [ProjectStargazers](docs/Model/ProjectStargazers.md) - [ProjectTrafficData](docs/Model/ProjectTrafficData.md) @@ -406,14 +425,17 @@ Class | Method | HTTP request | Description - [Tag](docs/Model/Tag.md) - [Tree](docs/Model/Tree.md) - [User](docs/Model/User.md) + - [UserAssignee](docs/Model/UserAssignee.md) - [UserBasic](docs/Model/UserBasic.md) - [UserDetail](docs/Model/UserDetail.md) - [UserEmail](docs/Model/UserEmail.md) - [UserInfo](docs/Model/UserInfo.md) - [UserMessage](docs/Model/UserMessage.md) + - [UserMessageList](docs/Model/UserMessageList.md) - [UserMini](docs/Model/UserMini.md) - [UserNotification](docs/Model/UserNotification.md) - [UserNotificationCount](docs/Model/UserNotificationCount.md) + - [UserNotificationList](docs/Model/UserNotificationList.md) - [UserNotificationNamespace](docs/Model/UserNotificationNamespace.md) - [UserNotificationSubject](docs/Model/UserNotificationSubject.md) - [WeekReport](docs/Model/WeekReport.md) diff --git a/docs/Api/ActivityApi.md b/docs/Api/ActivityApi.md index 1415a55..b766d8f 100644 --- a/docs/Api/ActivityApi.md +++ b/docs/Api/ActivityApi.md @@ -251,7 +251,7 @@ No authorization required [[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** -> \Gitee\Model\UserMessage[] getV5NotificationsMessages($accessToken, $unread, $since, $before, $ids, $page, $perPage) +> \Gitee\Model\UserMessageList getV5NotificationsMessages($accessToken, $unread, $since, $before, $ids, $page, $perPage) 列出授权用户的所有私信 @@ -298,7 +298,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\UserMessage[]**](../Model/UserMessage.md) +[**\Gitee\Model\UserMessageList**](../Model/UserMessageList.md) ### Authorization @@ -363,7 +363,7 @@ No authorization required [[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** -> \Gitee\Model\UserNotification[] getV5NotificationsThreads($accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage) +> \Gitee\Model\UserNotificationList getV5NotificationsThreads($accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage) 列出授权用户的所有通知 @@ -414,7 +414,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\UserNotification[]**](../Model/UserNotification.md) +[**\Gitee\Model\UserNotificationList**](../Model/UserNotificationList.md) ### Authorization @@ -591,7 +591,7 @@ No authorization required [[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** -> \Gitee\Model\UserNotification[] getV5ReposOwnerRepoNotifications($owner, $repo, $accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage) +> \Gitee\Model\UserNotificationList getV5ReposOwnerRepoNotifications($owner, $repo, $accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage) 列出一个仓库里的通知 @@ -646,7 +646,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\UserNotification[]**](../Model/UserNotification.md) +[**\Gitee\Model\UserNotificationList**](../Model/UserNotificationList.md) ### Authorization diff --git a/docs/Api/ChecksApi.md b/docs/Api/ChecksApi.md new file mode 100644 index 0000000..b10fa6e --- /dev/null +++ b/docs/Api/ChecksApi.md @@ -0,0 +1,404 @@ +# Gitee\ChecksApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getV5ReposOwnerRepoCheckRunsCheckRunId**](ChecksApi.md#getV5ReposOwnerRepoCheckRunsCheckRunId) | **GET** /v5/repos/{owner}/{repo}/check-runs/{check_run_id} | 获取检查项详情 +[**getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations**](ChecksApi.md#getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations) | **GET** /v5/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations | 获取检查项代码注释 +[**getV5ReposOwnerRepoCommitsRefCheckRuns**](ChecksApi.md#getV5ReposOwnerRepoCommitsRefCheckRuns) | **GET** /v5/repos/{owner}/{repo}/commits/{ref}/check-runs | 获取某个提交的检查项 +[**patchV5ReposOwnerRepoCheckRunsCheckRunId**](ChecksApi.md#patchV5ReposOwnerRepoCheckRunsCheckRunId) | **PATCH** /v5/repos/{owner}/{repo}/check-runs/{check_run_id} | 更新检查项 +[**postV5ReposOwnerRepoCheckRuns**](ChecksApi.md#postV5ReposOwnerRepoCheckRuns) | **POST** /v5/repos/{owner}/{repo}/check-runs | 创建检查项 + + +# **getV5ReposOwnerRepoCheckRunsCheckRunId** +> \Gitee\Model\CheckRun getV5ReposOwnerRepoCheckRunsCheckRunId($owner, $repo, $checkRunId, $accessToken) + +获取检查项详情 + +获取检查项详情 + +### Example +```php +getV5ReposOwnerRepoCheckRunsCheckRunId($owner, $repo, $checkRunId, $accessToken); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChecksApi->getV5ReposOwnerRepoCheckRunsCheckRunId: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **checkRunId** | **int**| 检查项 ID | + **accessToken** | **string**| 用户授权码 | [optional] + +### Return type + +[**\Gitee\Model\CheckRun**](../Model/CheckRun.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations** +> \Gitee\Model\CheckAnnotation getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations($owner, $repo, $checkRunId, $accessToken, $page, $perPage) + +获取检查项代码注释 + +获取检查项代码注释 + +### Example +```php +getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations($owner, $repo, $checkRunId, $accessToken, $page, $perPage); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChecksApi->getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **checkRunId** | **int**| 检查项 ID | + **accessToken** | **string**| 用户授权码 | [optional] + **page** | **int**| 当前的页码 | [optional] [default to 1] + **perPage** | **int**| 每页的数量,最大为 100 | [optional] [default to 20] + +### Return type + +[**\Gitee\Model\CheckAnnotation**](../Model/CheckAnnotation.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getV5ReposOwnerRepoCommitsRefCheckRuns** +> \Gitee\Model\CheckRun getV5ReposOwnerRepoCommitsRefCheckRuns($owner, $repo, $ref, $accessToken, $page, $perPage, $pullRequestId, $checkName, $status, $filter) + +获取某个提交的检查项 + +获取某个提交的检查项 + +### Example +```php +getV5ReposOwnerRepoCommitsRefCheckRuns($owner, $repo, $ref, $accessToken, $page, $perPage, $pullRequestId, $checkName, $status, $filter); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChecksApi->getV5ReposOwnerRepoCommitsRefCheckRuns: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **ref** | **string**| 分支名\\标签名\\sha 值 | + **accessToken** | **string**| 用户授权码 | [optional] + **page** | **int**| 当前的页码 | [optional] [default to 1] + **perPage** | **int**| 每页的数量,最大为 100 | [optional] [default to 20] + **pullRequestId** | **int**| 关联 pull request 的 ID | [optional] [default to 0] + **checkName** | **string**| 检查项名称 | [optional] + **status** | **string**| 检查项状态 | [optional] + **filter** | **string**| 最新的\\全部 | [optional] [default to latest] + +### Return type + +[**\Gitee\Model\CheckRun**](../Model/CheckRun.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **patchV5ReposOwnerRepoCheckRunsCheckRunId** +> \Gitee\Model\CheckRun patchV5ReposOwnerRepoCheckRunsCheckRunId($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption, $name) + +更新检查项 + +更新检查项 + +### Example +```php +patchV5ReposOwnerRepoCheckRunsCheckRunId($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption, $name); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChecksApi->patchV5ReposOwnerRepoCheckRunsCheckRunId: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **outputTitle** | **string**| 标题 | + **outputSummary** | **string**| 概论 | + **outputAnnotationsPath** | [**string[]**](../Model/string.md)| 路径 | + **outputAnnotationsStartLine** | [**int[]**](../Model/int.md)| 开始行 | + **outputAnnotationsEndLine** | [**int[]**](../Model/int.md)| 结束行 | + **outputAnnotationsAnnotationLevel** | [**string[]**](../Model/string.md)| 注释级别 | + **outputAnnotationsMessage** | [**string[]**](../Model/string.md)| 注释信息 | + **outputImagesAlt** | [**string[]**](../Model/string.md)| 注释 | + **outputImagesImageUrl** | [**string[]**](../Model/string.md)| URL | + **actionsLabel** | [**string[]**](../Model/string.md)| 文本 | + **actionsDescription** | [**string[]**](../Model/string.md)| 描述 | + **actionsIdentifier** | [**string[]**](../Model/string.md)| 标识 | + **checkRunId** | **int**| 检查项 ID | + **accessToken** | **string**| 用户授权码 | [optional] + **pullRequestId** | **int**| 关联 pull_request 的 ID | [optional] + **detailsUrl** | **string**| 详情链接 | [optional] + **status** | **string**| 状态 | [optional] [default to queued] + **startedAt** | **\DateTime**| 开始时间 | [optional] + **conclusion** | **string**| 结论 | [optional] + **completedAt** | **\DateTime**| 完成时间 | [optional] + **outputText** | **string**| 详细信息 | [optional] + **outputAnnotationsStartColumn** | [**int[]**](../Model/int.md)| 开始列 | [optional] + **outputAnnotationsEndColumn** | [**int[]**](../Model/int.md)| 结束列 | [optional] + **outputAnnotationsTitle** | [**string[]**](../Model/string.md)| 标题 | [optional] + **outputAnnotationsRawDetails** | [**string[]**](../Model/string.md)| 详情内容 | [optional] + **outputImagesCaption** | [**string[]**](../Model/string.md)| 描述 | [optional] + **name** | **string**| 名字 | [optional] + +### Return type + +[**\Gitee\Model\CheckRun**](../Model/CheckRun.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **postV5ReposOwnerRepoCheckRuns** +> \Gitee\Model\CheckRun postV5ReposOwnerRepoCheckRuns($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption) + +创建检查项 + +创建检查项 + +### Example +```php +postV5ReposOwnerRepoCheckRuns($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChecksApi->postV5ReposOwnerRepoCheckRuns: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **outputTitle** | **string**| 标题 | + **outputSummary** | **string**| 概论 | + **outputAnnotationsPath** | [**string[]**](../Model/string.md)| 路径 | + **outputAnnotationsStartLine** | [**int[]**](../Model/int.md)| 开始行 | + **outputAnnotationsEndLine** | [**int[]**](../Model/int.md)| 结束行 | + **outputAnnotationsAnnotationLevel** | [**string[]**](../Model/string.md)| 注释级别 | + **outputAnnotationsMessage** | [**string[]**](../Model/string.md)| 注释信息 | + **outputImagesAlt** | [**string[]**](../Model/string.md)| 注释 | + **outputImagesImageUrl** | [**string[]**](../Model/string.md)| URL | + **actionsLabel** | [**string[]**](../Model/string.md)| 文本 | + **actionsDescription** | [**string[]**](../Model/string.md)| 描述 | + **actionsIdentifier** | [**string[]**](../Model/string.md)| 标识 | + **name** | **string**| 名字 | + **headSha** | **string**| 提交的 sha 值(必须是完整的) | + **accessToken** | **string**| 用户授权码 | [optional] + **pullRequestId** | **int**| PullRequest ID | [optional] + **detailsUrl** | **string**| 详情链接 | [optional] + **status** | **string**| 状态 | [optional] [default to queued] + **startedAt** | **\DateTime**| 开始时间 | [optional] + **conclusion** | **string**| 结论 | [optional] + **completedAt** | **\DateTime**| 完成时间 | [optional] + **outputText** | **string**| 详细信息 | [optional] + **outputAnnotationsStartColumn** | [**int[]**](../Model/int.md)| 开始列 | [optional] + **outputAnnotationsEndColumn** | [**int[]**](../Model/int.md)| 结束列 | [optional] + **outputAnnotationsTitle** | [**string[]**](../Model/string.md)| 标题 | [optional] + **outputAnnotationsRawDetails** | [**string[]**](../Model/string.md)| 详情内容 | [optional] + **outputImagesCaption** | [**string[]**](../Model/string.md)| 描述 | [optional] + +### Return type + +[**\Gitee\Model\CheckRun**](../Model/CheckRun.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **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/Api/EmailsApi.md b/docs/Api/EmailsApi.md index feb2920..b2159cb 100644 --- a/docs/Api/EmailsApi.md +++ b/docs/Api/EmailsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **getV5Emails** -> \Gitee\Model\UserEmail getV5Emails($accessToken) +> \Gitee\Model\UserEmail[] getV5Emails($accessToken) 获取授权用户的全部邮箱 @@ -43,7 +43,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\UserEmail**](../Model/UserEmail.md) +[**\Gitee\Model\UserEmail[]**](../Model/UserEmail.md) ### Authorization diff --git a/docs/Api/EnterprisesApi.md b/docs/Api/EnterprisesApi.md index 360ced7..0cb17cc 100644 --- a/docs/Api/EnterprisesApi.md +++ b/docs/Api/EnterprisesApi.md @@ -315,7 +315,7 @@ No authorization required [[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) # **getV5EnterprisesEnterpriseMembersSearch** -> getV5EnterprisesEnterpriseMembersSearch($enterprise, $queryType, $queryValue, $accessToken) +> \Gitee\Model\EnterpriseMember getV5EnterprisesEnterpriseMembersSearch($enterprise, $queryType, $queryValue, $accessToken) 获取企业成员信息(通过用户名/邮箱) @@ -337,7 +337,8 @@ $queryValue = "queryValue_example"; // string | 查询值 $accessToken = "accessToken_example"; // string | 用户授权码 try { - $apiInstance->getV5EnterprisesEnterpriseMembersSearch($enterprise, $queryType, $queryValue, $accessToken); + $result = $apiInstance->getV5EnterprisesEnterpriseMembersSearch($enterprise, $queryType, $queryValue, $accessToken); + print_r($result); } catch (Exception $e) { echo 'Exception when calling EnterprisesApi->getV5EnterprisesEnterpriseMembersSearch: ', $e->getMessage(), PHP_EOL; } @@ -355,7 +356,7 @@ Name | Type | Description | Notes ### Return type -void (empty response body) +[**\Gitee\Model\EnterpriseMember**](../Model/EnterpriseMember.md) ### Authorization diff --git a/docs/Api/GistsApi.md b/docs/Api/GistsApi.md index 566c3bf..e564ec2 100644 --- a/docs/Api/GistsApi.md +++ b/docs/Api/GistsApi.md @@ -674,7 +674,7 @@ $apiInstance = new Gitee\Api\GistsApi( ); $id = "id_example"; // string | 代码片段的ID $accessToken = "accessToken_example"; // string | 用户授权码 -$files = array('key' => "files_example"); // map[string,string] | Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } +$files = array("files_example"); // string[] | Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } $description = "description_example"; // string | 代码片段描述,1~30个字符 try { @@ -692,7 +692,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **string**| 代码片段的ID | **accessToken** | **string**| 用户授权码 | [optional] - **files** | [**map[string,string]**](../Model/string.md)| Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } | [optional] + **files** | [**string[]**](../Model/string.md)| Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } | [optional] **description** | **string**| 代码片段描述,1~30个字符 | [optional] ### Return type @@ -727,7 +727,7 @@ $apiInstance = new Gitee\Api\GistsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$files = array('key' => "files_example"); // map[string,string] | Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } +$files = array("files_example"); // string[] | Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } $description = "description_example"; // string | 代码片段描述,1~30个字符 $accessToken = "accessToken_example"; // string | 用户授权码 $public = true; // bool | 公开/私有,默认: 私有 @@ -745,7 +745,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **files** | [**map[string,string]**](../Model/string.md)| Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } | + **files** | [**string[]**](../Model/string.md)| Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } | **description** | **string**| 代码片段描述,1~30个字符 | **accessToken** | **string**| 用户授权码 | [optional] **public** | **bool**| 公开/私有,默认: 私有 | [optional] diff --git a/docs/Api/IssuesApi.md b/docs/Api/IssuesApi.md index 315c974..4ce3d22 100644 --- a/docs/Api/IssuesApi.md +++ b/docs/Api/IssuesApi.md @@ -726,7 +726,7 @@ No authorization required [[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** -> \Gitee\Model\Note getV5ReposOwnerRepoIssuesComments($owner, $repo, $accessToken, $sort, $direction, $since, $page, $perPage) +> \Gitee\Model\Note[] getV5ReposOwnerRepoIssuesComments($owner, $repo, $accessToken, $sort, $direction, $since, $page, $perPage) 获取仓库所有Issue的评论 @@ -775,7 +775,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Note**](../Model/Note.md) +[**\Gitee\Model\Note[]**](../Model/Note.md) ### Authorization @@ -899,7 +899,7 @@ No authorization required [[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** -> \Gitee\Model\Note getV5ReposOwnerRepoIssuesNumberComments($owner, $repo, $number, $accessToken, $since, $page, $perPage, $order) +> \Gitee\Model\Note[] getV5ReposOwnerRepoIssuesNumberComments($owner, $repo, $number, $accessToken, $since, $page, $perPage, $order) 获取仓库某个Issue所有的评论 @@ -948,7 +948,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Note**](../Model/Note.md) +[**\Gitee\Model\Note[]**](../Model/Note.md) ### Authorization diff --git a/docs/Api/LabelsApi.md b/docs/Api/LabelsApi.md index 90e6991..02d476b 100644 --- a/docs/Api/LabelsApi.md +++ b/docs/Api/LabelsApi.md @@ -13,6 +13,7 @@ Method | HTTP request | Description [**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} | 根据标签名称获取单个标签 +[**getV5ReposOwnerRepoProjectLabels**](LabelsApi.md#getV5ReposOwnerRepoProjectLabels) | **GET** /v5/repos/{owner}/{repo}/project_labels | 获取仓库所有标签 [**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 | 创建仓库任务标签 @@ -506,6 +507,59 @@ No authorization required [[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) +# **getV5ReposOwnerRepoProjectLabels** +> \Gitee\Model\ProjectLabel[] getV5ReposOwnerRepoProjectLabels($owner, $repo, $accessToken) + +获取仓库所有标签 + +获取仓库所有标签 + +### Example +```php +getV5ReposOwnerRepoProjectLabels($owner, $repo, $accessToken); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LabelsApi->getV5ReposOwnerRepoProjectLabels: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **accessToken** | **string**| 用户授权码 | [optional] + +### Return type + +[**\Gitee\Model\ProjectLabel[]**](../Model/ProjectLabel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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** > \Gitee\Model\Label patchV5ReposOwnerRepoLabelsOriginalName($owner, $repo, $originalName, $accessToken, $name, $color) @@ -566,7 +620,7 @@ No authorization required [[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** -> \Gitee\Model\Label postV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $body, $accessToken) +> \Gitee\Model\Label[] postV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $body, $accessToken) 创建Issue标签 @@ -609,7 +663,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Label**](../Model/Label.md) +[**\Gitee\Model\Label[]**](../Model/Label.md) ### Authorization @@ -680,7 +734,7 @@ No authorization required [[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) # **postV5ReposOwnerRepoProjectLabels** -> \Gitee\Model\ProjectLabel postV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessToken) +> \Gitee\Model\ProjectLabel[] postV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessToken) 添加仓库标签 @@ -721,7 +775,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\ProjectLabel**](../Model/ProjectLabel.md) +[**\Gitee\Model\ProjectLabel[]**](../Model/ProjectLabel.md) ### Authorization @@ -735,7 +789,7 @@ No authorization required [[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** -> \Gitee\Model\Label putV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $body, $accessToken) +> \Gitee\Model\Label[] putV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $body, $accessToken) 替换Issue所有标签 @@ -778,7 +832,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Label**](../Model/Label.md) +[**\Gitee\Model\Label[]**](../Model/Label.md) ### Authorization @@ -792,7 +846,7 @@ No authorization required [[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) # **putV5ReposOwnerRepoProjectLabels** -> \Gitee\Model\ProjectLabel putV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessToken) +> \Gitee\Model\ProjectLabel[] putV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessToken) 替换所有仓库标签 @@ -833,7 +887,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\ProjectLabel**](../Model/ProjectLabel.md) +[**\Gitee\Model\ProjectLabel[]**](../Model/ProjectLabel.md) ### Authorization diff --git a/docs/Api/MilestonesApi.md b/docs/Api/MilestonesApi.md index 716f264..92f1abb 100644 --- a/docs/Api/MilestonesApi.md +++ b/docs/Api/MilestonesApi.md @@ -204,7 +204,7 @@ $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织 $repo = "repo_example"; // string | 仓库路径(path) $number = 56; // int | 里程碑序号(id) $title = "title_example"; // string | 里程碑标题 -$dueOn = "dueOn_example"; // string | 里程碑的截止日期 +$dueOn = new \DateTime("2013-10-20"); // \DateTime | 里程碑的截止日期 $accessToken = "accessToken_example"; // string | 用户授权码 $state = "open"; // string | 里程碑状态: open, closed, all。默认: open $description = "description_example"; // string | 里程碑具体描述 @@ -226,7 +226,7 @@ Name | Type | Description | Notes **repo** | **string**| 仓库路径(path) | **number** | **int**| 里程碑序号(id) | **title** | **string**| 里程碑标题 | - **dueOn** | **string**| 里程碑的截止日期 | + **dueOn** | **\DateTime**| 里程碑的截止日期 | **accessToken** | **string**| 用户授权码 | [optional] **state** | **string**| 里程碑状态: open, closed, all。默认: open | [optional] [default to open] **description** | **string**| 里程碑具体描述 | [optional] @@ -266,7 +266,7 @@ $apiInstance = new Gitee\Api\MilestonesApi( $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织或个人的地址path) $repo = "repo_example"; // string | 仓库路径(path) $title = "title_example"; // string | 里程碑标题 -$dueOn = "dueOn_example"; // string | 里程碑的截止日期 +$dueOn = new \DateTime("2013-10-20"); // \DateTime | 里程碑的截止日期 $accessToken = "accessToken_example"; // string | 用户授权码 $state = "open"; // string | 里程碑状态: open, closed, all。默认: open $description = "description_example"; // string | 里程碑具体描述 @@ -287,7 +287,7 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **title** | **string**| 里程碑标题 | - **dueOn** | **string**| 里程碑的截止日期 | + **dueOn** | **\DateTime**| 里程碑的截止日期 | **accessToken** | **string**| 用户授权码 | [optional] **state** | **string**| 里程碑状态: open, closed, all。默认: open | [optional] [default to open] **description** | **string**| 里程碑具体描述 | [optional] diff --git a/docs/Api/OrganizationsApi.md b/docs/Api/OrganizationsApi.md index 07fdd32..bfdc21a 100644 --- a/docs/Api/OrganizationsApi.md +++ b/docs/Api/OrganizationsApi.md @@ -123,7 +123,7 @@ No authorization required [[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** -> \Gitee\Model\Group getV5OrgsOrg($org, $accessToken) +> \Gitee\Model\GroupDetail getV5OrgsOrg($org, $accessToken) 获取一个组织 @@ -160,7 +160,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Group**](../Model/Group.md) +[**\Gitee\Model\GroupDetail**](../Model/GroupDetail.md) ### Authorization diff --git a/docs/Api/PullRequestsApi.md b/docs/Api/PullRequestsApi.md index 7a99ad2..eb3d7f6 100644 --- a/docs/Api/PullRequestsApi.md +++ b/docs/Api/PullRequestsApi.md @@ -258,7 +258,7 @@ No authorization required [[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** -> \Gitee\Model\PullRequest[] getV5ReposOwnerRepoPulls($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage) +> \Gitee\Model\PullRequest[] getV5ReposOwnerRepoPulls($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage, $author, $assignee, $tester) 获取Pull Request列表 @@ -287,9 +287,12 @@ $milestoneNumber = 56; // int | 可选。里程碑序号(id) $labels = "labels_example"; // string | 用逗号分开的标签。如: bug,performance $page = 1; // int | 当前的页码 $perPage = 20; // int | 每页的数量,最大为 100 +$author = "author_example"; // string | 可选。PR 创建者用户名 +$assignee = "assignee_example"; // string | 可选。评审者用户名 +$tester = "tester_example"; // string | 可选。测试者用户名 try { - $result = $apiInstance->getV5ReposOwnerRepoPulls($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage); + $result = $apiInstance->getV5ReposOwnerRepoPulls($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage, $author, $assignee, $tester); print_r($result); } catch (Exception $e) { echo 'Exception when calling PullRequestsApi->getV5ReposOwnerRepoPulls: ', $e->getMessage(), PHP_EOL; @@ -314,6 +317,9 @@ Name | Type | Description | Notes **labels** | **string**| 用逗号分开的标签。如: bug,performance | [optional] **page** | **int**| 当前的页码 | [optional] [default to 1] **perPage** | **int**| 每页的数量,最大为 100 | [optional] [default to 20] + **author** | **string**| 可选。PR 创建者用户名 | [optional] + **assignee** | **string**| 可选。评审者用户名 | [optional] + **tester** | **string**| 可选。测试者用户名 | [optional] ### Return type @@ -786,7 +792,7 @@ No authorization required [[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** -> \Gitee\Model\OperateLog getV5ReposOwnerRepoPullsNumberOperateLogs($owner, $repo, $number, $accessToken, $sort) +> \Gitee\Model\OperateLog[] getV5ReposOwnerRepoPullsNumberOperateLogs($owner, $repo, $number, $accessToken, $sort) 获取某个Pull Request的操作日志 @@ -829,7 +835,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\OperateLog**](../Model/OperateLog.md) +[**\Gitee\Model\OperateLog[]**](../Model/OperateLog.md) ### Authorization @@ -900,7 +906,7 @@ No authorization required [[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** -> \Gitee\Model\PullRequest patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $draft, $squash) +> \Gitee\Model\PullRequest patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $closeRelatedIssue, $draft, $squash) 更新Pull Request信息 @@ -928,11 +934,12 @@ $labels = "labels_example"; // string | 用逗号分开的标签,名称要求 $assigneesNumber = 56; // int | 可选。最少审查人数 $testersNumber = 56; // int | 可选。最少测试人数 $refPullRequestNumbers = "refPullRequestNumbers_example"; // string | 可选。依赖的当前仓库下的PR编号,置空则清空依赖的PR。如:17,18,19 +$closeRelatedIssue = true; // bool | 可选,合并后是否关闭关联的 Issue,默认根据仓库配置设置 $draft = true; // bool | 是否设置为草稿 $squash = true; // bool | 接受 Pull Request 时使用扁平化(Squash)合并 try { - $result = $apiInstance->patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $draft, $squash); + $result = $apiInstance->patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $closeRelatedIssue, $draft, $squash); print_r($result); } catch (Exception $e) { echo 'Exception when calling PullRequestsApi->patchV5ReposOwnerRepoPullsNumber: ', $e->getMessage(), PHP_EOL; @@ -956,6 +963,7 @@ Name | Type | Description | Notes **assigneesNumber** | **int**| 可选。最少审查人数 | [optional] **testersNumber** | **int**| 可选。最少测试人数 | [optional] **refPullRequestNumbers** | **string**| 可选。依赖的当前仓库下的PR编号,置空则清空依赖的PR。如:17,18,19 | [optional] + **closeRelatedIssue** | **bool**| 可选,合并后是否关闭关联的 Issue,默认根据仓库配置设置 | [optional] **draft** | **bool**| 是否设置为草稿 | [optional] **squash** | **bool**| 接受 Pull Request 时使用扁平化(Squash)合并 | [optional] @@ -1294,7 +1302,7 @@ No authorization required [[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) # **postV5ReposOwnerRepoPullsNumberLabels** -> \Gitee\Model\Label postV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $body, $accessToken) +> \Gitee\Model\Label[] postV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $body, $accessToken) 创建 Pull Request 标签 @@ -1337,7 +1345,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Label**](../Model/Label.md) +[**\Gitee\Model\Label[]**](../Model/Label.md) ### Authorization @@ -1520,7 +1528,7 @@ No authorization required [[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) # **putV5ReposOwnerRepoPullsNumberLabels** -> \Gitee\Model\Label putV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $body, $accessToken) +> \Gitee\Model\Label[] putV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $body, $accessToken) 替换 Pull Request 所有标签 @@ -1563,7 +1571,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Label**](../Model/Label.md) +[**\Gitee\Model\Label[]**](../Model/Label.md) ### Authorization diff --git a/docs/Api/RepositoriesApi.md b/docs/Api/RepositoriesApi.md index 559c5de..1dcf097 100644 --- a/docs/Api/RepositoriesApi.md +++ b/docs/Api/RepositoriesApi.md @@ -7,28 +7,30 @@ Method | HTTP request | Description [**deleteV5ReposOwnerRepo**](RepositoriesApi.md#deleteV5ReposOwnerRepo) | **DELETE** /v5/repos/{owner}/{repo} | 删除一个仓库 [**deleteV5ReposOwnerRepoBaiduStatisticKey**](RepositoriesApi.md#deleteV5ReposOwnerRepoBaiduStatisticKey) | **DELETE** /v5/repos/{owner}/{repo}/baidu_statistic_key | 删除仓库的百度统计 key [**deleteV5ReposOwnerRepoBranchesBranchProtection**](RepositoriesApi.md#deleteV5ReposOwnerRepoBranchesBranchProtection) | **DELETE** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 取消保护分支的设置 -[**deleteV5ReposOwnerRepoBranchesWildcardSetting**](RepositoriesApi.md#deleteV5ReposOwnerRepoBranchesWildcardSetting) | **DELETE** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 删除仓库保护分支策略 +[**deleteV5ReposOwnerRepoBranchesWildcardSetting**](RepositoriesApi.md#deleteV5ReposOwnerRepoBranchesWildcardSetting) | **DELETE** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 删除保护分支规则 [**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 +[**deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId**](RepositoriesApi.md#deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId) | **DELETE** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_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} | 获取用户的某个仓库 [**getV5ReposOwnerRepoBaiduStatisticKey**](RepositoriesApi.md#getV5ReposOwnerRepoBaiduStatisticKey) | **GET** /v5/repos/{owner}/{repo}/baidu_statistic_key | 获取仓库的百度统计 key +[**getV5ReposOwnerRepoBlamePath**](RepositoriesApi.md#getV5ReposOwnerRepoBlamePath) | **GET** /v5/repos/{owner}/{repo}/blame/{path} | Blame [**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评论 +[**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之间对比的版本差异 +[**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 @@ -37,12 +39,18 @@ Method | HTTP request | Description [**getV5ReposOwnerRepoKeysId**](RepositoriesApi.md#getV5ReposOwnerRepoKeysId) | **GET** /v5/repos/{owner}/{repo}/keys/{id} | 获取仓库的单个公钥 [**getV5ReposOwnerRepoPages**](RepositoriesApi.md#getV5ReposOwnerRepoPages) | **GET** /v5/repos/{owner}/{repo}/pages | 获取Pages信息 [**getV5ReposOwnerRepoPushConfig**](RepositoriesApi.md#getV5ReposOwnerRepoPushConfig) | **GET** /v5/repos/{owner}/{repo}/push_config | 获取仓库推送规则设置 +[**getV5ReposOwnerRepoRawPath**](RepositoriesApi.md#getV5ReposOwnerRepoRawPath) | **GET** /v5/repos/{owner}/{repo}/raw/{path} | 获取 raw 文件(100MB 以内) [**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 +[**getV5ReposOwnerRepoReleasesReleaseIdAttachFiles**](RepositoriesApi.md#getV5ReposOwnerRepoReleasesReleaseIdAttachFiles) | **GET** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files | 获取仓库下的指定 Release 的所有附件 +[**getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId**](RepositoriesApi.md#getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId) | **GET** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id} | 获取仓库下指定 Release 的单个附件 +[**getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload**](RepositoriesApi.md#getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload) | **GET** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id}/download | 下载指定 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 +[**getV5ReposOwnerRepoTags**](RepositoriesApi.md#getV5ReposOwnerRepoTags) | **GET** /v5/repos/{owner}/{repo}/tags | 列出仓库所有的 tags +[**getV5ReposOwnerRepoTarball**](RepositoriesApi.md#getV5ReposOwnerRepoTarball) | **GET** /v5/repos/{owner}/{repo}/tarball | 下载仓库 tar.gz +[**getV5ReposOwnerRepoZipball**](RepositoriesApi.md#getV5ReposOwnerRepoZipball) | **GET** /v5/repos/{owner}/{repo}/zipball | 下载仓库 zip [**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} | 更新仓库设置 @@ -52,6 +60,7 @@ Method | HTTP request | Description [**postV5OrgsOrgRepos**](RepositoriesApi.md#postV5OrgsOrgRepos) | **POST** /v5/orgs/{org}/repos | 创建组织仓库 [**postV5ReposOwnerRepoBaiduStatisticKey**](RepositoriesApi.md#postV5ReposOwnerRepoBaiduStatisticKey) | **POST** /v5/repos/{owner}/{repo}/baidu_statistic_key | 设置/更新仓库的百度统计 key [**postV5ReposOwnerRepoBranches**](RepositoriesApi.md#postV5ReposOwnerRepoBranches) | **POST** /v5/repos/{owner}/{repo}/branches | 创建分支 +[**postV5ReposOwnerRepoCommits**](RepositoriesApi.md#postV5ReposOwnerRepoCommits) | **POST** /v5/repos/{owner}/{repo}/commits | 提交多个文件变更 [**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一个仓库 @@ -59,14 +68,15 @@ Method | HTTP request | Description [**postV5ReposOwnerRepoOpen**](RepositoriesApi.md#postV5ReposOwnerRepoOpen) | **POST** /v5/repos/{owner}/{repo}/open | 开通Gitee Go [**postV5ReposOwnerRepoPagesBuilds**](RepositoriesApi.md#postV5ReposOwnerRepoPagesBuilds) | **POST** /v5/repos/{owner}/{repo}/pages/builds | 请求建立Pages [**postV5ReposOwnerRepoReleases**](RepositoriesApi.md#postV5ReposOwnerRepoReleases) | **POST** /v5/repos/{owner}/{repo}/releases | 创建仓库Release +[**postV5ReposOwnerRepoReleasesReleaseIdAttachFiles**](RepositoriesApi.md#postV5ReposOwnerRepoReleasesReleaseIdAttachFiles) | **POST** /v5/repos/{owner}/{repo}/releases/{release_id}/attach_files | 上传附件到仓库指定 Release [**postV5ReposOwnerRepoTags**](RepositoriesApi.md#postV5ReposOwnerRepoTags) | **POST** /v5/repos/{owner}/{repo}/tags | 创建一个仓库的 Tag [**postV5ReposOwnerRepoTrafficData**](RepositoriesApi.md#postV5ReposOwnerRepoTrafficData) | **POST** /v5/repos/{owner}/{repo}/traffic-data | 获取最近30天的七日以内访问量 [**postV5UserRepos**](RepositoriesApi.md#postV5UserRepos) | **POST** /v5/user/repos | 创建一个仓库 [**putV5ReposOwnerRepoBranchesBranchProtection**](RepositoriesApi.md#putV5ReposOwnerRepoBranchesBranchProtection) | **PUT** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 设置分支保护 -[**putV5ReposOwnerRepoBranchesSettingNew**](RepositoriesApi.md#putV5ReposOwnerRepoBranchesSettingNew) | **PUT** /v5/repos/{owner}/{repo}/branches/setting/new | 新建仓库保护分支策略 -[**putV5ReposOwnerRepoBranchesWildcardSetting**](RepositoriesApi.md#putV5ReposOwnerRepoBranchesWildcardSetting) | **PUT** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 分支保护策略设置 +[**putV5ReposOwnerRepoBranchesSettingNew**](RepositoriesApi.md#putV5ReposOwnerRepoBranchesSettingNew) | **PUT** /v5/repos/{owner}/{repo}/branches/setting/new | 新建保护分支规则 +[**putV5ReposOwnerRepoBranchesWildcardSetting**](RepositoriesApi.md#putV5ReposOwnerRepoBranchesWildcardSetting) | **PUT** /v5/repos/{owner}/{repo}/branches/{wildcard}/setting | 更新保护分支规则 [**putV5ReposOwnerRepoClear**](RepositoriesApi.md#putV5ReposOwnerRepoClear) | **PUT** /v5/repos/{owner}/{repo}/clear | 清空一个仓库 -[**putV5ReposOwnerRepoCollaboratorsUsername**](RepositoriesApi.md#putV5ReposOwnerRepoCollaboratorsUsername) | **PUT** /v5/repos/{owner}/{repo}/collaborators/{username} | 添加仓库成员 +[**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} | 启用仓库公钥 [**putV5ReposOwnerRepoPages**](RepositoriesApi.md#putV5ReposOwnerRepoPages) | **PUT** /v5/repos/{owner}/{repo}/pages | 上传设置 Pages SSL 证书和域名 @@ -235,9 +245,9 @@ No authorization required # **deleteV5ReposOwnerRepoBranchesWildcardSetting** > \Gitee\Model\ProtectionRule deleteV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wildcard, $accessToken) -删除仓库保护分支策略 +删除保护分支规则 -删除仓库保护分支策略 +删除保护分支规则 ### Example ```php @@ -626,8 +636,64 @@ No authorization required [[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) +# **deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId** +> deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId($owner, $repo, $releaseId, $attachFileId, $accessToken) + +删除仓库下指定 Release 的指定附件 + +删除仓库下指定 Release 的指定附件 + +### Example +```php +deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId($owner, $repo, $releaseId, $attachFileId, $accessToken); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **releaseId** | **int**| | + **attachFileId** | **int**| | + **accessToken** | **string**| 用户授权码 | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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** -> \Gitee\Model\Project getV5EnterprisesEnterpriseRepos($enterprise, $accessToken, $type, $direct, $page, $perPage) +> \Gitee\Model\Project[] getV5EnterprisesEnterpriseRepos($enterprise, $accessToken, $search, $type, $direct, $page, $perPage) 获取企业的所有仓库 @@ -645,13 +711,14 @@ $apiInstance = new Gitee\Api\RepositoriesApi( ); $enterprise = "enterprise_example"; // string | 企业的路径(path/login) $accessToken = "accessToken_example"; // string | 用户授权码 +$search = "search_example"; // string | 搜索字符串 $type = "all"; // string | 筛选仓库的类型,可以是 all, public, internal, private。默认: all $direct = true; // bool | 只获取直属仓库,默认: false $page = 1; // int | 当前的页码 $perPage = 20; // int | 每页的数量,最大为 100 try { - $result = $apiInstance->getV5EnterprisesEnterpriseRepos($enterprise, $accessToken, $type, $direct, $page, $perPage); + $result = $apiInstance->getV5EnterprisesEnterpriseRepos($enterprise, $accessToken, $search, $type, $direct, $page, $perPage); print_r($result); } catch (Exception $e) { echo 'Exception when calling RepositoriesApi->getV5EnterprisesEnterpriseRepos: ', $e->getMessage(), PHP_EOL; @@ -665,6 +732,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enterprise** | **string**| 企业的路径(path/login) | **accessToken** | **string**| 用户授权码 | [optional] + **search** | **string**| 搜索字符串 | [optional] **type** | **string**| 筛选仓库的类型,可以是 all, public, internal, private。默认: all | [optional] [default to all] **direct** | **bool**| 只获取直属仓库,默认: false | [optional] **page** | **int**| 当前的页码 | [optional] [default to 1] @@ -672,7 +740,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Project**](../Model/Project.md) +[**\Gitee\Model\Project[]**](../Model/Project.md) ### Authorization @@ -686,7 +754,7 @@ No authorization required [[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** -> \Gitee\Model\Project getV5OrgsOrgRepos($org, $accessToken, $type, $page, $perPage) +> \Gitee\Model\Project[] getV5OrgsOrgRepos($org, $accessToken, $type, $page, $perPage) 获取一个组织的仓库 @@ -729,7 +797,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Project**](../Model/Project.md) +[**\Gitee\Model\Project[]**](../Model/Project.md) ### Authorization @@ -847,8 +915,65 @@ No authorization required [[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) +# **getV5ReposOwnerRepoBlamePath** +> \Gitee\Model\Blame[] getV5ReposOwnerRepoBlamePath($owner, $repo, $path, $accessToken, $ref) + +Blame + +Blame + +### Example +```php +getV5ReposOwnerRepoBlamePath($owner, $repo, $path, $accessToken, $ref); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoBlamePath: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **path** | **string**| 文件的路径(1 MB 以内的文件文件) | + **accessToken** | **string**| 用户授权码 | [optional] + **ref** | **string**| 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) | [optional] + +### Return type + +[**\Gitee\Model\Blame[]**](../Model/Blame.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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** -> \Gitee\Model\Branch[] getV5ReposOwnerRepoBranches($owner, $repo, $accessToken) +> \Gitee\Model\Branch[] getV5ReposOwnerRepoBranches($owner, $repo, $accessToken, $sort, $direction, $page, $perPage) 获取所有分支 @@ -867,9 +992,13 @@ $apiInstance = new Gitee\Api\RepositoriesApi( $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织或个人的地址path) $repo = "repo_example"; // string | 仓库路径(path) $accessToken = "accessToken_example"; // string | 用户授权码 +$sort = "name"; // string | 排序字段 +$direction = "asc"; // string | 排序方向 +$page = 1; // int | 当前的页码 +$perPage = 56; // int | 每页的数量,最大为 100 try { - $result = $apiInstance->getV5ReposOwnerRepoBranches($owner, $repo, $accessToken); + $result = $apiInstance->getV5ReposOwnerRepoBranches($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); print_r($result); } catch (Exception $e) { echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoBranches: ', $e->getMessage(), PHP_EOL; @@ -884,6 +1013,10 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **accessToken** | **string**| 用户授权码 | [optional] + **sort** | **string**| 排序字段 | [optional] [default to name] + **direction** | **string**| 排序方向 | [optional] [default to asc] + **page** | **int**| 当前的页码 | [optional] [default to 1] + **perPage** | **int**| 每页的数量,最大为 100 | [optional] ### Return type @@ -956,7 +1089,7 @@ No authorization required [[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** -> \Gitee\Model\ProjectMember getV5ReposOwnerRepoCollaborators($owner, $repo, $accessToken, $page, $perPage) +> \Gitee\Model\ProjectMember[] getV5ReposOwnerRepoCollaborators($owner, $repo, $accessToken, $page, $perPage) 获取仓库的所有成员 @@ -999,7 +1132,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\ProjectMember**](../Model/ProjectMember.md) +[**\Gitee\Model\ProjectMember[]**](../Model/ProjectMember.md) ### Authorization @@ -1122,11 +1255,11 @@ No authorization required [[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** -> \Gitee\Model\Note getV5ReposOwnerRepoComments($owner, $repo, $accessToken, $page, $perPage, $order) +> \Gitee\Model\Note[] getV5ReposOwnerRepoComments($owner, $repo, $accessToken, $page, $perPage, $order) -获取仓库的Commit评论 +获取仓库的 Commit 评论 -获取仓库的Commit评论 +获取仓库的 Commit 评论 ### Example ```php @@ -1167,7 +1300,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Note**](../Model/Note.md) +[**\Gitee\Model\Note[]**](../Model/Note.md) ### Authorization @@ -1303,7 +1436,7 @@ No authorization required [[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** -> \Gitee\Model\Note getV5ReposOwnerRepoCommitsRefComments($owner, $repo, $ref, $accessToken, $page, $perPage) +> \Gitee\Model\Note[] getV5ReposOwnerRepoCommitsRefComments($owner, $repo, $ref, $accessToken, $page, $perPage) 获取单个Commit的评论 @@ -1348,7 +1481,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Note**](../Model/Note.md) +[**\Gitee\Model\Note[]**](../Model/Note.md) ### Authorization @@ -1417,11 +1550,11 @@ No authorization required [[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** -> \Gitee\Model\Compare getV5ReposOwnerRepoCompareBaseHead($owner, $repo, $base, $head, $accessToken) +> \Gitee\Model\Compare getV5ReposOwnerRepoCompareBaseHead($owner, $repo, $base, $head, $accessToken, $straight, $suffix) -两个Commits之间对比的版本差异 +Commits 对比 -两个Commits之间对比的版本差异 +Commits 对比 返回的 commits 数量限制在 100 以内 ### Example ```php @@ -1435,12 +1568,14 @@ $apiInstance = new Gitee\Api\RepositoriesApi( ); $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织或个人的地址path) $repo = "repo_example"; // string | 仓库路径(path) -$base = "base_example"; // string | Commit提交的SHA值或者分支名作为对比起点 -$head = "head_example"; // string | Commit提交的SHA值或者分支名作为对比终点 +$base = "base_example"; // string | 对比的起点。Commit SHA、分支名或标签名 +$head = "head_example"; // string | 对比的终点。Commit SHA、分支名或标签名 $accessToken = "accessToken_example"; // string | 用户授权码 +$straight = true; // bool | 是否直对比。默认 false +$suffix = "suffix_example"; // string | 按照文件后缀过滤文件,如 `.txt`。只影响 `files` try { - $result = $apiInstance->getV5ReposOwnerRepoCompareBaseHead($owner, $repo, $base, $head, $accessToken); + $result = $apiInstance->getV5ReposOwnerRepoCompareBaseHead($owner, $repo, $base, $head, $accessToken, $straight, $suffix); print_r($result); } catch (Exception $e) { echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoCompareBaseHead: ', $e->getMessage(), PHP_EOL; @@ -1454,9 +1589,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | - **base** | **string**| Commit提交的SHA值或者分支名作为对比起点 | - **head** | **string**| Commit提交的SHA值或者分支名作为对比终点 | + **base** | **string**| 对比的起点。Commit SHA、分支名或标签名 | + **head** | **string**| 对比的终点。Commit SHA、分支名或标签名 | **accessToken** | **string**| 用户授权码 | [optional] + **straight** | **bool**| 是否直对比。默认 false | [optional] + **suffix** | **string**| 按照文件后缀过滤文件,如 `.txt`。只影响 `files` | [optional] ### Return type @@ -1531,7 +1668,7 @@ No authorization required [[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** -> \Gitee\Model\Contributor getV5ReposOwnerRepoContributors($owner, $repo, $accessToken, $type) +> \Gitee\Model\Contributor[] getV5ReposOwnerRepoContributors($owner, $repo, $accessToken, $type) 获取仓库贡献者 @@ -1572,7 +1709,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Contributor**](../Model/Contributor.md) +[**\Gitee\Model\Contributor[]**](../Model/Contributor.md) ### Authorization @@ -1586,7 +1723,7 @@ No authorization required [[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** -> \Gitee\Model\Project getV5ReposOwnerRepoForks($owner, $repo, $accessToken, $sort, $page, $perPage) +> \Gitee\Model\Project[] getV5ReposOwnerRepoForks($owner, $repo, $accessToken, $sort, $page, $perPage) 查看仓库的Forks @@ -1631,7 +1768,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Project**](../Model/Project.md) +[**\Gitee\Model\Project[]**](../Model/Project.md) ### Authorization @@ -1918,6 +2055,62 @@ No authorization required [[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) +# **getV5ReposOwnerRepoRawPath** +> getV5ReposOwnerRepoRawPath($owner, $repo, $path, $accessToken, $ref) + +获取 raw 文件(100MB 以内) + +获取 raw 文件(100MB 以内) + +### Example +```php +getV5ReposOwnerRepoRawPath($owner, $repo, $path, $accessToken, $ref); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoRawPath: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **path** | **string**| 文件的路径 | + **accessToken** | **string**| 用户授权码 | [optional] + **ref** | **string**| 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[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** > \Gitee\Model\Content getV5ReposOwnerRepoReadme($owner, $repo, $accessToken, $ref) @@ -2140,6 +2333,180 @@ No authorization required [[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) +# **getV5ReposOwnerRepoReleasesReleaseIdAttachFiles** +> \Gitee\Model\AttachFile[] getV5ReposOwnerRepoReleasesReleaseIdAttachFiles($owner, $repo, $releaseId, $accessToken, $page, $perPage, $direction) + +获取仓库下的指定 Release 的所有附件 + +获取仓库下的指定 Release 的所有附件 + +### Example +```php +getV5ReposOwnerRepoReleasesReleaseIdAttachFiles($owner, $repo, $releaseId, $accessToken, $page, $perPage, $direction); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoReleasesReleaseIdAttachFiles: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **releaseId** | **int**| 发行版本的ID | + **accessToken** | **string**| 用户授权码 | [optional] + **page** | **int**| 当前的页码 | [optional] [default to 1] + **perPage** | **int**| 每页的数量,最大为 100 | [optional] [default to 20] + **direction** | **string**| 可选: 升序/降序,默认为升序 | [optional] + +### Return type + +[**\Gitee\Model\AttachFile[]**](../Model/AttachFile.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId** +> \Gitee\Model\AttachFile getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId($owner, $repo, $releaseId, $attachFileId, $accessToken) + +获取仓库下指定 Release 的单个附件 + +获取仓库下指定 Release 的单个附件 + +### Example +```php +getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId($owner, $repo, $releaseId, $attachFileId, $accessToken); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **releaseId** | **int**| 发行版本的ID | + **attachFileId** | **int**| 发行版本下的附件ID | + **accessToken** | **string**| 用户授权码 | [optional] + +### Return type + +[**\Gitee\Model\AttachFile**](../Model/AttachFile.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload** +> getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload($owner, $repo, $releaseId, $attachFileId, $accessToken) + +下载指定 Release 的单个附件 + +下载指定 Release 的单个附件 + +### Example +```php +getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload($owner, $repo, $releaseId, $attachFileId, $accessToken); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **releaseId** | **int**| 发行版本的ID | + **attachFileId** | **int**| 发行版本下的附件ID | + **accessToken** | **string**| 用户授权码 | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[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** > \Gitee\Model\Release getV5ReposOwnerRepoReleasesTagsTag($owner, $repo, $tag, $accessToken) @@ -2196,11 +2563,11 @@ No authorization required [[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** -> \Gitee\Model\Tag getV5ReposOwnerRepoTags($owner, $repo, $accessToken) +> \Gitee\Model\Tag[] getV5ReposOwnerRepoTags($owner, $repo, $accessToken, $sort, $direction, $page, $perPage) -列出仓库所有的tags +列出仓库所有的 tags -列出仓库所有的tags +列出仓库所有的 tags ### Example ```php @@ -2215,9 +2582,13 @@ $apiInstance = new Gitee\Api\RepositoriesApi( $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织或个人的地址path) $repo = "repo_example"; // string | 仓库路径(path) $accessToken = "accessToken_example"; // string | 用户授权码 +$sort = "name"; // string | 排序字段 +$direction = "asc"; // string | 排序方向 +$page = 1; // int | 当前的页码 +$perPage = 56; // int | 每页的数量,最大为 100 try { - $result = $apiInstance->getV5ReposOwnerRepoTags($owner, $repo, $accessToken); + $result = $apiInstance->getV5ReposOwnerRepoTags($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); print_r($result); } catch (Exception $e) { echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoTags: ', $e->getMessage(), PHP_EOL; @@ -2232,10 +2603,14 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **accessToken** | **string**| 用户授权码 | [optional] + **sort** | **string**| 排序字段 | [optional] [default to name] + **direction** | **string**| 排序方向 | [optional] [default to asc] + **page** | **int**| 当前的页码 | [optional] [default to 1] + **perPage** | **int**| 每页的数量,最大为 100 | [optional] ### Return type -[**\Gitee\Model\Tag**](../Model/Tag.md) +[**\Gitee\Model\Tag[]**](../Model/Tag.md) ### Authorization @@ -2248,8 +2623,116 @@ No authorization required [[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) +# **getV5ReposOwnerRepoTarball** +> getV5ReposOwnerRepoTarball($owner, $repo, $accessToken, $ref) + +下载仓库 tar.gz + +下载仓库 tar.gz + +### Example +```php +getV5ReposOwnerRepoTarball($owner, $repo, $accessToken, $ref); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoTarball: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **accessToken** | **string**| 用户授权码 | [optional] + **ref** | **string**| 分支、tag或commit。默认: 仓库的默认分支(通常是master) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/gzip + +[[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) + +# **getV5ReposOwnerRepoZipball** +> getV5ReposOwnerRepoZipball($owner, $repo, $accessToken, $ref) + +下载仓库 zip + +下载仓库 zip + +### Example +```php +getV5ReposOwnerRepoZipball($owner, $repo, $accessToken, $ref); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->getV5ReposOwnerRepoZipball: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **accessToken** | **string**| 用户授权码 | [optional] + **ref** | **string**| 分支、tag或commit。默认: 仓库的默认分支(通常是master) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/zip + +[[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** -> \Gitee\Model\Project getV5UserRepos($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage) +> \Gitee\Model\Project[] getV5UserRepos($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage) 列出授权用户的所有仓库 @@ -2300,7 +2783,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Project**](../Model/Project.md) +[**\Gitee\Model\Project[]**](../Model/Project.md) ### Authorization @@ -2314,7 +2797,7 @@ No authorization required [[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** -> \Gitee\Model\Project getV5UsersUsernameRepos($username, $accessToken, $type, $sort, $direction, $page, $perPage) +> \Gitee\Model\Project[] getV5UsersUsernameRepos($username, $accessToken, $type, $sort, $direction, $page, $perPage) 获取某个用户的公开仓库 @@ -2361,7 +2844,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Project**](../Model/Project.md) +[**\Gitee\Model\Project[]**](../Model/Project.md) ### Authorization @@ -2850,6 +3333,59 @@ No authorization required [[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) +# **postV5ReposOwnerRepoCommits** +> \Gitee\Model\RepoCommitWithFiles postV5ReposOwnerRepoCommits($owner, $repo, $v5ReposOwnerRepoCommits) + +提交多个文件变更 + +提交多个文件变更 + +### Example +```php +postV5ReposOwnerRepoCommits($owner, $repo, $v5ReposOwnerRepoCommits); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->postV5ReposOwnerRepoCommits: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **v5ReposOwnerRepoCommits** | [**\Gitee\Model\PostV5ReposOwnerRepoCommits**](../Model/PostV5ReposOwnerRepoCommits.md)| | + +### Return type + +[**\Gitee\Model\RepoCommitWithFiles**](../Model/RepoCommitWithFiles.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **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** > \Gitee\Model\Note postV5ReposOwnerRepoCommitsShaComments($owner, $repo, $sha, $body, $accessToken, $path, $position) @@ -3000,7 +3536,7 @@ $apiInstance = new Gitee\Api\RepositoriesApi( $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织或个人的地址path) $repo = "repo_example"; // string | 仓库路径(path) $accessToken = "accessToken_example"; // string | 用户授权码 -$organization = "organization_example"; // string | 组织空间地址,不填写默认Fork到用户个人空间地址 +$organization = "organization_example"; // string | 组织空间完整地址,不填写默认Fork到用户个人空间地址 $name = "name_example"; // string | fork 后仓库名称。默认: 源仓库名称 $path = "path_example"; // string | fork 后仓库地址。默认: 源仓库地址 @@ -3020,7 +3556,7 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **accessToken** | **string**| 用户授权码 | [optional] - **organization** | **string**| 组织空间地址,不填写默认Fork到用户个人空间地址 | [optional] + **organization** | **string**| 组织空间完整地址,不填写默认Fork到用户个人空间地址 | [optional] **name** | **string**| fork 后仓库名称。默认: 源仓库名称 | [optional] **path** | **string**| fork 后仓库地址。默认: 源仓库地址 | [optional] @@ -3263,6 +3799,63 @@ No authorization required [[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) +# **postV5ReposOwnerRepoReleasesReleaseIdAttachFiles** +> \Gitee\Model\AttachFile postV5ReposOwnerRepoReleasesReleaseIdAttachFiles($owner, $repo, $releaseId, $file, $accessToken) + +上传附件到仓库指定 Release + +上传附件到仓库指定 Release + +### Example +```php +postV5ReposOwnerRepoReleasesReleaseIdAttachFiles($owner, $repo, $releaseId, $file, $accessToken); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RepositoriesApi->postV5ReposOwnerRepoReleasesReleaseIdAttachFiles: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **releaseId** | **int**| 发行版本的ID | + **file** | **\SplFileObject**| 上传的文件 | + **accessToken** | **string**| 用户授权码 | [optional] + +### Return type + +[**\Gitee\Model\AttachFile**](../Model/AttachFile.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: 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) + # **postV5ReposOwnerRepoTags** > \Gitee\Model\Tag postV5ReposOwnerRepoTags($owner, $repo, $refs, $tagName, $accessToken, $tagMessage) @@ -3506,11 +4099,11 @@ No authorization required [[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) # **putV5ReposOwnerRepoBranchesSettingNew** -> \Gitee\Model\ProtectionRule putV5ReposOwnerRepoBranchesSettingNew($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken) +> \Gitee\Model\ProtectionRule putV5ReposOwnerRepoBranchesSettingNew($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $escapseProtectBranchList) -新建仓库保护分支策略 +新建保护分支规则 -新建仓库保护分支策略 +新建保护分支规则 ### Example ```php @@ -3525,13 +4118,14 @@ $apiInstance = new Gitee\Api\RepositoriesApi( $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织或个人的地址path) $repo = "repo_example"; // string | 仓库路径(path) $wildcard = "wildcard_example"; // string | 分支/通配符 -$pusher = "admin"; // string | admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) -$merger = "admin"; // string | admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) -$mode = "standard"; // string | 模式 standard: 标准模式, review: 评审模式 +$pusher = "admin"; // string | 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) +$merger = "admin"; // string | 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) +$mode = "standard"; // string | 模式。standard: 标准模式, review: 评审模式 $accessToken = "accessToken_example"; // string | 用户授权码 +$escapseProtectBranchList = array("escapseProtectBranchList_example"); // string[] | 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] try { - $result = $apiInstance->putV5ReposOwnerRepoBranchesSettingNew($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken); + $result = $apiInstance->putV5ReposOwnerRepoBranchesSettingNew($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $escapseProtectBranchList); print_r($result); } catch (Exception $e) { echo 'Exception when calling RepositoriesApi->putV5ReposOwnerRepoBranchesSettingNew: ', $e->getMessage(), PHP_EOL; @@ -3546,10 +4140,11 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **wildcard** | **string**| 分支/通配符 | - **pusher** | **string**| admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) | [default to admin] - **merger** | **string**| admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) | [default to admin] - **mode** | **string**| 模式 standard: 标准模式, review: 评审模式 | [default to standard] + **pusher** | **string**| 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) | [default to admin] + **merger** | **string**| 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) | [default to admin] + **mode** | **string**| 模式。standard: 标准模式, review: 评审模式 | [default to standard] **accessToken** | **string**| 用户授权码 | [optional] + **escapseProtectBranchList** | [**string[]**](../Model/string.md)| 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] | [optional] ### Return type @@ -3567,11 +4162,11 @@ No authorization required [[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) # **putV5ReposOwnerRepoBranchesWildcardSetting** -> \Gitee\Model\ProtectionRule putV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard) +> \Gitee\Model\ProtectionRule putV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard, $escapseProtectBranchList) -分支保护策略设置 +更新保护分支规则 -分支保护策略设置 +更新保护分支规则 ### Example ```php @@ -3586,14 +4181,15 @@ $apiInstance = new Gitee\Api\RepositoriesApi( $owner = "owner_example"; // string | 仓库所属空间地址(企业、组织或个人的地址path) $repo = "repo_example"; // string | 仓库路径(path) $wildcard = "wildcard_example"; // string | 分支/通配符 -$pusher = "admin"; // string | admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) -$merger = "admin"; // string | admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) -$mode = "standard"; // string | 模式 standard: 标准模式, review: 评审模式 +$pusher = "admin"; // string | 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) +$merger = "admin"; // string | 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) +$mode = "standard"; // string | 模式。standard: 标准模式, review: 评审模式 $accessToken = "accessToken_example"; // string | 用户授权码 $newWildcard = "newWildcard_example"; // string | 新分支/通配符(为空不修改) +$escapseProtectBranchList = array("escapseProtectBranchList_example"); // string[] | 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] try { - $result = $apiInstance->putV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard); + $result = $apiInstance->putV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard, $escapseProtectBranchList); print_r($result); } catch (Exception $e) { echo 'Exception when calling RepositoriesApi->putV5ReposOwnerRepoBranchesWildcardSetting: ', $e->getMessage(), PHP_EOL; @@ -3608,11 +4204,12 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **wildcard** | **string**| 分支/通配符 | - **pusher** | **string**| admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) | [default to admin] - **merger** | **string**| admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) | [default to admin] - **mode** | **string**| 模式 standard: 标准模式, review: 评审模式 | [default to standard] + **pusher** | **string**| 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) | [default to admin] + **merger** | **string**| 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) | [default to admin] + **mode** | **string**| 模式。standard: 标准模式, review: 评审模式 | [default to standard] **accessToken** | **string**| 用户授权码 | [optional] **newWildcard** | **string**| 新分支/通配符(为空不修改) | [optional] + **escapseProtectBranchList** | [**string[]**](../Model/string.md)| 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] | [optional] ### Return type @@ -3684,9 +4281,9 @@ No authorization required # **putV5ReposOwnerRepoCollaboratorsUsername** > \Gitee\Model\ProjectMember putV5ReposOwnerRepoCollaboratorsUsername($owner, $repo, $username, $permission, $accessToken) -添加仓库成员 +添加仓库成员或更新仓库成员权限 -添加仓库成员 +添加仓库成员或更新仓库成员权限 ### Example ```php @@ -3991,7 +4588,7 @@ No authorization required [[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) # **putV5ReposOwnerRepoReviewer** -> \Gitee\Model\Contributor putV5ReposOwnerRepoReviewer($owner, $repo, $assignees, $testers, $assigneesNumber, $testersNumber, $accessToken) +> \Gitee\Model\Project putV5ReposOwnerRepoReviewer($owner, $repo, $assignees, $testers, $assigneesNumber, $testersNumber, $accessToken) 修改代码审查设置 @@ -4038,7 +4635,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\Contributor**](../Model/Contributor.md) +[**\Gitee\Model\Project**](../Model/Project.md) ### Authorization diff --git a/docs/Api/UsersApi.md b/docs/Api/UsersApi.md index 94f83ba..c60d9f5 100644 --- a/docs/Api/UsersApi.md +++ b/docs/Api/UsersApi.md @@ -434,7 +434,7 @@ No authorization required [[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** -> \Gitee\Model\ModelNamespace[] getV5UserNamespace($path, $accessToken) +> \Gitee\Model\ModelNamespace getV5UserNamespace($path, $accessToken) 获取授权用户的一个 Namespace @@ -471,7 +471,7 @@ Name | Type | Description | Notes ### Return type -[**\Gitee\Model\ModelNamespace[]**](../Model/ModelNamespace.md) +[**\Gitee\Model\ModelNamespace**](../Model/ModelNamespace.md) ### Authorization diff --git a/docs/Model/AttachFile.md b/docs/Model/AttachFile.md new file mode 100644 index 0000000..170d3fb --- /dev/null +++ b/docs/Model/AttachFile.md @@ -0,0 +1,15 @@ +# AttachFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **string** | | [optional] +**size** | **int** | | [optional] +**uploader** | [**\Gitee\Model\UserMini**](UserMini.md) | | [optional] +**browserDownloadUrl** | **string** | | [optional] + +[[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/Model/Blame.md b/docs/Model/Blame.md new file mode 100644 index 0000000..4010dea --- /dev/null +++ b/docs/Model/Blame.md @@ -0,0 +1,12 @@ +# Blame + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | [**\Gitee\Model\Commit**](Commit.md) | | [optional] +**lines** | **string[]** | 代码行 | [optional] + +[[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/Model/Blob.md b/docs/Model/Blob.md index e13bde3..a003bf8 100644 --- a/docs/Model/Blob.md +++ b/docs/Model/Blob.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sha** | **string** | | [optional] -**size** | **string** | | [optional] +**size** | **int** | | [optional] **url** | **string** | | [optional] **content** | **string** | | [optional] **encoding** | **string** | | [optional] diff --git a/docs/Model/Branch.md b/docs/Model/Branch.md index b0ccd30..dc61301 100644 --- a/docs/Model/Branch.md +++ b/docs/Model/Branch.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | | [optional] **commit** | **string** | | [optional] -**protected** | **string** | | [optional] +**protected** | **bool** | | [optional] **protectionUrl** | **string** | | [optional] [[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/Model/CheckAnnotation.md b/docs/Model/CheckAnnotation.md new file mode 100644 index 0000000..cff780f --- /dev/null +++ b/docs/Model/CheckAnnotation.md @@ -0,0 +1,20 @@ +# CheckAnnotation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path** | **string** | 文件路径 | [optional] +**startLine** | **int** | 开始行 | [optional] +**endLine** | **int** | 结束行 | [optional] +**startColumn** | **int** | 开始列 | [optional] +**endColumn** | **int** | 结束列 | [optional] +**annotationLevel** | **string** | 注释级别 | [optional] +**title** | **string** | 标题 | [optional] +**message** | **string** | 信息 | [optional] +**rawDetails** | **string** | 详情 | [optional] +**blobHref** | **string** | 文件路由 | [optional] + +[[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/Model/CheckRun.md b/docs/Model/CheckRun.md new file mode 100644 index 0000000..bf155c2 --- /dev/null +++ b/docs/Model/CheckRun.md @@ -0,0 +1,21 @@ +# CheckRun + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**headSha** | **string** | 提交 sha 值 | [optional] +**url** | **string** | api 路由 | [optional] +**htmlUrl** | **string** | 页面路由 | [optional] +**detailsUrl** | **string** | 外部详情路由 | [optional] +**status** | **string** | 状态 | [optional] +**conclusion** | **string** | 结论 | [optional] +**startedAt** | **string** | 开始时间 | [optional] +**completedAt** | **string** | 完成事件 | [optional] +**output** | **object** | 详情 | [optional] +**name** | **string** | 检查名 | [optional] + +[[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/Model/Code.md b/docs/Model/Code.md index 5bd49f3..50222b2 100644 --- a/docs/Model/Code.md +++ b/docs/Model/Code.md @@ -9,18 +9,18 @@ Name | Type | Description | Notes **commitsUrl** | **string** | | [optional] **id** | **string** | | [optional] **description** | **string** | | [optional] -**public** | **string** | | [optional] -**owner** | **string** | | [optional] -**user** | **string** | | [optional] +**public** | **bool** | | [optional] +**owner** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] **files** | **string** | | [optional] -**truncated** | **string** | | [optional] +**truncated** | **bool** | | [optional] **htmlUrl** | **string** | | [optional] -**comments** | **string** | | [optional] +**comments** | **int** | | [optional] **commentsUrl** | **string** | | [optional] **gitPullUrl** | **string** | | [optional] **gitPushUrl** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/CodeComment.md b/docs/Model/CodeComment.md index 37c2366..8c82e83 100644 --- a/docs/Model/CodeComment.md +++ b/docs/Model/CodeComment.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **int** | | [optional] **body** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/CodeForks.md b/docs/Model/CodeForks.md index 0bc0f72..3bdf14b 100644 --- a/docs/Model/CodeForks.md +++ b/docs/Model/CodeForks.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**user** | **string** | | [optional] +**user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] **url** | **string** | | [optional] **id** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/CodeForksHistory.md b/docs/Model/CodeForksHistory.md index 89be3d5..18f8ba9 100644 --- a/docs/Model/CodeForksHistory.md +++ b/docs/Model/CodeForksHistory.md @@ -9,18 +9,18 @@ Name | Type | Description | Notes **commitsUrl** | **string** | | [optional] **id** | **string** | | [optional] **description** | **string** | | [optional] -**public** | **string** | | [optional] -**owner** | **string** | | [optional] -**user** | **string** | | [optional] +**public** | **bool** | | [optional] +**owner** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] **files** | **string** | | [optional] -**truncated** | **string** | | [optional] +**truncated** | **bool** | | [optional] **htmlUrl** | **string** | | [optional] -**comments** | **string** | | [optional] +**comments** | **int** | | [optional] **commentsUrl** | **string** | | [optional] **gitPullUrl** | **string** | | [optional] **gitPushUrl** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **forks** | **string** | | [optional] **history** | **string** | | [optional] diff --git a/docs/Model/Commit.md b/docs/Model/Commit.md index 41e6ff9..545a988 100644 --- a/docs/Model/Commit.md +++ b/docs/Model/Commit.md @@ -5,11 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sha** | **string** | | [optional] -**author** | **string** | | [optional] -**committer** | **string** | | [optional] +**author** | [**\Gitee\Model\GitUser**](GitUser.md) | | [optional] +**committer** | [**\Gitee\Model\GitUser**](GitUser.md) | | [optional] **message** | **string** | | [optional] **tree** | **string** | | [optional] -**parents** | **string** | | [optional] +**parents** | **string[]** | | [optional] [[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/Model/CommitParentsBasic.md b/docs/Model/CommitParentsBasic.md index bf30c93..02fc102 100644 --- a/docs/Model/CommitParentsBasic.md +++ b/docs/Model/CommitParentsBasic.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **string** | | [optional] **sha** | **string** | 第一个父级commit的sha值(即将废弃) | [optional] +**shas** | **string[]** | 全部父级 commit 的 sha 值 | [optional] [[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/Model/Compare.md b/docs/Model/Compare.md index bc81910..23b01f2 100644 --- a/docs/Model/Compare.md +++ b/docs/Model/Compare.md @@ -4,10 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**baseCommit** | **string** | | [optional] -**mergeBaseCommit** | **string** | | [optional] -**commits** | **string** | | [optional] -**files** | **string** | | [optional] +**baseCommit** | [**\Gitee\Model\RepoCommit**](RepoCommit.md) | | [optional] +**mergeBaseCommit** | [**\Gitee\Model\RepoCommit**](RepoCommit.md) | | [optional] +**commits** | [**\Gitee\Model\RepoCommit[]**](RepoCommit.md) | commits 数量限制在 100 以内 | [optional] +**files** | [**\Gitee\Model\DiffFile[]**](DiffFile.md) | 文件列表 | [optional] +**truncated** | **bool** | 文件列表是否被截断 | [optional] [[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/Model/CompleteBranch.md b/docs/Model/CompleteBranch.md index 3c22120..687ff6b 100644 --- a/docs/Model/CompleteBranch.md +++ b/docs/Model/CompleteBranch.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | [optional] **commit** | **string** | | [optional] **links** | **string** | | [optional] -**protected** | **string** | | [optional] +**protected** | **bool** | | [optional] **protectionUrl** | **string** | | [optional] [[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/Model/Content.md b/docs/Model/Content.md index 38cb3c0..6bc0d35 100644 --- a/docs/Model/Content.md +++ b/docs/Model/Content.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **string** | | [optional] **encoding** | **string** | | [optional] -**size** | **string** | | [optional] +**size** | **int** | | [optional] **name** | **string** | | [optional] **path** | **string** | | [optional] **content** | **string** | | [optional] diff --git a/docs/Model/ContentBasic.md b/docs/Model/ContentBasic.md index d9f1f87..66dd001 100644 --- a/docs/Model/ContentBasic.md +++ b/docs/Model/ContentBasic.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | | [optional] **path** | **string** | | [optional] -**size** | **string** | | [optional] +**size** | **int** | | [optional] **sha** | **string** | | [optional] **type** | **string** | | [optional] **url** | **string** | | [optional] diff --git a/docs/Model/Contributor.md b/docs/Model/Contributor.md index ca2a3b6..b400440 100644 --- a/docs/Model/Contributor.md +++ b/docs/Model/Contributor.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **string** | | [optional] **name** | **string** | | [optional] -**contributions** | **string** | | [optional] +**contributions** | **int** | | [optional] [[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/Model/DiffFile.md b/docs/Model/DiffFile.md new file mode 100644 index 0000000..a922fd0 --- /dev/null +++ b/docs/Model/DiffFile.md @@ -0,0 +1,21 @@ +# DiffFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sha** | **string** | | [optional] +**filename** | **string** | 文件路径 | [optional] +**status** | **string** | 文件状态 | [optional] +**additions** | **int** | 新增行数 | [optional] +**deletions** | **int** | 删除行数 | [optional] +**changes** | **int** | 变更行数 | [optional] +**blobUrl** | **string** | blob 链接 | [optional] +**rawUrl** | **string** | raw 链接 | [optional] +**contentUrl** | **string** | content 链接 | [optional] +**patch** | **string** | patch | [optional] +**truncated** | **bool** | patch 内容是否被截断 | [optional] + +[[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/Model/EnterpriseMember.md b/docs/Model/EnterpriseMember.md index 5c33b13..898ff30 100644 --- a/docs/Model/EnterpriseMember.md +++ b/docs/Model/EnterpriseMember.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **string** | | [optional] -**active** | **string** | | [optional] +**active** | **bool** | | [optional] **remark** | **string** | | [optional] **role** | **string** | | [optional] -**outsourced** | **string** | | [optional] +**outsourced** | **bool** | | [optional] **enterprise** | [**\Gitee\Model\EnterpriseBasic**](EnterpriseBasic.md) | | [optional] -**user** | **string** | | [optional] +**user** | [**\Gitee\Model\UserMini**](UserMini.md) | | [optional] [[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/Model/Event.md b/docs/Model/Event.md index af67954..2f795c3 100644 --- a/docs/Model/Event.md +++ b/docs/Model/Event.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] **type** | **string** | | [optional] -**actor** | **string** | | [optional] -**repo** | **string** | | [optional] -**org** | **string** | | [optional] -**public** | **string** | | [optional] -**createdAt** | **string** | | [optional] +**actor** | [**\Gitee\Model\UserMini**](UserMini.md) | | [optional] +**repo** | [**\Gitee\Model\ProjectMini**](ProjectMini.md) | | [optional] +**org** | [**\Gitee\Model\GroupBasic**](GroupBasic.md) | | [optional] +**public** | **bool** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **payload** | **object** | 不同类型动态的内容 | [optional] [[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/Model/GitUser.md b/docs/Model/GitUser.md new file mode 100644 index 0000000..9766032 --- /dev/null +++ b/docs/Model/GitUser.md @@ -0,0 +1,13 @@ +# GitUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**email** | **string** | | [optional] +**date** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] + +[[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/Model/GiteeMetrics.md b/docs/Model/GiteeMetrics.md index 13d959d..385bef3 100644 --- a/docs/Model/GiteeMetrics.md +++ b/docs/Model/GiteeMetrics.md @@ -14,8 +14,8 @@ Name | Type | Description | Notes **trendPercent** | **float** | | [optional] **influence** | **int** | | [optional] **influencePercent** | **float** | | [optional] -**totalScore** | **string** | | [optional] -**createdAt** | **string** | | [optional] +**totalScore** | **int** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **repo** | [**\Gitee\Model\ProjectBasic**](ProjectBasic.md) | | [optional] [[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/Model/Group.md b/docs/Model/Group.md index 208ecdb..0cb8335 100644 --- a/docs/Model/Group.md +++ b/docs/Model/Group.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **eventsUrl** | **string** | | [optional] **membersUrl** | **string** | | [optional] **description** | **string** | | [optional] -**followCount** | **string** | | [optional] +**followCount** | **int** | | [optional] [[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/Model/GroupBasic.md b/docs/Model/GroupBasic.md new file mode 100644 index 0000000..8dac404 --- /dev/null +++ b/docs/Model/GroupBasic.md @@ -0,0 +1,15 @@ +# GroupBasic + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**login** | **string** | | [optional] +**name** | **string** | | [optional] +**url** | **string** | | [optional] +**avatarUrl** | **string** | | [optional] + +[[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/Model/GroupDetail.md b/docs/Model/GroupDetail.md index 513b778..e95e701 100644 --- a/docs/Model/GroupDetail.md +++ b/docs/Model/GroupDetail.md @@ -13,18 +13,18 @@ Name | Type | Description | Notes **eventsUrl** | **string** | | [optional] **membersUrl** | **string** | | [optional] **description** | **string** | | [optional] -**followCount** | **string** | | [optional] -**createdAt** | **string** | | [optional] +**followCount** | **int** | | [optional] **type** | **string** | | [optional] **location** | **string** | | [optional] **email** | **string** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **htmlUrl** | **string** | | [optional] -**public** | **string** | | [optional] +**public** | **bool** | | [optional] **enterprise** | **string** | | [optional] -**members** | **string** | | [optional] -**publicRepos** | **string** | | [optional] -**privateRepos** | **string** | | [optional] -**owner** | **string** | | [optional] +**members** | **int** | | [optional] +**publicRepos** | **int** | | [optional] +**privateRepos** | **int** | | [optional] +**owner** | [**\Gitee\Model\UserMini**](UserMini.md) | | [optional] [[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/Model/GroupFollowers.md b/docs/Model/GroupFollowers.md index 76a3c66..34faa89 100644 --- a/docs/Model/GroupFollowers.md +++ b/docs/Model/GroupFollowers.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **self** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] -**followedAt** | **string** | | [optional] +**followedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/GroupMember.md b/docs/Model/GroupMember.md index 7e937ef..4d0fa6b 100644 --- a/docs/Model/GroupMember.md +++ b/docs/Model/GroupMember.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **string** | | [optional] -**active** | **string** | | [optional] +**active** | **bool** | | [optional] **remark** | **string** | | [optional] **role** | **string** | | [optional] **organizationUrl** | **string** | | [optional] **organization** | [**\Gitee\Model\Group**](Group.md) | | [optional] -**user** | **string** | | [optional] +**user** | [**\Gitee\Model\UserMini**](UserMini.md) | | [optional] [[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/Model/Hook.md b/docs/Model/Hook.md index d8d21c2..8bd024e 100644 --- a/docs/Model/Hook.md +++ b/docs/Model/Hook.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **int** | | [optional] **url** | **string** | | [optional] -**createdAt** | **string** | | [optional] **password** | **string** | | [optional] -**projectId** | **string** | | [optional] **result** | **string** | | [optional] -**resultCode** | **string** | | [optional] -**pushEvents** | **string** | | [optional] -**tagPushEvents** | **string** | | [optional] -**issuesEvents** | **string** | | [optional] -**noteEvents** | **string** | | [optional] -**mergeRequestsEvents** | **string** | | [optional] +**projectId** | **int** | | [optional] +**resultCode** | **int** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**pushEvents** | **bool** | | [optional] +**tagPushEvents** | **bool** | | [optional] +**issuesEvents** | **bool** | | [optional] +**noteEvents** | **bool** | | [optional] +**mergeRequestsEvents** | **bool** | | [optional] [[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/Model/Issue.md b/docs/Model/Issue.md index b5652fb..6d046f6 100644 --- a/docs/Model/Issue.md +++ b/docs/Model/Issue.md @@ -19,16 +19,16 @@ Name | Type | Description | Notes **body** | **string** | 描述 | [optional] **bodyHtml** | **string** | 描述 html 格式 | [optional] **user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | 作者 | [optional] -**labels** | [**\Gitee\Model\Label**](Label.md) | 标签 | [optional] +**labels** | [**\Gitee\Model\Label[]**](Label.md) | 标签 | [optional] **assignee** | [**\Gitee\Model\UserBasic**](UserBasic.md) | 负责人 | [optional] -**collaborators** | [**\Gitee\Model\UserBasic**](UserBasic.md) | 协作者 | [optional] +**collaborators** | [**\Gitee\Model\UserBasic[]**](UserBasic.md) | 协作者 | [optional] **repository** | [**\Gitee\Model\Project**](Project.md) | 关联的仓库 | [optional] **milestone** | [**\Gitee\Model\Milestone**](Milestone.md) | 关联的里程碑 | [optional] -**createdAt** | [**\DateTime**](\DateTime.md) | 创建时间 | [optional] -**updatedAt** | [**\DateTime**](\DateTime.md) | 更新时间 | [optional] -**planStartedAt** | [**\DateTime**](\DateTime.md) | 计划开始时间 | [optional] -**deadline** | [**\DateTime**](\DateTime.md) | 结束时间 | [optional] -**finishedAt** | [**\DateTime**](\DateTime.md) | 完成时间 | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | 创建时间 | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | 更新时间 | [optional] +**planStartedAt** | [**\DateTime**](https://www.php.net/class.datetime) | 计划开始时间 | [optional] +**deadline** | [**\DateTime**](https://www.php.net/class.datetime) | 结束时间 | [optional] +**finishedAt** | [**\DateTime**](https://www.php.net/class.datetime) | 完成时间 | [optional] **scheduledTime** | **int** | 预计工期 | [optional] **comments** | **int** | 评论数量 | [optional] **priority** | **int** | 优先级(0: 不指定 1: 不重要 2: 次要 3: 主要 4: 严重) | [optional] diff --git a/docs/Model/IssueState.md b/docs/Model/IssueState.md index ca4f016..34e78b5 100644 --- a/docs/Model/IssueState.md +++ b/docs/Model/IssueState.md @@ -9,7 +9,9 @@ Name | Type | Description | Notes **color** | **string** | 任务状态的颜色 | [optional] **icon** | **string** | 任务状态的 Icon | [optional] **command** | **string** | 任务状态的 指令 | [optional] -**serial** | **string** | 任务状态的 排序 | [optional] +**serial** | **int** | 任务状态的 排序 | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | 任务状态创建时间 | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | 任务状态更新时间 | [optional] [[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/Model/IssueType.md b/docs/Model/IssueType.md index f66cd58..d766306 100644 --- a/docs/Model/IssueType.md +++ b/docs/Model/IssueType.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **ident** | **string** | 唯一标识符 | [optional] **color** | **string** | 颜色 | [optional] **isSystem** | **bool** | 是否系统默认类型 | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | 任务类型创建时间 | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | 任务类型更新时间 | [optional] [[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/Model/Label.md b/docs/Model/Label.md index 7bb8af0..665ae24 100644 --- a/docs/Model/Label.md +++ b/docs/Model/Label.md @@ -9,8 +9,8 @@ Name | Type | Description | Notes **name** | **string** | | [optional] **repositoryId** | **int** | | [optional] **url** | **string** | | [optional] -**createdAt** | [**\DateTime**](\DateTime.md) | | [optional] -**updatedAt** | [**\DateTime**](\DateTime.md) | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/Milestone.md b/docs/Model/Milestone.md index a3f271a..d4145b7 100644 --- a/docs/Model/Milestone.md +++ b/docs/Model/Milestone.md @@ -11,11 +11,11 @@ Name | Type | Description | Notes **state** | **string** | | [optional] **title** | **string** | | [optional] **description** | **string** | | [optional] -**updatedAt** | [**\DateTime**](\DateTime.md) | | [optional] -**createdAt** | [**\DateTime**](\DateTime.md) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **openIssues** | **int** | | [optional] **closedIssues** | **int** | | [optional] -**dueOn** | [**\DateTime**](\DateTime.md) | | [optional] +**dueOn** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/Note.md b/docs/Model/Note.md index 36adabb..eac99f5 100644 --- a/docs/Model/Note.md +++ b/docs/Model/Note.md @@ -4,15 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **int** | | [optional] **body** | **string** | | [optional] **bodyHtml** | **string** | | [optional] -**user** | **string** | | [optional] +**user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] **source** | **string** | | [optional] -**target** | **string** | | [optional] -**createdAt** | [**\DateTime**](\DateTime.md) | | [optional] -**updatedAt** | [**\DateTime**](\DateTime.md) | | [optional] -**inReplyToId** | **string** | | [optional] +**target** | **object** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**inReplyToId** | **int** | | [optional] +**inReplyToUser** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] [[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/Model/OperateLog.md b/docs/Model/OperateLog.md index 849816c..3229f16 100644 --- a/docs/Model/OperateLog.md +++ b/docs/Model/OperateLog.md @@ -4,12 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **int** | | [optional] **icon** | **string** | | [optional] -**user** | **string** | | [optional] +**user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**target** | **string** | | [optional] **content** | **string** | | [optional] -**linkTarget** | **string** | | [optional] -**createdAt** | **string** | | [optional] +**linkTarget** | **object** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **actionType** | **string** | | [optional] [[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/Model/PostV5ReposOwnerRepoCommits.md b/docs/Model/PostV5ReposOwnerRepoCommits.md new file mode 100644 index 0000000..00cffd4 --- /dev/null +++ b/docs/Model/PostV5ReposOwnerRepoCommits.md @@ -0,0 +1,16 @@ +# PostV5ReposOwnerRepoCommits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessToken** | **string** | 用户授权码 | [optional] +**branch** | **string** | 变更的目标分支名。创建新分支时需提供 `start_branch` 参数 | +**message** | **string** | 提交信息 | +**actions** | [**\Gitee\Model\PostV5ReposOwnerRepoCommitsActions[]**](PostV5ReposOwnerRepoCommitsActions.md) | | +**startBranch** | **string** | 分支起地点。新建分支时使用,更新分支时可选 | [optional] +**author** | [**\Gitee\Model\PostV5ReposOwnerRepoCommitsAuthor**](PostV5ReposOwnerRepoCommitsAuthor.md) | | [optional] + +[[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/Model/PostV5ReposOwnerRepoCommitsActions.md b/docs/Model/PostV5ReposOwnerRepoCommitsActions.md new file mode 100644 index 0000000..b45a658 --- /dev/null +++ b/docs/Model/PostV5ReposOwnerRepoCommitsActions.md @@ -0,0 +1,17 @@ +# PostV5ReposOwnerRepoCommitsActions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | 文件操作:`create`, `delete`, `move`, `update`, `chmod` | +**path** | **string** | 文件路径 | +**previousPath** | **string** | 原文件路径,文件重命名 `move` 时使用 | [optional] +**content** | **string** | 文件内容 | [optional] +**encoding** | **string** | 文件内容编码 `text` 或者 `base64` | [optional] +**lastCommitId** | **string** | 文件最近一次提交的 SHA | [optional] +**executeFilemode** | **bool** | 是否添加文件可执行标志 | [optional] + +[[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/Model/PostV5ReposOwnerRepoCommitsAuthor.md b/docs/Model/PostV5ReposOwnerRepoCommitsAuthor.md new file mode 100644 index 0000000..a031557 --- /dev/null +++ b/docs/Model/PostV5ReposOwnerRepoCommitsAuthor.md @@ -0,0 +1,12 @@ +# PostV5ReposOwnerRepoCommitsAuthor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Author 的名字,默认为当前用户的名字 | [optional] +**email** | **string** | Author 的邮箱,默认为当前用户的邮箱 | [optional] + +[[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/Model/Project.md b/docs/Model/Project.md index cf1aabf..beacc84 100644 --- a/docs/Model/Project.md +++ b/docs/Model/Project.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **description** | **string** | 仓库描述 | [optional] **private** | **bool** | 是否私有 | [optional] **public** | **bool** | 是否公开 | [optional] -**internal** | **string** | 是否内部开源 | [optional] +**internal** | **bool** | 是否内部开源 | [optional] **fork** | **bool** | 是否是fork仓库 | [optional] **htmlUrl** | **string** | | [optional] **sshUrl** | **string** | | [optional] @@ -56,22 +56,24 @@ Name | Type | Description | Notes **license** | **string** | 开源许可 | [optional] **outsourced** | **bool** | 仓库类型(内部/外包) | [optional] **projectCreator** | **string** | 仓库创建者的 username | [optional] -**pushedAt** | [**\DateTime**](\DateTime.md) | 最近一次代码推送时间 | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**members** | **string[]** | 仓库成员的username | [optional] +**pushedAt** | [**\DateTime**](https://www.php.net/class.datetime) | 最近一次代码推送时间 | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **parent** | [**\Gitee\Model\Project**](Project.md) | 源仓库 | [optional] **paas** | **string** | | [optional] **stared** | **bool** | 是否 star | [optional] **watched** | **bool** | 是否 watch | [optional] +**permission** | **object** | 操作权限 | [optional] **relation** | **string** | 当前用户相对于仓库的角色 | [optional] **assigneesNumber** | **int** | 代码审查设置,审查人数 | [optional] **testersNumber** | **int** | 代码审查设置,测试人数 | [optional] **assignee** | [**\Gitee\Model\UserBasic[]**](UserBasic.md) | 代码审查设置,审查人员 | [optional] **testers** | [**\Gitee\Model\UserBasic[]**](UserBasic.md) | 代码审查设置,测试人员 | [optional] **status** | **string** | 仓库状态 | [optional] -**programs** | [**\Gitee\Model\ProgramBasic**](ProgramBasic.md) | 仓库所属的项目 | [optional] +**programs** | [**\Gitee\Model\ProgramBasic[]**](ProgramBasic.md) | 仓库所属的项目 | [optional] **enterprise** | [**\Gitee\Model\NamespaceMini**](NamespaceMini.md) | 仓库所属的企业 | [optional] -**projectLabels** | [**\Gitee\Model\ProjectLabel**](ProjectLabel.md) | | [optional] +**projectLabels** | [**\Gitee\Model\ProjectLabel[]**](ProjectLabel.md) | | [optional] **issueTemplateSource** | **string** | Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 | [optional] [[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/Model/ProjectBasic.md b/docs/Model/ProjectBasic.md index 2b83797..24bb63f 100644 --- a/docs/Model/ProjectBasic.md +++ b/docs/Model/ProjectBasic.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **description** | **string** | 仓库描述 | [optional] **private** | **bool** | 是否私有 | [optional] **public** | **bool** | 是否公开 | [optional] -**internal** | **string** | 是否内部开源 | [optional] +**internal** | **bool** | 是否内部开源 | [optional] **fork** | **bool** | 是否是fork仓库 | [optional] **htmlUrl** | **string** | | [optional] **sshUrl** | **string** | | [optional] diff --git a/docs/Model/ProjectMini.md b/docs/Model/ProjectMini.md new file mode 100644 index 0000000..f301aee --- /dev/null +++ b/docs/Model/ProjectMini.md @@ -0,0 +1,15 @@ +# ProjectMini + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**fullName** | **string** | | [optional] +**humanName** | **string** | | [optional] +**url** | **string** | | [optional] +**namespace** | [**\Gitee\Model\NamespaceMini**](NamespaceMini.md) | | [optional] + +[[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/Model/ProjectPushConfig.md b/docs/Model/ProjectPushConfig.md index 9ba3efb..a6cfe62 100644 --- a/docs/Model/ProjectPushConfig.md +++ b/docs/Model/ProjectPushConfig.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**restrictPushOwnCommit** | **string** | | [optional] -**restrictAuthorEmailSuffix** | **string** | | [optional] +**restrictPushOwnCommit** | **bool** | | [optional] +**restrictAuthorEmailSuffix** | **bool** | | [optional] **authorEmailSuffix** | **string** | | [optional] -**restrictCommitMessage** | **string** | | [optional] +**restrictCommitMessage** | **bool** | | [optional] **commitMessageRegex** | **string** | | [optional] -**restrictFileSize** | **string** | | [optional] -**maxFileSize** | **string** | | [optional] -**exceptManager** | **string** | | [optional] +**restrictFileSize** | **bool** | | [optional] +**maxFileSize** | **int** | | [optional] +**exceptManager** | **bool** | | [optional] [[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/Model/ProjectStargazers.md b/docs/Model/ProjectStargazers.md index 3fdf604..ebf87cd 100644 --- a/docs/Model/ProjectStargazers.md +++ b/docs/Model/ProjectStargazers.md @@ -22,7 +22,7 @@ Name | Type | Description | Notes **receivedEventsUrl** | **string** | | [optional] **type** | **string** | | [optional] **memberRole** | **string** | | [optional] -**starAt** | **string** | | [optional] +**starAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/ProjectWatchers.md b/docs/Model/ProjectWatchers.md index c112828..f36b7b5 100644 --- a/docs/Model/ProjectWatchers.md +++ b/docs/Model/ProjectWatchers.md @@ -22,7 +22,7 @@ Name | Type | Description | Notes **receivedEventsUrl** | **string** | | [optional] **type** | **string** | | [optional] **memberRole** | **string** | | [optional] -**watchAt** | **string** | | [optional] +**watchAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/ProtectionRule.md b/docs/Model/ProtectionRule.md index 51c27b2..bbf91bc 100644 --- a/docs/Model/ProtectionRule.md +++ b/docs/Model/ProtectionRule.md @@ -4,14 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] -**projectId** | **string** | | [optional] +**id** | **int** | | [optional] +**projectId** | **int** | | [optional] **wildcard** | **string** | | [optional] -**pushers** | **string[]** | | [optional] -**mergers** | **string[]** | | [optional] +**pushers** | **object** | | [optional] +**mergers** | **object** | | [optional] **contexts** | **string[]** | 检查项列表 | [optional] **strict** | **bool** | 是否严格检查 | [optional] **mode** | **string** | 模式 standard: 标准模式, review: 评审模式 | [optional] +**escapseProtectBranchList** | **string[]** | 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] | [optional] [[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/Model/PullRequest.md b/docs/Model/PullRequest.md index cd8d49e..594f27e 100644 --- a/docs/Model/PullRequest.md +++ b/docs/Model/PullRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **int** | | [optional] **url** | **string** | | [optional] **htmlUrl** | **string** | | [optional] **diffUrl** | **string** | | [optional] @@ -14,26 +14,28 @@ Name | Type | Description | Notes **reviewCommentsUrl** | **string** | | [optional] **reviewCommentUrl** | **string** | | [optional] **commentsUrl** | **string** | | [optional] -**number** | **string** | | [optional] +**number** | **int** | | [optional] +**closeRelatedIssue** | **int** | | [optional] +**pruneBranch** | **bool** | | [optional] **state** | **string** | | [optional] -**assigneesNumber** | **string** | | [optional] -**testersNumber** | **string** | | [optional] -**assignees** | **string[]** | | [optional] -**testers** | **string[]** | | [optional] -**apiReviewersNumber** | **string** | | [optional] -**apiReviewers** | **string[]** | | [optional] +**assigneesNumber** | **int** | | [optional] +**testersNumber** | **int** | | [optional] +**assignees** | [**\Gitee\Model\UserAssignee[]**](UserAssignee.md) | | [optional] +**testers** | [**\Gitee\Model\UserAssignee[]**](UserAssignee.md) | | [optional] +**apiReviewersNumber** | **int** | | [optional] +**apiReviewers** | [**\Gitee\Model\UserAssignee[]**](UserAssignee.md) | | [optional] **milestone** | [**\Gitee\Model\Milestone**](Milestone.md) | | [optional] -**labels** | [**\Gitee\Model\Label**](Label.md) | | [optional] -**locked** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] -**closedAt** | **string** | | [optional] -**draft** | **string** | | [optional] -**mergedAt** | **string** | | [optional] -**mergeable** | **string** | | [optional] -**canMergeCheck** | **string** | | [optional] +**labels** | [**\Gitee\Model\Label[]**](Label.md) | | [optional] +**locked** | **bool** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**closedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**draft** | **bool** | | [optional] +**mergedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**mergeable** | **bool** | | [optional] +**canMergeCheck** | **bool** | | [optional] **links** | **string** | | [optional] -**user** | **string** | | [optional] +**user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] **refPullRequests** | [**\Gitee\Model\RefPullRequest[]**](RefPullRequest.md) | | [optional] **title** | **string** | | [optional] **body** | **string** | | [optional] diff --git a/docs/Model/PullRequestComments.md b/docs/Model/PullRequestComments.md index f74021d..a40be0e 100644 --- a/docs/Model/PullRequestComments.md +++ b/docs/Model/PullRequestComments.md @@ -5,22 +5,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **string** | | [optional] -**id** | **string** | | [optional] +**id** | **int** | | [optional] **path** | **string** | | [optional] **position** | **string** | | [optional] **originalPosition** | **string** | | [optional] **newLine** | **string** | | [optional] **commitId** | **string** | | [optional] **originalCommitId** | **string** | | [optional] -**user** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**user** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **body** | **string** | | [optional] **htmlUrl** | **string** | | [optional] **pullRequestUrl** | **string** | | [optional] **links** | **string** | | [optional] **commentType** | **string** | | [optional] -**inReplyToId** | **string** | | [optional] +**inReplyToId** | **int** | | [optional] [[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/Model/PullRequestCommits.md b/docs/Model/PullRequestCommits.md index bd8ee66..9fcc8c1 100644 --- a/docs/Model/PullRequestCommits.md +++ b/docs/Model/PullRequestCommits.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **htmlUrl** | **string** | | [optional] **commentsUrl** | **string** | | [optional] **commit** | **string** | | [optional] -**author** | **string** | | [optional] +**author** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] **committer** | **string** | | [optional] **parents** | [**\Gitee\Model\CommitParentsBasic**](CommitParentsBasic.md) | | [optional] diff --git a/docs/Model/Release.md b/docs/Model/Release.md index 3107e5c..e5cc3a0 100644 --- a/docs/Model/Release.md +++ b/docs/Model/Release.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes **id** | **int** | | [optional] **tagName** | **string** | | [optional] **targetCommitish** | **string** | | [optional] -**prerelease** | **string** | | [optional] +**prerelease** | **bool** | | [optional] **name** | **string** | | [optional] **body** | **string** | | [optional] -**author** | **string** | | [optional] -**createdAt** | [**\DateTime**](\DateTime.md) | | [optional] -**assets** | **string** | | [optional] +**author** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**assets** | **string[]** | | [optional] [[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/Model/RepoCommit.md b/docs/Model/RepoCommit.md index f0fb815..6023863 100644 --- a/docs/Model/RepoCommit.md +++ b/docs/Model/RepoCommit.md @@ -9,9 +9,9 @@ Name | Type | Description | Notes **htmlUrl** | **string** | | [optional] **commentsUrl** | **string** | | [optional] **commit** | **string** | | [optional] -**author** | **string** | | [optional] -**committer** | **string** | | [optional] -**parents** | **string** | | [optional] +**author** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**committer** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**parents** | **string[]** | | [optional] [[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/Model/RepoCommitWithFiles.md b/docs/Model/RepoCommitWithFiles.md index 35e31ab..5600ba3 100644 --- a/docs/Model/RepoCommitWithFiles.md +++ b/docs/Model/RepoCommitWithFiles.md @@ -9,11 +9,12 @@ Name | Type | Description | Notes **htmlUrl** | **string** | | [optional] **commentsUrl** | **string** | | [optional] **commit** | **string** | | [optional] -**author** | **string** | | [optional] -**committer** | **string** | | [optional] -**parents** | **string** | | [optional] +**author** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**committer** | [**\Gitee\Model\UserBasic**](UserBasic.md) | | [optional] +**parents** | **string[]** | | [optional] **stats** | **string** | | [optional] -**files** | **string** | | [optional] +**files** | [**\Gitee\Model\DiffFile[]**](DiffFile.md) | 文件列表 | [optional] +**truncated** | **bool** | 文件列表是否被截断 | [optional] [[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/Model/SSHKey.md b/docs/Model/SSHKey.md index 65714cb..7a73079 100644 --- a/docs/Model/SSHKey.md +++ b/docs/Model/SSHKey.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **int** | | [optional] **key** | **string** | | [optional] **url** | **string** | | [optional] **title** | **string** | | [optional] -**createdAt** | **string** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/SSHKeyBasic.md b/docs/Model/SSHKeyBasic.md index 5c26bde..5144d3a 100644 --- a/docs/Model/SSHKeyBasic.md +++ b/docs/Model/SSHKeyBasic.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **int** | | [optional] **key** | **string** | | [optional] [[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/Model/Tag.md b/docs/Model/Tag.md index f87e7b4..26e2f6c 100644 --- a/docs/Model/Tag.md +++ b/docs/Model/Tag.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | [optional] **message** | **string** | | [optional] **commit** | **string** | | [optional] +**tagger** | [**\Gitee\Model\GitUser**](GitUser.md) | | [optional] [[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/Model/Tree.md b/docs/Model/Tree.md index e76c6c6..69a6b37 100644 --- a/docs/Model/Tree.md +++ b/docs/Model/Tree.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sha** | **string** | | [optional] **url** | **string** | | [optional] -**tree** | **string** | | [optional] -**truncated** | **string** | | [optional] +**tree** | **string[]** | | [optional] +**truncated** | **bool** | | [optional] [[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/Model/User.md b/docs/Model/User.md index acc5ebb..af24e8b 100644 --- a/docs/Model/User.md +++ b/docs/Model/User.md @@ -25,14 +25,14 @@ Name | Type | Description | Notes **blog** | **string** | | [optional] **weibo** | **string** | | [optional] **bio** | **string** | | [optional] -**publicRepos** | **string** | | [optional] -**publicGists** | **string** | | [optional] -**followers** | **string** | | [optional] -**following** | **string** | | [optional] -**stared** | **string** | | [optional] -**watched** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**publicRepos** | **int** | | [optional] +**publicGists** | **int** | | [optional] +**followers** | **int** | | [optional] +**following** | **int** | | [optional] +**stared** | **int** | | [optional] +**watched** | **int** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] [[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/Model/UserAssignee.md b/docs/Model/UserAssignee.md new file mode 100644 index 0000000..c99b9ec --- /dev/null +++ b/docs/Model/UserAssignee.md @@ -0,0 +1,31 @@ +# UserAssignee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**login** | **string** | | [optional] +**name** | **string** | | [optional] +**avatarUrl** | **string** | | [optional] +**url** | **string** | | [optional] +**htmlUrl** | **string** | | [optional] +**remark** | **string** | 企业备注名 | [optional] +**followersUrl** | **string** | | [optional] +**followingUrl** | **string** | | [optional] +**gistsUrl** | **string** | | [optional] +**starredUrl** | **string** | | [optional] +**subscriptionsUrl** | **string** | | [optional] +**organizationsUrl** | **string** | | [optional] +**reposUrl** | **string** | | [optional] +**eventsUrl** | **string** | | [optional] +**receivedEventsUrl** | **string** | | [optional] +**type** | **string** | | [optional] +**memberRole** | **string** | | [optional] +**assignee** | **bool** | 是否默认指派审查 | [optional] +**codeOwner** | **bool** | 是否CodeOwner指派审查 | [optional] +**accept** | **bool** | 是否审查通过 | [optional] + +[[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/Model/UserDetail.md b/docs/Model/UserDetail.md index 5210b35..3697322 100644 --- a/docs/Model/UserDetail.md +++ b/docs/Model/UserDetail.md @@ -25,14 +25,14 @@ Name | Type | Description | Notes **blog** | **string** | | [optional] **weibo** | **string** | | [optional] **bio** | **string** | | [optional] -**publicRepos** | **string** | | [optional] -**publicGists** | **string** | | [optional] -**followers** | **string** | | [optional] -**following** | **string** | | [optional] -**stared** | **string** | | [optional] -**watched** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**publicRepos** | **int** | | [optional] +**publicGists** | **int** | | [optional] +**followers** | **int** | | [optional] +**following** | **int** | | [optional] +**stared** | **int** | | [optional] +**watched** | **int** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **email** | **string** | | [optional] [[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/Model/UserInfo.md b/docs/Model/UserInfo.md index 5a746ab..ec54597 100644 --- a/docs/Model/UserInfo.md +++ b/docs/Model/UserInfo.md @@ -25,14 +25,14 @@ Name | Type | Description | Notes **blog** | **string** | | [optional] **weibo** | **string** | | [optional] **bio** | **string** | | [optional] -**publicRepos** | **string** | | [optional] -**publicGists** | **string** | | [optional] -**followers** | **string** | | [optional] -**following** | **string** | | [optional] -**stared** | **string** | | [optional] -**watched** | **string** | | [optional] -**createdAt** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**publicRepos** | **int** | | [optional] +**publicGists** | **int** | | [optional] +**followers** | **int** | | [optional] +**following** | **int** | | [optional] +**stared** | **int** | | [optional] +**watched** | **int** | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **company** | **string** | | [optional] **profession** | **string** | | [optional] **wechat** | **string** | | [optional] diff --git a/docs/Model/UserMessage.md b/docs/Model/UserMessage.md index 4220c4a..0fac615 100644 --- a/docs/Model/UserMessage.md +++ b/docs/Model/UserMessage.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] **sender** | [**\Gitee\Model\UserBasic**](UserBasic.md) | 发送者 | [optional] -**unread** | **string** | | [optional] +**unread** | **bool** | | [optional] **content** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **url** | **string** | | [optional] **htmlUrl** | **string** | | [optional] diff --git a/docs/Model/UserMessageList.md b/docs/Model/UserMessageList.md new file mode 100644 index 0000000..4ad6d23 --- /dev/null +++ b/docs/Model/UserMessageList.md @@ -0,0 +1,12 @@ +# UserMessageList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**totalCount** | **int** | | [optional] +**list** | [**\Gitee\Model\UserMessage[]**](UserMessage.md) | 私信列表 | [optional] + +[[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/Model/UserNotification.md b/docs/Model/UserNotification.md index deba099..a9354dc 100644 --- a/docs/Model/UserNotification.md +++ b/docs/Model/UserNotification.md @@ -7,9 +7,9 @@ Name | Type | Description | Notes **id** | **int** | | [optional] **content** | **string** | | [optional] **type** | **string** | | [optional] -**unread** | **string** | | [optional] -**mute** | **string** | | [optional] -**updatedAt** | **string** | | [optional] +**unread** | **bool** | | [optional] +**mute** | **bool** | | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] **url** | **string** | | [optional] **htmlUrl** | **string** | | [optional] **actor** | [**\Gitee\Model\UserBasic**](UserBasic.md) | 通知发送者 | [optional] diff --git a/docs/Model/UserNotificationList.md b/docs/Model/UserNotificationList.md new file mode 100644 index 0000000..1946644 --- /dev/null +++ b/docs/Model/UserNotificationList.md @@ -0,0 +1,12 @@ +# UserNotificationList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**totalCount** | **int** | | [optional] +**list** | [**\Gitee\Model\UserNotification[]**](UserNotification.md) | 通知列表 | [optional] + +[[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/Model/WeekReport.md b/docs/Model/WeekReport.md index 8da7b53..6a0d5de 100644 --- a/docs/Model/WeekReport.md +++ b/docs/Model/WeekReport.md @@ -7,13 +7,13 @@ Name | Type | Description | Notes **id** | **int** | | [optional] **content** | **string** | | [optional] **contentHtml** | **string** | | [optional] -**year** | **string** | | [optional] -**month** | **string** | | [optional] -**weekIndex** | **string** | | [optional] -**weekBegin** | **string** | | [optional] -**weekEnd** | **string** | | [optional] -**createdAt** | [**\DateTime**](\DateTime.md) | 创建时间 | [optional] -**updatedAt** | [**\DateTime**](\DateTime.md) | 更新时间 | [optional] +**year** | **int** | | [optional] +**month** | **int** | | [optional] +**weekIndex** | **int** | | [optional] +**weekBegin** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**weekEnd** | [**\DateTime**](https://www.php.net/class.datetime) | | [optional] +**createdAt** | [**\DateTime**](https://www.php.net/class.datetime) | 创建时间 | [optional] +**updatedAt** | [**\DateTime**](https://www.php.net/class.datetime) | 更新时间 | [optional] **user** | [**\Gitee\Model\UserMini**](UserMini.md) | | [optional] [[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/src/Api/ActivityApi.php b/src/Api/ActivityApi.php index 3b8ac99..da78fe7 100644 --- a/src/Api/ActivityApi.php +++ b/src/Api/ActivityApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -1205,7 +1205,7 @@ protected function getV5NotificationsCountRequest($accessToken = null, $unread = * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\UserMessage[] + * @return \Gitee\Model\UserMessageList */ public function getV5NotificationsMessages($accessToken = null, $unread = null, $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { @@ -1228,11 +1228,11 @@ public function getV5NotificationsMessages($accessToken = null, $unread = null, * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\UserMessage[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\UserMessageList, HTTP status code, HTTP response headers (array of strings) */ public function getV5NotificationsMessagesWithHttpInfo($accessToken = null, $unread = null, $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\UserMessage[]'; + $returnType = '\Gitee\Model\UserMessageList'; $request = $this->getV5NotificationsMessagesRequest($accessToken, $unread, $since, $before, $ids, $page, $perPage); try { @@ -1284,7 +1284,7 @@ public function getV5NotificationsMessagesWithHttpInfo($accessToken = null, $unr case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\UserMessage[]', + '\Gitee\Model\UserMessageList', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1338,7 +1338,7 @@ function ($response) { */ public function getV5NotificationsMessagesAsyncWithHttpInfo($accessToken = null, $unread = null, $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\UserMessage[]'; + $returnType = '\Gitee\Model\UserMessageList'; $request = $this->getV5NotificationsMessagesRequest($accessToken, $unread, $since, $before, $ids, $page, $perPage); return $this->client @@ -1394,6 +1394,13 @@ function ($exception) { */ protected function getV5NotificationsMessagesRequest($accessToken = null, $unread = null, $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5NotificationsMessages, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5NotificationsMessages, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/notifications/messages'; $formParams = []; @@ -1798,7 +1805,7 @@ protected function getV5NotificationsMessagesIdRequest($id, $accessToken = null) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\UserNotification[] + * @return \Gitee\Model\UserNotificationList */ public function getV5NotificationsThreads($accessToken = null, $unread = null, $participating = null, $type = 'all', $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { @@ -1823,11 +1830,11 @@ public function getV5NotificationsThreads($accessToken = null, $unread = null, $ * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\UserNotification[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\UserNotificationList, HTTP status code, HTTP response headers (array of strings) */ public function getV5NotificationsThreadsWithHttpInfo($accessToken = null, $unread = null, $participating = null, $type = 'all', $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\UserNotification[]'; + $returnType = '\Gitee\Model\UserNotificationList'; $request = $this->getV5NotificationsThreadsRequest($accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage); try { @@ -1879,7 +1886,7 @@ public function getV5NotificationsThreadsWithHttpInfo($accessToken = null, $unre case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\UserNotification[]', + '\Gitee\Model\UserNotificationList', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1937,7 +1944,7 @@ function ($response) { */ public function getV5NotificationsThreadsAsyncWithHttpInfo($accessToken = null, $unread = null, $participating = null, $type = 'all', $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\UserNotification[]'; + $returnType = '\Gitee\Model\UserNotificationList'; $request = $this->getV5NotificationsThreadsRequest($accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage); return $this->client @@ -1995,6 +2002,13 @@ function ($exception) { */ protected function getV5NotificationsThreadsRequest($accessToken = null, $unread = null, $participating = null, $type = 'all', $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5NotificationsThreads, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5NotificationsThreads, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/notifications/threads'; $formParams = []; @@ -3020,7 +3034,7 @@ protected function getV5ReposOwnerRepoEventsRequest($owner, $repo, $accessToken * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\UserNotification[] + * @return \Gitee\Model\UserNotificationList */ public function getV5ReposOwnerRepoNotifications($owner, $repo, $accessToken = null, $unread = null, $participating = null, $type = 'all', $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { @@ -3047,11 +3061,11 @@ public function getV5ReposOwnerRepoNotifications($owner, $repo, $accessToken = n * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\UserNotification[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\UserNotificationList, HTTP status code, HTTP response headers (array of strings) */ public function getV5ReposOwnerRepoNotificationsWithHttpInfo($owner, $repo, $accessToken = null, $unread = null, $participating = null, $type = 'all', $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\UserNotification[]'; + $returnType = '\Gitee\Model\UserNotificationList'; $request = $this->getV5ReposOwnerRepoNotificationsRequest($owner, $repo, $accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage); try { @@ -3103,7 +3117,7 @@ public function getV5ReposOwnerRepoNotificationsWithHttpInfo($owner, $repo, $acc case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\UserNotification[]', + '\Gitee\Model\UserNotificationList', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3165,7 +3179,7 @@ function ($response) { */ public function getV5ReposOwnerRepoNotificationsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $unread = null, $participating = null, $type = 'all', $since = null, $before = null, $ids = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\UserNotification[]'; + $returnType = '\Gitee\Model\UserNotificationList'; $request = $this->getV5ReposOwnerRepoNotificationsRequest($owner, $repo, $accessToken, $unread, $participating, $type, $since, $before, $ids, $page, $perPage); return $this->client @@ -3237,6 +3251,13 @@ protected function getV5ReposOwnerRepoNotificationsRequest($owner, $repo, $acces 'Missing the required parameter $repo when calling getV5ReposOwnerRepoNotifications' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5ReposOwnerRepoNotifications, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5ReposOwnerRepoNotifications, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/notifications'; $formParams = []; @@ -3576,6 +3597,13 @@ protected function getV5ReposOwnerRepoStargazersRequest($owner, $repo, $accessTo 'Missing the required parameter $repo when calling getV5ReposOwnerRepoStargazers' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5ReposOwnerRepoStargazers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5ReposOwnerRepoStargazers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/stargazers'; $formParams = []; @@ -3891,6 +3919,13 @@ protected function getV5ReposOwnerRepoSubscribersRequest($owner, $repo, $accessT 'Missing the required parameter $repo when calling getV5ReposOwnerRepoSubscribers' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5ReposOwnerRepoSubscribers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5ReposOwnerRepoSubscribers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/subscribers'; $formParams = []; @@ -4194,6 +4229,13 @@ function ($exception) { */ protected function getV5UserStarredRequest($accessToken = null, $sort = 'created', $direction = 'desc', $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5UserStarred, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5UserStarred, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/starred'; $formParams = []; @@ -4749,6 +4791,13 @@ function ($exception) { */ protected function getV5UserSubscriptionsRequest($accessToken = null, $sort = 'created', $direction = 'desc', $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5UserSubscriptions, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ActivityApi.getV5UserSubscriptions, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/subscriptions'; $formParams = []; diff --git a/src/Api/ChecksApi.php b/src/Api/ChecksApi.php new file mode 100644 index 0000000..356bc56 --- /dev/null +++ b/src/Api/ChecksApi.php @@ -0,0 +1,2370 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunId + * + * 获取检查项详情 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\CheckRun + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunId($owner, $repo, $checkRunId, $accessToken = null) + { + list($response) = $this->getV5ReposOwnerRepoCheckRunsCheckRunIdWithHttpInfo($owner, $repo, $checkRunId, $accessToken); + return $response; + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunIdWithHttpInfo + * + * 获取检查项详情 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\CheckRun, HTTP status code, HTTP response headers (array of strings) + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunIdWithHttpInfo($owner, $repo, $checkRunId, $accessToken = null) + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->getV5ReposOwnerRepoCheckRunsCheckRunIdRequest($owner, $repo, $checkRunId, $accessToken); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\CheckRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunIdAsync + * + * 获取检查项详情 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunIdAsync($owner, $repo, $checkRunId, $accessToken = null) + { + return $this->getV5ReposOwnerRepoCheckRunsCheckRunIdAsyncWithHttpInfo($owner, $repo, $checkRunId, $accessToken) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunIdAsyncWithHttpInfo + * + * 获取检查项详情 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunIdAsyncWithHttpInfo($owner, $repo, $checkRunId, $accessToken = null) + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->getV5ReposOwnerRepoCheckRunsCheckRunIdRequest($owner, $repo, $checkRunId, $accessToken); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5ReposOwnerRepoCheckRunsCheckRunId' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5ReposOwnerRepoCheckRunsCheckRunIdRequest($owner, $repo, $checkRunId, $accessToken = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'checkRunId' is set + if ($checkRunId === null || (is_array($checkRunId) && count($checkRunId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $checkRunId when calling getV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/check-runs/{check_run_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + // path params + if ($checkRunId !== null) { + $resourcePath = str_replace( + '{' . 'check_run_id' . '}', + ObjectSerializer::toPathValue($checkRunId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations + * + * 获取检查项代码注释 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\CheckAnnotation + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations($owner, $repo, $checkRunId, $accessToken = null, $page = '1', $perPage = '20') + { + list($response) = $this->getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsWithHttpInfo($owner, $repo, $checkRunId, $accessToken, $page, $perPage); + return $response; + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsWithHttpInfo + * + * 获取检查项代码注释 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\CheckAnnotation, HTTP status code, HTTP response headers (array of strings) + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsWithHttpInfo($owner, $repo, $checkRunId, $accessToken = null, $page = '1', $perPage = '20') + { + $returnType = '\Gitee\Model\CheckAnnotation'; + $request = $this->getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsRequest($owner, $repo, $checkRunId, $accessToken, $page, $perPage); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\CheckAnnotation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsAsync + * + * 获取检查项代码注释 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsAsync($owner, $repo, $checkRunId, $accessToken = null, $page = '1', $perPage = '20') + { + return $this->getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsAsyncWithHttpInfo($owner, $repo, $checkRunId, $accessToken, $page, $perPage) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsAsyncWithHttpInfo + * + * 获取检查项代码注释 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsAsyncWithHttpInfo($owner, $repo, $checkRunId, $accessToken = null, $page = '1', $perPage = '20') + { + $returnType = '\Gitee\Model\CheckAnnotation'; + $request = $this->getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsRequest($owner, $repo, $checkRunId, $accessToken, $page, $perPage); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsRequest($owner, $repo, $checkRunId, $accessToken = null, $page = '1', $perPage = '20') + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations' + ); + } + // verify the required parameter 'checkRunId' is set + if ($checkRunId === null || (is_array($checkRunId) && count($checkRunId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $checkRunId when calling getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations' + ); + } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ChecksApi.getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ChecksApi.getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v5/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + // path params + if ($checkRunId !== null) { + $resourcePath = str_replace( + '{' . 'check_run_id' . '}', + ObjectSerializer::toPathValue($checkRunId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getV5ReposOwnerRepoCommitsRefCheckRuns + * + * 获取某个提交的检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $ref 分支名\\标签名\\sha 值 (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $pullRequestId 关联 pull request 的 ID (optional, default to 0) + * @param string $checkName 检查项名称 (optional) + * @param string $status 检查项状态 (optional) + * @param string $filter 最新的\\全部 (optional, default to latest) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\CheckRun + */ + public function getV5ReposOwnerRepoCommitsRefCheckRuns($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20', $pullRequestId = '0', $checkName = null, $status = null, $filter = 'latest') + { + list($response) = $this->getV5ReposOwnerRepoCommitsRefCheckRunsWithHttpInfo($owner, $repo, $ref, $accessToken, $page, $perPage, $pullRequestId, $checkName, $status, $filter); + return $response; + } + + /** + * Operation getV5ReposOwnerRepoCommitsRefCheckRunsWithHttpInfo + * + * 获取某个提交的检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $ref 分支名\\标签名\\sha 值 (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $pullRequestId 关联 pull request 的 ID (optional, default to 0) + * @param string $checkName 检查项名称 (optional) + * @param string $status 检查项状态 (optional) + * @param string $filter 最新的\\全部 (optional, default to latest) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\CheckRun, HTTP status code, HTTP response headers (array of strings) + */ + public function getV5ReposOwnerRepoCommitsRefCheckRunsWithHttpInfo($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20', $pullRequestId = '0', $checkName = null, $status = null, $filter = 'latest') + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->getV5ReposOwnerRepoCommitsRefCheckRunsRequest($owner, $repo, $ref, $accessToken, $page, $perPage, $pullRequestId, $checkName, $status, $filter); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\CheckRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getV5ReposOwnerRepoCommitsRefCheckRunsAsync + * + * 获取某个提交的检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $ref 分支名\\标签名\\sha 值 (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $pullRequestId 关联 pull request 的 ID (optional, default to 0) + * @param string $checkName 检查项名称 (optional) + * @param string $status 检查项状态 (optional) + * @param string $filter 最新的\\全部 (optional, default to latest) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoCommitsRefCheckRunsAsync($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20', $pullRequestId = '0', $checkName = null, $status = null, $filter = 'latest') + { + return $this->getV5ReposOwnerRepoCommitsRefCheckRunsAsyncWithHttpInfo($owner, $repo, $ref, $accessToken, $page, $perPage, $pullRequestId, $checkName, $status, $filter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5ReposOwnerRepoCommitsRefCheckRunsAsyncWithHttpInfo + * + * 获取某个提交的检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $ref 分支名\\标签名\\sha 值 (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $pullRequestId 关联 pull request 的 ID (optional, default to 0) + * @param string $checkName 检查项名称 (optional) + * @param string $status 检查项状态 (optional) + * @param string $filter 最新的\\全部 (optional, default to latest) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoCommitsRefCheckRunsAsyncWithHttpInfo($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20', $pullRequestId = '0', $checkName = null, $status = null, $filter = 'latest') + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->getV5ReposOwnerRepoCommitsRefCheckRunsRequest($owner, $repo, $ref, $accessToken, $page, $perPage, $pullRequestId, $checkName, $status, $filter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5ReposOwnerRepoCommitsRefCheckRuns' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $ref 分支名\\标签名\\sha 值 (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $pullRequestId 关联 pull request 的 ID (optional, default to 0) + * @param string $checkName 检查项名称 (optional) + * @param string $status 检查项状态 (optional) + * @param string $filter 最新的\\全部 (optional, default to latest) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5ReposOwnerRepoCommitsRefCheckRunsRequest($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20', $pullRequestId = '0', $checkName = null, $status = null, $filter = 'latest') + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommitsRefCheckRuns' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommitsRefCheckRuns' + ); + } + // verify the required parameter 'ref' is set + if ($ref === null || (is_array($ref) && count($ref) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ref when calling getV5ReposOwnerRepoCommitsRefCheckRuns' + ); + } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ChecksApi.getV5ReposOwnerRepoCommitsRefCheckRuns, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling ChecksApi.getV5ReposOwnerRepoCommitsRefCheckRuns, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v5/repos/{owner}/{repo}/commits/{ref}/check-runs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } + // query params + if ($pullRequestId !== null) { + $queryParams['pull_request_id'] = ObjectSerializer::toQueryValue($pullRequestId); + } + // query params + if ($checkName !== null) { + $queryParams['check_name'] = ObjectSerializer::toQueryValue($checkName); + } + // query params + if ($status !== null) { + $queryParams['status'] = ObjectSerializer::toQueryValue($status); + } + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + } + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + // path params + if ($ref !== null) { + $resourcePath = str_replace( + '{' . 'ref' . '}', + ObjectSerializer::toPathValue($ref), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation patchV5ReposOwnerRepoCheckRunsCheckRunId + * + * 更新检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId 关联 pull_request 的 ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * @param string $name 名字 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\CheckRun + */ + public function patchV5ReposOwnerRepoCheckRunsCheckRunId($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null, $name = null) + { + list($response) = $this->patchV5ReposOwnerRepoCheckRunsCheckRunIdWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption, $name); + return $response; + } + + /** + * Operation patchV5ReposOwnerRepoCheckRunsCheckRunIdWithHttpInfo + * + * 更新检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId 关联 pull_request 的 ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * @param string $name 名字 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\CheckRun, HTTP status code, HTTP response headers (array of strings) + */ + public function patchV5ReposOwnerRepoCheckRunsCheckRunIdWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null, $name = null) + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->patchV5ReposOwnerRepoCheckRunsCheckRunIdRequest($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption, $name); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\CheckRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation patchV5ReposOwnerRepoCheckRunsCheckRunIdAsync + * + * 更新检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId 关联 pull_request 的 ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * @param string $name 名字 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoCheckRunsCheckRunIdAsync($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null, $name = null) + { + return $this->patchV5ReposOwnerRepoCheckRunsCheckRunIdAsyncWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption, $name) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation patchV5ReposOwnerRepoCheckRunsCheckRunIdAsyncWithHttpInfo + * + * 更新检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId 关联 pull_request 的 ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * @param string $name 名字 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoCheckRunsCheckRunIdAsyncWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null, $name = null) + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->patchV5ReposOwnerRepoCheckRunsCheckRunIdRequest($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption, $name); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'patchV5ReposOwnerRepoCheckRunsCheckRunId' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param int $checkRunId 检查项 ID (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId 关联 pull_request 的 ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * @param string $name 名字 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function patchV5ReposOwnerRepoCheckRunsCheckRunIdRequest($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $checkRunId, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null, $name = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputTitle' is set + if ($outputTitle === null || (is_array($outputTitle) && count($outputTitle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputTitle when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputSummary' is set + if ($outputSummary === null || (is_array($outputSummary) && count($outputSummary) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputSummary when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputAnnotationsPath' is set + if ($outputAnnotationsPath === null || (is_array($outputAnnotationsPath) && count($outputAnnotationsPath) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsPath when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputAnnotationsStartLine' is set + if ($outputAnnotationsStartLine === null || (is_array($outputAnnotationsStartLine) && count($outputAnnotationsStartLine) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsStartLine when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputAnnotationsEndLine' is set + if ($outputAnnotationsEndLine === null || (is_array($outputAnnotationsEndLine) && count($outputAnnotationsEndLine) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsEndLine when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputAnnotationsAnnotationLevel' is set + if ($outputAnnotationsAnnotationLevel === null || (is_array($outputAnnotationsAnnotationLevel) && count($outputAnnotationsAnnotationLevel) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsAnnotationLevel when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputAnnotationsMessage' is set + if ($outputAnnotationsMessage === null || (is_array($outputAnnotationsMessage) && count($outputAnnotationsMessage) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsMessage when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputImagesAlt' is set + if ($outputImagesAlt === null || (is_array($outputImagesAlt) && count($outputImagesAlt) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputImagesAlt when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'outputImagesImageUrl' is set + if ($outputImagesImageUrl === null || (is_array($outputImagesImageUrl) && count($outputImagesImageUrl) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputImagesImageUrl when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'actionsLabel' is set + if ($actionsLabel === null || (is_array($actionsLabel) && count($actionsLabel) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $actionsLabel when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'actionsDescription' is set + if ($actionsDescription === null || (is_array($actionsDescription) && count($actionsDescription) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $actionsDescription when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'actionsIdentifier' is set + if ($actionsIdentifier === null || (is_array($actionsIdentifier) && count($actionsIdentifier) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $actionsIdentifier when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + // verify the required parameter 'checkRunId' is set + if ($checkRunId === null || (is_array($checkRunId) && count($checkRunId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $checkRunId when calling patchV5ReposOwnerRepoCheckRunsCheckRunId' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/check-runs/{check_run_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + // path params + if ($checkRunId !== null) { + $resourcePath = str_replace( + '{' . 'check_run_id' . '}', + ObjectSerializer::toPathValue($checkRunId), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($pullRequestId !== null) { + $formParams['pull_request_id'] = ObjectSerializer::toFormValue($pullRequestId); + } + // form params + if ($detailsUrl !== null) { + $formParams['details_url'] = ObjectSerializer::toFormValue($detailsUrl); + } + // form params + if ($status !== null) { + $formParams['status'] = ObjectSerializer::toFormValue($status); + } + // form params + if ($startedAt !== null) { + $formParams['started_at'] = ObjectSerializer::toFormValue($startedAt); + } + // form params + if ($conclusion !== null) { + $formParams['conclusion'] = ObjectSerializer::toFormValue($conclusion); + } + // form params + if ($completedAt !== null) { + $formParams['completed_at'] = ObjectSerializer::toFormValue($completedAt); + } + // form params + if ($outputTitle !== null) { + $formParams['output[title]'] = ObjectSerializer::toFormValue($outputTitle); + } + // form params + if ($outputSummary !== null) { + $formParams['output[summary]'] = ObjectSerializer::toFormValue($outputSummary); + } + // form params + if ($outputText !== null) { + $formParams['output[text]'] = ObjectSerializer::toFormValue($outputText); + } + // form params + if ($outputAnnotationsPath !== null) { + $formParams['output[annotations][path]'] = ObjectSerializer::toFormValue($outputAnnotationsPath); + } + // form params + if ($outputAnnotationsStartLine !== null) { + $formParams['output[annotations][start_line]'] = ObjectSerializer::toFormValue($outputAnnotationsStartLine); + } + // form params + if ($outputAnnotationsEndLine !== null) { + $formParams['output[annotations][end_line]'] = ObjectSerializer::toFormValue($outputAnnotationsEndLine); + } + // form params + if ($outputAnnotationsStartColumn !== null) { + $formParams['output[annotations][start_column]'] = ObjectSerializer::toFormValue($outputAnnotationsStartColumn); + } + // form params + if ($outputAnnotationsEndColumn !== null) { + $formParams['output[annotations][end_column]'] = ObjectSerializer::toFormValue($outputAnnotationsEndColumn); + } + // form params + if ($outputAnnotationsAnnotationLevel !== null) { + $formParams['output[annotations][annotation_level]'] = ObjectSerializer::toFormValue($outputAnnotationsAnnotationLevel); + } + // form params + if ($outputAnnotationsMessage !== null) { + $formParams['output[annotations][message]'] = ObjectSerializer::toFormValue($outputAnnotationsMessage); + } + // form params + if ($outputAnnotationsTitle !== null) { + $formParams['output[annotations][title]'] = ObjectSerializer::toFormValue($outputAnnotationsTitle); + } + // form params + if ($outputAnnotationsRawDetails !== null) { + $formParams['output[annotations][raw_details]'] = ObjectSerializer::toFormValue($outputAnnotationsRawDetails); + } + // form params + if ($outputImagesAlt !== null) { + $formParams['output[images][alt]'] = ObjectSerializer::toFormValue($outputImagesAlt); + } + // form params + if ($outputImagesImageUrl !== null) { + $formParams['output[images][image_url]'] = ObjectSerializer::toFormValue($outputImagesImageUrl); + } + // form params + if ($outputImagesCaption !== null) { + $formParams['output[images][caption]'] = ObjectSerializer::toFormValue($outputImagesCaption); + } + // form params + if ($actionsLabel !== null) { + $formParams['actions[label]'] = ObjectSerializer::toFormValue($actionsLabel); + } + // form params + if ($actionsDescription !== null) { + $formParams['actions[description]'] = ObjectSerializer::toFormValue($actionsDescription); + } + // form params + if ($actionsIdentifier !== null) { + $formParams['actions[identifier]'] = ObjectSerializer::toFormValue($actionsIdentifier); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postV5ReposOwnerRepoCheckRuns + * + * 创建检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param string $name 名字 (required) + * @param string $headSha 提交的 sha 值(必须是完整的) (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId PullRequest ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\CheckRun + */ + public function postV5ReposOwnerRepoCheckRuns($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null) + { + list($response) = $this->postV5ReposOwnerRepoCheckRunsWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption); + return $response; + } + + /** + * Operation postV5ReposOwnerRepoCheckRunsWithHttpInfo + * + * 创建检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param string $name 名字 (required) + * @param string $headSha 提交的 sha 值(必须是完整的) (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId PullRequest ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\CheckRun, HTTP status code, HTTP response headers (array of strings) + */ + public function postV5ReposOwnerRepoCheckRunsWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null) + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->postV5ReposOwnerRepoCheckRunsRequest($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\CheckRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postV5ReposOwnerRepoCheckRunsAsync + * + * 创建检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param string $name 名字 (required) + * @param string $headSha 提交的 sha 值(必须是完整的) (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId PullRequest ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5ReposOwnerRepoCheckRunsAsync($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null) + { + return $this->postV5ReposOwnerRepoCheckRunsAsyncWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postV5ReposOwnerRepoCheckRunsAsyncWithHttpInfo + * + * 创建检查项 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param string $name 名字 (required) + * @param string $headSha 提交的 sha 值(必须是完整的) (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId PullRequest ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5ReposOwnerRepoCheckRunsAsyncWithHttpInfo($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null) + { + $returnType = '\Gitee\Model\CheckRun'; + $request = $this->postV5ReposOwnerRepoCheckRunsRequest($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken, $pullRequestId, $detailsUrl, $status, $startedAt, $conclusion, $completedAt, $outputText, $outputAnnotationsStartColumn, $outputAnnotationsEndColumn, $outputAnnotationsTitle, $outputAnnotationsRawDetails, $outputImagesCaption); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postV5ReposOwnerRepoCheckRuns' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $outputTitle 标题 (required) + * @param string $outputSummary 概论 (required) + * @param string[] $outputAnnotationsPath 路径 (required) + * @param int[] $outputAnnotationsStartLine 开始行 (required) + * @param int[] $outputAnnotationsEndLine 结束行 (required) + * @param string[] $outputAnnotationsAnnotationLevel 注释级别 (required) + * @param string[] $outputAnnotationsMessage 注释信息 (required) + * @param string[] $outputImagesAlt 注释 (required) + * @param string[] $outputImagesImageUrl URL (required) + * @param string[] $actionsLabel 文本 (required) + * @param string[] $actionsDescription 描述 (required) + * @param string[] $actionsIdentifier 标识 (required) + * @param string $name 名字 (required) + * @param string $headSha 提交的 sha 值(必须是完整的) (required) + * @param string $accessToken 用户授权码 (optional) + * @param int $pullRequestId PullRequest ID (optional) + * @param string $detailsUrl 详情链接 (optional) + * @param string $status 状态 (optional, default to queued) + * @param \DateTime $startedAt 开始时间 (optional) + * @param string $conclusion 结论 (optional) + * @param \DateTime $completedAt 完成时间 (optional) + * @param string $outputText 详细信息 (optional) + * @param int[] $outputAnnotationsStartColumn 开始列 (optional) + * @param int[] $outputAnnotationsEndColumn 结束列 (optional) + * @param string[] $outputAnnotationsTitle 标题 (optional) + * @param string[] $outputAnnotationsRawDetails 详情内容 (optional) + * @param string[] $outputImagesCaption 描述 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function postV5ReposOwnerRepoCheckRunsRequest($owner, $repo, $outputTitle, $outputSummary, $outputAnnotationsPath, $outputAnnotationsStartLine, $outputAnnotationsEndLine, $outputAnnotationsAnnotationLevel, $outputAnnotationsMessage, $outputImagesAlt, $outputImagesImageUrl, $actionsLabel, $actionsDescription, $actionsIdentifier, $name, $headSha, $accessToken = null, $pullRequestId = null, $detailsUrl = null, $status = 'queued', $startedAt = null, $conclusion = null, $completedAt = null, $outputText = null, $outputAnnotationsStartColumn = null, $outputAnnotationsEndColumn = null, $outputAnnotationsTitle = null, $outputAnnotationsRawDetails = null, $outputImagesCaption = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputTitle' is set + if ($outputTitle === null || (is_array($outputTitle) && count($outputTitle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputTitle when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputSummary' is set + if ($outputSummary === null || (is_array($outputSummary) && count($outputSummary) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputSummary when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputAnnotationsPath' is set + if ($outputAnnotationsPath === null || (is_array($outputAnnotationsPath) && count($outputAnnotationsPath) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsPath when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputAnnotationsStartLine' is set + if ($outputAnnotationsStartLine === null || (is_array($outputAnnotationsStartLine) && count($outputAnnotationsStartLine) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsStartLine when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputAnnotationsEndLine' is set + if ($outputAnnotationsEndLine === null || (is_array($outputAnnotationsEndLine) && count($outputAnnotationsEndLine) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsEndLine when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputAnnotationsAnnotationLevel' is set + if ($outputAnnotationsAnnotationLevel === null || (is_array($outputAnnotationsAnnotationLevel) && count($outputAnnotationsAnnotationLevel) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsAnnotationLevel when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputAnnotationsMessage' is set + if ($outputAnnotationsMessage === null || (is_array($outputAnnotationsMessage) && count($outputAnnotationsMessage) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputAnnotationsMessage when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputImagesAlt' is set + if ($outputImagesAlt === null || (is_array($outputImagesAlt) && count($outputImagesAlt) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputImagesAlt when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'outputImagesImageUrl' is set + if ($outputImagesImageUrl === null || (is_array($outputImagesImageUrl) && count($outputImagesImageUrl) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outputImagesImageUrl when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'actionsLabel' is set + if ($actionsLabel === null || (is_array($actionsLabel) && count($actionsLabel) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $actionsLabel when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'actionsDescription' is set + if ($actionsDescription === null || (is_array($actionsDescription) && count($actionsDescription) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $actionsDescription when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'actionsIdentifier' is set + if ($actionsIdentifier === null || (is_array($actionsIdentifier) && count($actionsIdentifier) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $actionsIdentifier when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling postV5ReposOwnerRepoCheckRuns' + ); + } + // verify the required parameter 'headSha' is set + if ($headSha === null || (is_array($headSha) && count($headSha) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $headSha when calling postV5ReposOwnerRepoCheckRuns' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/check-runs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($pullRequestId !== null) { + $formParams['pull_request_id'] = ObjectSerializer::toFormValue($pullRequestId); + } + // form params + if ($detailsUrl !== null) { + $formParams['details_url'] = ObjectSerializer::toFormValue($detailsUrl); + } + // form params + if ($status !== null) { + $formParams['status'] = ObjectSerializer::toFormValue($status); + } + // form params + if ($startedAt !== null) { + $formParams['started_at'] = ObjectSerializer::toFormValue($startedAt); + } + // form params + if ($conclusion !== null) { + $formParams['conclusion'] = ObjectSerializer::toFormValue($conclusion); + } + // form params + if ($completedAt !== null) { + $formParams['completed_at'] = ObjectSerializer::toFormValue($completedAt); + } + // form params + if ($outputTitle !== null) { + $formParams['output[title]'] = ObjectSerializer::toFormValue($outputTitle); + } + // form params + if ($outputSummary !== null) { + $formParams['output[summary]'] = ObjectSerializer::toFormValue($outputSummary); + } + // form params + if ($outputText !== null) { + $formParams['output[text]'] = ObjectSerializer::toFormValue($outputText); + } + // form params + if ($outputAnnotationsPath !== null) { + $formParams['output[annotations][path]'] = ObjectSerializer::toFormValue($outputAnnotationsPath); + } + // form params + if ($outputAnnotationsStartLine !== null) { + $formParams['output[annotations][start_line]'] = ObjectSerializer::toFormValue($outputAnnotationsStartLine); + } + // form params + if ($outputAnnotationsEndLine !== null) { + $formParams['output[annotations][end_line]'] = ObjectSerializer::toFormValue($outputAnnotationsEndLine); + } + // form params + if ($outputAnnotationsStartColumn !== null) { + $formParams['output[annotations][start_column]'] = ObjectSerializer::toFormValue($outputAnnotationsStartColumn); + } + // form params + if ($outputAnnotationsEndColumn !== null) { + $formParams['output[annotations][end_column]'] = ObjectSerializer::toFormValue($outputAnnotationsEndColumn); + } + // form params + if ($outputAnnotationsAnnotationLevel !== null) { + $formParams['output[annotations][annotation_level]'] = ObjectSerializer::toFormValue($outputAnnotationsAnnotationLevel); + } + // form params + if ($outputAnnotationsMessage !== null) { + $formParams['output[annotations][message]'] = ObjectSerializer::toFormValue($outputAnnotationsMessage); + } + // form params + if ($outputAnnotationsTitle !== null) { + $formParams['output[annotations][title]'] = ObjectSerializer::toFormValue($outputAnnotationsTitle); + } + // form params + if ($outputAnnotationsRawDetails !== null) { + $formParams['output[annotations][raw_details]'] = ObjectSerializer::toFormValue($outputAnnotationsRawDetails); + } + // form params + if ($outputImagesAlt !== null) { + $formParams['output[images][alt]'] = ObjectSerializer::toFormValue($outputImagesAlt); + } + // form params + if ($outputImagesImageUrl !== null) { + $formParams['output[images][image_url]'] = ObjectSerializer::toFormValue($outputImagesImageUrl); + } + // form params + if ($outputImagesCaption !== null) { + $formParams['output[images][caption]'] = ObjectSerializer::toFormValue($outputImagesCaption); + } + // form params + if ($actionsLabel !== null) { + $formParams['actions[label]'] = ObjectSerializer::toFormValue($actionsLabel); + } + // form params + if ($actionsDescription !== null) { + $formParams['actions[description]'] = ObjectSerializer::toFormValue($actionsDescription); + } + // form params + if ($actionsIdentifier !== null) { + $formParams['actions[identifier]'] = ObjectSerializer::toFormValue($actionsIdentifier); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($headSha !== null) { + $formParams['head_sha'] = ObjectSerializer::toFormValue($headSha); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EmailsApi.php b/src/Api/EmailsApi.php index aa7a86c..c50d85a 100644 --- a/src/Api/EmailsApi.php +++ b/src/Api/EmailsApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -96,7 +96,7 @@ public function getConfig() * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\UserEmail + * @return \Gitee\Model\UserEmail[] */ public function getV5Emails($accessToken = null) { @@ -113,11 +113,11 @@ public function getV5Emails($accessToken = null) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\UserEmail, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\UserEmail[], HTTP status code, HTTP response headers (array of strings) */ public function getV5EmailsWithHttpInfo($accessToken = null) { - $returnType = '\Gitee\Model\UserEmail'; + $returnType = '\Gitee\Model\UserEmail[]'; $request = $this->getV5EmailsRequest($accessToken); try { @@ -169,7 +169,7 @@ public function getV5EmailsWithHttpInfo($accessToken = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\UserEmail', + '\Gitee\Model\UserEmail[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -211,7 +211,7 @@ function ($response) { */ public function getV5EmailsAsyncWithHttpInfo($accessToken = null) { - $returnType = '\Gitee\Model\UserEmail'; + $returnType = '\Gitee\Model\UserEmail[]'; $request = $this->getV5EmailsRequest($accessToken); return $this->client diff --git a/src/Api/EnterprisesApi.php b/src/Api/EnterprisesApi.php index 04b41aa..b40a6f5 100644 --- a/src/Api/EnterprisesApi.php +++ b/src/Api/EnterprisesApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -876,6 +876,13 @@ protected function getV5EnterpriseEnterprisePullRequestsRequest($enterprise, $ac 'Missing the required parameter $enterprise when calling getV5EnterpriseEnterprisePullRequests' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterpriseEnterprisePullRequests, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterpriseEnterprisePullRequests, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprise/{enterprise}/pull_requests'; $formParams = []; @@ -1499,6 +1506,13 @@ protected function getV5EnterprisesEnterpriseMembersRequest($enterprise, $access 'Missing the required parameter $enterprise when calling getV5EnterprisesEnterpriseMembers' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseMembers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseMembers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprises/{enterprise}/members'; $formParams = []; @@ -1616,11 +1630,12 @@ protected function getV5EnterprisesEnterpriseMembersRequest($enterprise, $access * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Gitee\Model\EnterpriseMember */ public function getV5EnterprisesEnterpriseMembersSearch($enterprise, $queryType, $queryValue, $accessToken = null) { - $this->getV5EnterprisesEnterpriseMembersSearchWithHttpInfo($enterprise, $queryType, $queryValue, $accessToken); + list($response) = $this->getV5EnterprisesEnterpriseMembersSearchWithHttpInfo($enterprise, $queryType, $queryValue, $accessToken); + return $response; } /** @@ -1635,11 +1650,11 @@ public function getV5EnterprisesEnterpriseMembersSearch($enterprise, $queryType, * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\EnterpriseMember, HTTP status code, HTTP response headers (array of strings) */ public function getV5EnterprisesEnterpriseMembersSearchWithHttpInfo($enterprise, $queryType, $queryValue, $accessToken = null) { - $returnType = ''; + $returnType = '\Gitee\Model\EnterpriseMember'; $request = $this->getV5EnterprisesEnterpriseMembersSearchRequest($enterprise, $queryType, $queryValue, $accessToken); try { @@ -1670,10 +1685,32 @@ public function getV5EnterprisesEnterpriseMembersSearchWithHttpInfo($enterprise, ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\EnterpriseMember', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -1717,14 +1754,28 @@ function ($response) { */ public function getV5EnterprisesEnterpriseMembersSearchAsyncWithHttpInfo($enterprise, $queryType, $queryValue, $accessToken = null) { - $returnType = ''; + $returnType = '\Gitee\Model\EnterpriseMember'; $request = $this->getV5EnterprisesEnterpriseMembersSearchRequest($enterprise, $queryType, $queryValue, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2378,6 +2429,13 @@ protected function getV5EnterprisesEnterpriseUsersUsernameWeekReportsRequest($en 'Missing the required parameter $username when calling getV5EnterprisesEnterpriseUsersUsernameWeekReports' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseUsersUsernameWeekReports, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseUsersUsernameWeekReports, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprises/{enterprise}/users/{username}/week_reports'; $formParams = []; @@ -2702,6 +2760,13 @@ protected function getV5EnterprisesEnterpriseWeekReportsRequest($enterprise, $ac 'Missing the required parameter $enterprise when calling getV5EnterprisesEnterpriseWeekReports' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseWeekReports, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseWeekReports, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprises/{enterprise}/week_reports'; $formParams = []; @@ -3322,6 +3387,13 @@ protected function getV5EnterprisesEnterpriseWeekReportsIdCommentsRequest($enter 'Missing the required parameter $id when calling getV5EnterprisesEnterpriseWeekReportsIdComments' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseWeekReportsIdComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5EnterprisesEnterpriseWeekReportsIdComments, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprises/{enterprise}/week_reports/{id}/comments'; $formParams = []; @@ -3620,6 +3692,13 @@ function ($exception) { */ protected function getV5UserEnterprisesRequest($accessToken = null, $page = '1', $perPage = '20', $admin = 'true') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5UserEnterprises, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling EnterprisesApi.getV5UserEnterprises, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/enterprises'; $formParams = []; diff --git a/src/Api/GistsApi.php b/src/Api/GistsApi.php index b6cc389..7d0ca3b 100644 --- a/src/Api/GistsApi.php +++ b/src/Api/GistsApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -1018,6 +1018,13 @@ function ($exception) { */ protected function getV5GistsRequest($accessToken = null, $since = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5Gists, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5Gists, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/gists'; $formParams = []; @@ -1310,6 +1317,13 @@ protected function getV5GistsGistIdCommentsRequest($gistId, $accessToken = null, 'Missing the required parameter $gistId when calling getV5GistsGistIdComments' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5GistsGistIdComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5GistsGistIdComments, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/gists/{gist_id}/comments'; $formParams = []; @@ -2459,6 +2473,13 @@ protected function getV5GistsIdForksRequest($id, $accessToken = null, $page = '1 'Missing the required parameter $id when calling getV5GistsIdForks' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5GistsIdForks, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5GistsIdForks, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/gists/{id}/forks'; $formParams = []; @@ -2990,6 +3011,13 @@ function ($exception) { */ protected function getV5GistsStarredRequest($accessToken = null, $since = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5GistsStarred, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling GistsApi.getV5GistsStarred, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/gists/starred'; $formParams = []; @@ -3406,7 +3434,7 @@ protected function patchV5GistsGistIdCommentsIdRequest($gistId, $id, $body, $acc * * @param string $id 代码片段的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) * @param string $description 代码片段描述,1~30个字符 (optional) * * @throws \Gitee\ApiException on non-2xx response @@ -3426,7 +3454,7 @@ public function patchV5GistsId($id, $accessToken = null, $files = null, $descrip * * @param string $id 代码片段的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) * @param string $description 代码片段描述,1~30个字符 (optional) * * @throws \Gitee\ApiException on non-2xx response @@ -3504,7 +3532,7 @@ public function patchV5GistsIdWithHttpInfo($id, $accessToken = null, $files = nu * * @param string $id 代码片段的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) * @param string $description 代码片段描述,1~30个字符 (optional) * * @throws \InvalidArgumentException @@ -3527,7 +3555,7 @@ function ($response) { * * @param string $id 代码片段的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) * @param string $description 代码片段描述,1~30个字符 (optional) * * @throws \InvalidArgumentException @@ -3580,7 +3608,7 @@ function ($exception) { * * @param string $id 代码片段的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (optional) * @param string $description 代码片段描述,1~30个字符 (optional) * * @throws \InvalidArgumentException @@ -3700,7 +3728,7 @@ protected function patchV5GistsIdRequest($id, $accessToken = null, $files = null * * 创建代码片段 * - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) * @param string $description 代码片段描述,1~30个字符 (required) * @param string $accessToken 用户授权码 (optional) * @param bool $public 公开/私有,默认: 私有 (optional) @@ -3720,7 +3748,7 @@ public function postV5Gists($files, $description, $accessToken = null, $public = * * 创建代码片段 * - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) * @param string $description 代码片段描述,1~30个字符 (required) * @param string $accessToken 用户授权码 (optional) * @param bool $public 公开/私有,默认: 私有 (optional) @@ -3798,7 +3826,7 @@ public function postV5GistsWithHttpInfo($files, $description, $accessToken = nul * * 创建代码片段 * - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) * @param string $description 代码片段描述,1~30个字符 (required) * @param string $accessToken 用户授权码 (optional) * @param bool $public 公开/私有,默认: 私有 (optional) @@ -3821,7 +3849,7 @@ function ($response) { * * 创建代码片段 * - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) * @param string $description 代码片段描述,1~30个字符 (required) * @param string $accessToken 用户授权码 (optional) * @param bool $public 公开/私有,默认: 私有 (optional) @@ -3874,7 +3902,7 @@ function ($exception) { /** * Create request for operation 'postV5Gists' * - * @param map[string,string] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) + * @param string[] $files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } (required) * @param string $description 代码片段描述,1~30个字符 (required) * @param string $accessToken 用户授权码 (optional) * @param bool $public 公开/私有,默认: 私有 (optional) diff --git a/src/Api/GitDataApi.php b/src/Api/GitDataApi.php index 1ad0e7e..5f7361b 100644 --- a/src/Api/GitDataApi.php +++ b/src/Api/GitDataApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Api/IssuesApi.php b/src/Api/IssuesApi.php index 5b729e6..a89484a 100644 --- a/src/Api/IssuesApi.php +++ b/src/Api/IssuesApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -626,6 +626,13 @@ protected function getV5EnterprisesEnterpriseIssuesRequest($enterprise, $accessT 'Missing the required parameter $enterprise when calling getV5EnterprisesEnterpriseIssues' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5EnterprisesEnterpriseIssues, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5EnterprisesEnterpriseIssues, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprises/{enterprise}/issues'; $formParams = []; @@ -1282,6 +1289,13 @@ protected function getV5EnterprisesEnterpriseIssuesNumberCommentsRequest($enterp 'Missing the required parameter $number when calling getV5EnterprisesEnterpriseIssuesNumberComments' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5EnterprisesEnterpriseIssuesNumberComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5EnterprisesEnterpriseIssuesNumberComments, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprises/{enterprise}/issues/{number}/comments'; $formParams = []; @@ -1597,6 +1611,13 @@ protected function getV5EnterprisesEnterpriseIssuesNumberLabelsRequest($enterpri 'Missing the required parameter $number when calling getV5EnterprisesEnterpriseIssuesNumberLabels' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5EnterprisesEnterpriseIssuesNumberLabels, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5EnterprisesEnterpriseIssuesNumberLabels, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/enterprises/{enterprise}/issues/{number}/labels'; $formParams = []; @@ -2237,6 +2258,13 @@ function ($exception) { */ protected function getV5IssuesRequest($accessToken = null, $filter = 'assigned', $state = 'open', $labels = null, $sort = 'created', $direction = 'desc', $since = null, $page = '1', $perPage = '20', $schedule = null, $deadline = null, $createdAt = null, $finishedAt = null) { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5Issues, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5Issues, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/issues'; $formParams = []; @@ -2615,6 +2643,13 @@ protected function getV5OrgsOrgIssuesRequest($org, $accessToken = null, $filter 'Missing the required parameter $org when calling getV5OrgsOrgIssues' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5OrgsOrgIssues, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5OrgsOrgIssues, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/orgs/{org}/issues'; $formParams = []; @@ -3648,6 +3683,13 @@ protected function getV5ReposOwnerRepoIssuesRequest($owner, $repo, $accessToken 'Missing the required parameter $repo when calling getV5ReposOwnerRepoIssues' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5ReposOwnerRepoIssues, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5ReposOwnerRepoIssues, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/issues'; $formParams = []; @@ -3825,7 +3867,7 @@ protected function getV5ReposOwnerRepoIssuesRequest($owner, $repo, $accessToken * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Note + * @return \Gitee\Model\Note[] */ public function getV5ReposOwnerRepoIssuesComments($owner, $repo, $accessToken = null, $sort = 'created', $direction = 'asc', $since = null, $page = '1', $perPage = '20') { @@ -3849,11 +3891,11 @@ public function getV5ReposOwnerRepoIssuesComments($owner, $repo, $accessToken = * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Note[], HTTP status code, HTTP response headers (array of strings) */ public function getV5ReposOwnerRepoIssuesCommentsWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'created', $direction = 'asc', $since = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Note'; + $returnType = '\Gitee\Model\Note[]'; $request = $this->getV5ReposOwnerRepoIssuesCommentsRequest($owner, $repo, $accessToken, $sort, $direction, $since, $page, $perPage); try { @@ -3905,7 +3947,7 @@ public function getV5ReposOwnerRepoIssuesCommentsWithHttpInfo($owner, $repo, $ac case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Note', + '\Gitee\Model\Note[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3961,7 +4003,7 @@ function ($response) { */ public function getV5ReposOwnerRepoIssuesCommentsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'created', $direction = 'asc', $since = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Note'; + $returnType = '\Gitee\Model\Note[]'; $request = $this->getV5ReposOwnerRepoIssuesCommentsRequest($owner, $repo, $accessToken, $sort, $direction, $since, $page, $perPage); return $this->client @@ -4030,6 +4072,13 @@ protected function getV5ReposOwnerRepoIssuesCommentsRequest($owner, $repo, $acce 'Missing the required parameter $repo when calling getV5ReposOwnerRepoIssuesComments' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5ReposOwnerRepoIssuesComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5ReposOwnerRepoIssuesComments, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/issues/comments'; $formParams = []; @@ -4799,7 +4848,7 @@ protected function getV5ReposOwnerRepoIssuesNumberRequest($owner, $repo, $number * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Note + * @return \Gitee\Model\Note[] */ public function getV5ReposOwnerRepoIssuesNumberComments($owner, $repo, $number, $accessToken = null, $since = null, $page = '1', $perPage = '20', $order = 'asc') { @@ -4823,11 +4872,11 @@ public function getV5ReposOwnerRepoIssuesNumberComments($owner, $repo, $number, * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Note[], HTTP status code, HTTP response headers (array of strings) */ public function getV5ReposOwnerRepoIssuesNumberCommentsWithHttpInfo($owner, $repo, $number, $accessToken = null, $since = null, $page = '1', $perPage = '20', $order = 'asc') { - $returnType = '\Gitee\Model\Note'; + $returnType = '\Gitee\Model\Note[]'; $request = $this->getV5ReposOwnerRepoIssuesNumberCommentsRequest($owner, $repo, $number, $accessToken, $since, $page, $perPage, $order); try { @@ -4879,7 +4928,7 @@ public function getV5ReposOwnerRepoIssuesNumberCommentsWithHttpInfo($owner, $rep case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Note', + '\Gitee\Model\Note[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4935,7 +4984,7 @@ function ($response) { */ public function getV5ReposOwnerRepoIssuesNumberCommentsAsyncWithHttpInfo($owner, $repo, $number, $accessToken = null, $since = null, $page = '1', $perPage = '20', $order = 'asc') { - $returnType = '\Gitee\Model\Note'; + $returnType = '\Gitee\Model\Note[]'; $request = $this->getV5ReposOwnerRepoIssuesNumberCommentsRequest($owner, $repo, $number, $accessToken, $since, $page, $perPage, $order); return $this->client @@ -5010,6 +5059,13 @@ protected function getV5ReposOwnerRepoIssuesNumberCommentsRequest($owner, $repo, 'Missing the required parameter $number when calling getV5ReposOwnerRepoIssuesNumberComments' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5ReposOwnerRepoIssuesNumberComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5ReposOwnerRepoIssuesNumberComments, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/issues/{number}/comments'; $formParams = []; @@ -5369,6 +5425,13 @@ function ($exception) { */ protected function getV5UserIssuesRequest($accessToken = null, $filter = 'assigned', $state = 'open', $labels = null, $sort = 'created', $direction = 'desc', $since = null, $page = '1', $perPage = '20', $schedule = null, $deadline = null, $createdAt = null, $finishedAt = null) { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5UserIssues, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling IssuesApi.getV5UserIssues, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/issues'; $formParams = []; diff --git a/src/Api/LabelsApi.php b/src/Api/LabelsApi.php index 8a84aaf..64c1c42 100644 --- a/src/Api/LabelsApi.php +++ b/src/Api/LabelsApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -2721,6 +2721,303 @@ protected function getV5ReposOwnerRepoLabelsNameRequest($owner, $repo, $name, $a ); } + /** + * Operation getV5ReposOwnerRepoProjectLabels + * + * 获取仓库所有标签 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\ProjectLabel[] + */ + public function getV5ReposOwnerRepoProjectLabels($owner, $repo, $accessToken = null) + { + list($response) = $this->getV5ReposOwnerRepoProjectLabelsWithHttpInfo($owner, $repo, $accessToken); + return $response; + } + + /** + * Operation getV5ReposOwnerRepoProjectLabelsWithHttpInfo + * + * 获取仓库所有标签 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\ProjectLabel[], HTTP status code, HTTP response headers (array of strings) + */ + public function getV5ReposOwnerRepoProjectLabelsWithHttpInfo($owner, $repo, $accessToken = null) + { + $returnType = '\Gitee\Model\ProjectLabel[]'; + $request = $this->getV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $accessToken); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\ProjectLabel[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getV5ReposOwnerRepoProjectLabelsAsync + * + * 获取仓库所有标签 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoProjectLabelsAsync($owner, $repo, $accessToken = null) + { + return $this->getV5ReposOwnerRepoProjectLabelsAsyncWithHttpInfo($owner, $repo, $accessToken) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5ReposOwnerRepoProjectLabelsAsyncWithHttpInfo + * + * 获取仓库所有标签 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoProjectLabelsAsyncWithHttpInfo($owner, $repo, $accessToken = null) + { + $returnType = '\Gitee\Model\ProjectLabel[]'; + $request = $this->getV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $accessToken); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5ReposOwnerRepoProjectLabels' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $accessToken = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoProjectLabels' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoProjectLabels' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/project_labels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation patchV5ReposOwnerRepoLabelsOriginalName * @@ -3068,7 +3365,7 @@ protected function patchV5ReposOwnerRepoLabelsOriginalNameRequest($owner, $repo, * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Label + * @return \Gitee\Model\Label[] */ public function postV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $body, $accessToken = null) { @@ -3089,11 +3386,11 @@ public function postV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $ * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Label, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Label[], HTTP status code, HTTP response headers (array of strings) */ public function postV5ReposOwnerRepoIssuesNumberLabelsWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->postV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); try { @@ -3145,7 +3442,7 @@ public function postV5ReposOwnerRepoIssuesNumberLabelsWithHttpInfo($owner, $repo case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Label', + '\Gitee\Model\Label[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3195,7 +3492,7 @@ function ($response) { */ public function postV5ReposOwnerRepoIssuesNumberLabelsAsyncWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->postV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); return $this->client @@ -3281,6 +3578,10 @@ protected function postV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -3307,10 +3608,6 @@ protected function postV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } // body params $_tempBody = null; if (isset($body)) { @@ -3724,7 +4021,7 @@ protected function postV5ReposOwnerRepoLabelsRequest($owner, $repo, $name, $colo * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\ProjectLabel + * @return \Gitee\Model\ProjectLabel[] */ public function postV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessToken = null) { @@ -3744,11 +4041,11 @@ public function postV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessT * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\ProjectLabel, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\ProjectLabel[], HTTP status code, HTTP response headers (array of strings) */ public function postV5ReposOwnerRepoProjectLabelsWithHttpInfo($owner, $repo, $body, $accessToken = null) { - $returnType = '\Gitee\Model\ProjectLabel'; + $returnType = '\Gitee\Model\ProjectLabel[]'; $request = $this->postV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body, $accessToken); try { @@ -3800,7 +4097,7 @@ public function postV5ReposOwnerRepoProjectLabelsWithHttpInfo($owner, $repo, $bo case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\ProjectLabel', + '\Gitee\Model\ProjectLabel[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3848,7 +4145,7 @@ function ($response) { */ public function postV5ReposOwnerRepoProjectLabelsAsyncWithHttpInfo($owner, $repo, $body, $accessToken = null) { - $returnType = '\Gitee\Model\ProjectLabel'; + $returnType = '\Gitee\Model\ProjectLabel[]'; $request = $this->postV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body, $accessToken); return $this->client @@ -3927,6 +4224,10 @@ protected function postV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -3945,10 +4246,6 @@ protected function postV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } // body params $_tempBody = null; if (isset($body)) { @@ -4036,7 +4333,7 @@ protected function postV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Label + * @return \Gitee\Model\Label[] */ public function putV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $body, $accessToken = null) { @@ -4057,11 +4354,11 @@ public function putV5ReposOwnerRepoIssuesNumberLabels($owner, $repo, $number, $b * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Label, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Label[], HTTP status code, HTTP response headers (array of strings) */ public function putV5ReposOwnerRepoIssuesNumberLabelsWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->putV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); try { @@ -4113,7 +4410,7 @@ public function putV5ReposOwnerRepoIssuesNumberLabelsWithHttpInfo($owner, $repo, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Label', + '\Gitee\Model\Label[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4163,7 +4460,7 @@ function ($response) { */ public function putV5ReposOwnerRepoIssuesNumberLabelsAsyncWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->putV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); return $this->client @@ -4249,6 +4546,10 @@ protected function putV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $ $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -4275,10 +4576,6 @@ protected function putV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $ ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } // body params $_tempBody = null; if (isset($body)) { @@ -4365,7 +4662,7 @@ protected function putV5ReposOwnerRepoIssuesNumberLabelsRequest($owner, $repo, $ * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\ProjectLabel + * @return \Gitee\Model\ProjectLabel[] */ public function putV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessToken = null) { @@ -4385,11 +4682,11 @@ public function putV5ReposOwnerRepoProjectLabels($owner, $repo, $body, $accessTo * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\ProjectLabel, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\ProjectLabel[], HTTP status code, HTTP response headers (array of strings) */ public function putV5ReposOwnerRepoProjectLabelsWithHttpInfo($owner, $repo, $body, $accessToken = null) { - $returnType = '\Gitee\Model\ProjectLabel'; + $returnType = '\Gitee\Model\ProjectLabel[]'; $request = $this->putV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body, $accessToken); try { @@ -4441,7 +4738,7 @@ public function putV5ReposOwnerRepoProjectLabelsWithHttpInfo($owner, $repo, $bod case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\ProjectLabel', + '\Gitee\Model\ProjectLabel[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4489,7 +4786,7 @@ function ($response) { */ public function putV5ReposOwnerRepoProjectLabelsAsyncWithHttpInfo($owner, $repo, $body, $accessToken = null) { - $returnType = '\Gitee\Model\ProjectLabel'; + $returnType = '\Gitee\Model\ProjectLabel[]'; $request = $this->putV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body, $accessToken); return $this->client @@ -4568,6 +4865,10 @@ protected function putV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body, $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -4586,10 +4887,6 @@ protected function putV5ReposOwnerRepoProjectLabelsRequest($owner, $repo, $body, ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } // body params $_tempBody = null; if (isset($body)) { diff --git a/src/Api/MilestonesApi.php b/src/Api/MilestonesApi.php index 0525898..b7baf05 100644 --- a/src/Api/MilestonesApi.php +++ b/src/Api/MilestonesApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -587,6 +587,13 @@ protected function getV5ReposOwnerRepoMilestonesRequest($owner, $repo, $accessTo 'Missing the required parameter $repo when calling getV5ReposOwnerRepoMilestones' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling MilestonesApi.getV5ReposOwnerRepoMilestones, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling MilestonesApi.getV5ReposOwnerRepoMilestones, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/milestones'; $formParams = []; @@ -1033,7 +1040,7 @@ protected function getV5ReposOwnerRepoMilestonesNumberRequest($owner, $repo, $nu * @param string $repo 仓库路径(path) (required) * @param int $number 里程碑序号(id) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1057,7 +1064,7 @@ public function patchV5ReposOwnerRepoMilestonesNumber($owner, $repo, $number, $t * @param string $repo 仓库路径(path) (required) * @param int $number 里程碑序号(id) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1139,7 +1146,7 @@ public function patchV5ReposOwnerRepoMilestonesNumberWithHttpInfo($owner, $repo, * @param string $repo 仓库路径(path) (required) * @param int $number 里程碑序号(id) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1166,7 +1173,7 @@ function ($response) { * @param string $repo 仓库路径(path) (required) * @param int $number 里程碑序号(id) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1223,7 +1230,7 @@ function ($exception) { * @param string $repo 仓库路径(path) (required) * @param int $number 里程碑序号(id) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1396,7 +1403,7 @@ protected function patchV5ReposOwnerRepoMilestonesNumberRequest($owner, $repo, $ * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1419,7 +1426,7 @@ public function postV5ReposOwnerRepoMilestones($owner, $repo, $title, $dueOn, $a * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1500,7 +1507,7 @@ public function postV5ReposOwnerRepoMilestonesWithHttpInfo($owner, $repo, $title * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1526,7 +1533,7 @@ function ($response) { * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) @@ -1582,7 +1589,7 @@ function ($exception) { * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $title 里程碑标题 (required) - * @param string $dueOn 里程碑的截止日期 (required) + * @param \DateTime $dueOn 里程碑的截止日期 (required) * @param string $accessToken 用户授权码 (optional) * @param string $state 里程碑状态: open, closed, all。默认: open (optional, default to open) * @param string $description 里程碑具体描述 (optional) diff --git a/src/Api/MiscellaneousApi.php b/src/Api/MiscellaneousApi.php index 53306ec..8f8871c 100644 --- a/src/Api/MiscellaneousApi.php +++ b/src/Api/MiscellaneousApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Api/OrganizationsApi.php b/src/Api/OrganizationsApi.php index 016759e..69a0001 100644 --- a/src/Api/OrganizationsApi.php +++ b/src/Api/OrganizationsApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -598,7 +598,7 @@ protected function deleteV5UserMembershipsOrgsOrgRequest($org, $accessToken = nu * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Group + * @return \Gitee\Model\GroupDetail */ public function getV5OrgsOrg($org, $accessToken = null) { @@ -616,11 +616,11 @@ public function getV5OrgsOrg($org, $accessToken = null) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Group, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\GroupDetail, HTTP status code, HTTP response headers (array of strings) */ public function getV5OrgsOrgWithHttpInfo($org, $accessToken = null) { - $returnType = '\Gitee\Model\Group'; + $returnType = '\Gitee\Model\GroupDetail'; $request = $this->getV5OrgsOrgRequest($org, $accessToken); try { @@ -672,7 +672,7 @@ public function getV5OrgsOrgWithHttpInfo($org, $accessToken = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Group', + '\Gitee\Model\GroupDetail', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -716,7 +716,7 @@ function ($response) { */ public function getV5OrgsOrgAsyncWithHttpInfo($org, $accessToken = null) { - $returnType = '\Gitee\Model\Group'; + $returnType = '\Gitee\Model\GroupDetail'; $request = $this->getV5OrgsOrgRequest($org, $accessToken); return $this->client @@ -1061,6 +1061,13 @@ protected function getV5OrgsOrgFollowersRequest($org, $accessToken = null, $page 'Missing the required parameter $org when calling getV5OrgsOrgFollowers' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5OrgsOrgFollowers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5OrgsOrgFollowers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/orgs/{org}/followers'; $formParams = []; @@ -1362,6 +1369,13 @@ protected function getV5OrgsOrgMembersRequest($org, $accessToken = null, $page = 'Missing the required parameter $org when calling getV5OrgsOrgMembers' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5OrgsOrgMembers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5OrgsOrgMembers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/orgs/{org}/members'; $formParams = []; @@ -1953,6 +1967,13 @@ function ($exception) { */ protected function getV5UserMembershipsOrgsRequest($accessToken = null, $active = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5UserMembershipsOrgs, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5UserMembershipsOrgs, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/memberships/orgs'; $formParams = []; @@ -2517,6 +2538,13 @@ function ($exception) { */ protected function getV5UserOrgsRequest($accessToken = null, $page = '1', $perPage = '20', $admin = null) { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5UserOrgs, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5UserOrgs, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/orgs'; $formParams = []; @@ -2809,6 +2837,13 @@ protected function getV5UsersUsernameOrgsRequest($username, $accessToken = null, 'Missing the required parameter $username when calling getV5UsersUsernameOrgs' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5UsersUsernameOrgs, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling OrganizationsApi.getV5UsersUsernameOrgs, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/users/{username}/orgs'; $formParams = []; diff --git a/src/Api/PullRequestsApi.php b/src/Api/PullRequestsApi.php index 958c481..4e4a8bc 100644 --- a/src/Api/PullRequestsApi.php +++ b/src/Api/PullRequestsApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -1344,14 +1344,17 @@ protected function deleteV5ReposOwnerRepoPullsNumberTestersRequest($owner, $repo * @param string $labels 用逗号分开的标签。如: bug,performance (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $author 可选。PR 创建者用户名 (optional) + * @param string $assignee 可选。评审者用户名 (optional) + * @param string $tester 可选。测试者用户名 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Gitee\Model\PullRequest[] */ - public function getV5ReposOwnerRepoPulls($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoPulls($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20', $author = null, $assignee = null, $tester = null) { - list($response) = $this->getV5ReposOwnerRepoPullsWithHttpInfo($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoPullsWithHttpInfo($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage, $author, $assignee, $tester); return $response; } @@ -1373,15 +1376,18 @@ public function getV5ReposOwnerRepoPulls($owner, $repo, $accessToken = null, $st * @param string $labels 用逗号分开的标签。如: bug,performance (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $author 可选。PR 创建者用户名 (optional) + * @param string $assignee 可选。评审者用户名 (optional) + * @param string $tester 可选。测试者用户名 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Gitee\Model\PullRequest[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoPullsWithHttpInfo($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoPullsWithHttpInfo($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20', $author = null, $assignee = null, $tester = null) { $returnType = '\Gitee\Model\PullRequest[]'; - $request = $this->getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage); + $request = $this->getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage, $author, $assignee, $tester); try { $options = $this->createHttpClientOption(); @@ -1460,13 +1466,16 @@ public function getV5ReposOwnerRepoPullsWithHttpInfo($owner, $repo, $accessToken * @param string $labels 用逗号分开的标签。如: bug,performance (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $author 可选。PR 创建者用户名 (optional) + * @param string $assignee 可选。评审者用户名 (optional) + * @param string $tester 可选。测试者用户名 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoPullsAsync($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoPullsAsync($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20', $author = null, $assignee = null, $tester = null) { - return $this->getV5ReposOwnerRepoPullsAsyncWithHttpInfo($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage) + return $this->getV5ReposOwnerRepoPullsAsyncWithHttpInfo($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage, $author, $assignee, $tester) ->then( function ($response) { return $response[0]; @@ -1492,14 +1501,17 @@ function ($response) { * @param string $labels 用逗号分开的标签。如: bug,performance (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $author 可选。PR 创建者用户名 (optional) + * @param string $assignee 可选。评审者用户名 (optional) + * @param string $tester 可选。测试者用户名 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoPullsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoPullsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20', $author = null, $assignee = null, $tester = null) { $returnType = '\Gitee\Model\PullRequest[]'; - $request = $this->getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage); + $request = $this->getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken, $state, $head, $base, $sort, $since, $direction, $milestoneNumber, $labels, $page, $perPage, $author, $assignee, $tester); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1554,11 +1566,14 @@ function ($exception) { * @param string $labels 用逗号分开的标签。如: bug,performance (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $author 可选。PR 创建者用户名 (optional) + * @param string $assignee 可选。评审者用户名 (optional) + * @param string $tester 可选。测试者用户名 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken = null, $state = 'open', $head = null, $base = null, $sort = 'created', $since = null, $direction = 'desc', $milestoneNumber = null, $labels = null, $page = '1', $perPage = '20', $author = null, $assignee = null, $tester = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { @@ -1572,6 +1587,13 @@ protected function getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken = 'Missing the required parameter $repo when calling getV5ReposOwnerRepoPulls' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPulls, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPulls, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/pulls'; $formParams = []; @@ -1624,6 +1646,18 @@ protected function getV5ReposOwnerRepoPullsRequest($owner, $repo, $accessToken = if ($perPage !== null) { $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); } + // query params + if ($author !== null) { + $queryParams['author'] = ObjectSerializer::toQueryValue($author); + } + // query params + if ($assignee !== null) { + $queryParams['assignee'] = ObjectSerializer::toQueryValue($assignee); + } + // query params + if ($tester !== null) { + $queryParams['tester'] = ObjectSerializer::toQueryValue($tester); + } // path params if ($owner !== null) { @@ -2572,6 +2606,13 @@ protected function getV5ReposOwnerRepoPullsNumberCommentsRequest($owner, $repo, 'Missing the required parameter $number when calling getV5ReposOwnerRepoPullsNumberComments' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPullsNumberComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPullsNumberComments, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/pulls/{number}/comments'; $formParams = []; @@ -3546,6 +3587,13 @@ protected function getV5ReposOwnerRepoPullsNumberIssuesRequest($owner, $repo, $n 'Missing the required parameter $number when calling getV5ReposOwnerRepoPullsNumberIssues' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPullsNumberIssues, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPullsNumberIssues, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/pulls/{number}/issues'; $formParams = []; @@ -3880,6 +3928,13 @@ protected function getV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $n 'Missing the required parameter $number when calling getV5ReposOwnerRepoPullsNumberLabels' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPullsNumberLabels, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling PullRequestsApi.getV5ReposOwnerRepoPullsNumberLabels, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/pulls/{number}/labels'; $formParams = []; @@ -4289,7 +4344,7 @@ protected function getV5ReposOwnerRepoPullsNumberMergeRequest($owner, $repo, $nu * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\OperateLog + * @return \Gitee\Model\OperateLog[] */ public function getV5ReposOwnerRepoPullsNumberOperateLogs($owner, $repo, $number, $accessToken = null, $sort = 'desc') { @@ -4310,11 +4365,11 @@ public function getV5ReposOwnerRepoPullsNumberOperateLogs($owner, $repo, $number * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\OperateLog, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\OperateLog[], HTTP status code, HTTP response headers (array of strings) */ public function getV5ReposOwnerRepoPullsNumberOperateLogsWithHttpInfo($owner, $repo, $number, $accessToken = null, $sort = 'desc') { - $returnType = '\Gitee\Model\OperateLog'; + $returnType = '\Gitee\Model\OperateLog[]'; $request = $this->getV5ReposOwnerRepoPullsNumberOperateLogsRequest($owner, $repo, $number, $accessToken, $sort); try { @@ -4366,7 +4421,7 @@ public function getV5ReposOwnerRepoPullsNumberOperateLogsWithHttpInfo($owner, $r case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\OperateLog', + '\Gitee\Model\OperateLog[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4416,7 +4471,7 @@ function ($response) { */ public function getV5ReposOwnerRepoPullsNumberOperateLogsAsyncWithHttpInfo($owner, $repo, $number, $accessToken = null, $sort = 'desc') { - $returnType = '\Gitee\Model\OperateLog'; + $returnType = '\Gitee\Model\OperateLog[]'; $request = $this->getV5ReposOwnerRepoPullsNumberOperateLogsRequest($owner, $repo, $number, $accessToken, $sort); return $this->client @@ -4949,6 +5004,7 @@ protected function patchV5ReposOwnerRepoPullsCommentsIdRequest($owner, $repo, $i * @param int $assigneesNumber 可选。最少审查人数 (optional) * @param int $testersNumber 可选。最少测试人数 (optional) * @param string $refPullRequestNumbers 可选。依赖的当前仓库下的PR编号,置空则清空依赖的PR。如:17,18,19 (optional) + * @param bool $closeRelatedIssue 可选,合并后是否关闭关联的 Issue,默认根据仓库配置设置 (optional) * @param bool $draft 是否设置为草稿 (optional) * @param bool $squash 接受 Pull Request 时使用扁平化(Squash)合并 (optional) * @@ -4956,9 +5012,9 @@ protected function patchV5ReposOwnerRepoPullsCommentsIdRequest($owner, $repo, $i * @throws \InvalidArgumentException * @return \Gitee\Model\PullRequest */ - public function patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $draft = null, $squash = null) + public function patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $closeRelatedIssue = null, $draft = null, $squash = null) { - list($response) = $this->patchV5ReposOwnerRepoPullsNumberWithHttpInfo($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $draft, $squash); + list($response) = $this->patchV5ReposOwnerRepoPullsNumberWithHttpInfo($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $closeRelatedIssue, $draft, $squash); return $response; } @@ -4979,6 +5035,7 @@ public function patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $access * @param int $assigneesNumber 可选。最少审查人数 (optional) * @param int $testersNumber 可选。最少测试人数 (optional) * @param string $refPullRequestNumbers 可选。依赖的当前仓库下的PR编号,置空则清空依赖的PR。如:17,18,19 (optional) + * @param bool $closeRelatedIssue 可选,合并后是否关闭关联的 Issue,默认根据仓库配置设置 (optional) * @param bool $draft 是否设置为草稿 (optional) * @param bool $squash 接受 Pull Request 时使用扁平化(Squash)合并 (optional) * @@ -4986,10 +5043,10 @@ public function patchV5ReposOwnerRepoPullsNumber($owner, $repo, $number, $access * @throws \InvalidArgumentException * @return array of \Gitee\Model\PullRequest, HTTP status code, HTTP response headers (array of strings) */ - public function patchV5ReposOwnerRepoPullsNumberWithHttpInfo($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $draft = null, $squash = null) + public function patchV5ReposOwnerRepoPullsNumberWithHttpInfo($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $closeRelatedIssue = null, $draft = null, $squash = null) { $returnType = '\Gitee\Model\PullRequest'; - $request = $this->patchV5ReposOwnerRepoPullsNumberRequest($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $draft, $squash); + $request = $this->patchV5ReposOwnerRepoPullsNumberRequest($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $closeRelatedIssue, $draft, $squash); try { $options = $this->createHttpClientOption(); @@ -5067,15 +5124,16 @@ public function patchV5ReposOwnerRepoPullsNumberWithHttpInfo($owner, $repo, $num * @param int $assigneesNumber 可选。最少审查人数 (optional) * @param int $testersNumber 可选。最少测试人数 (optional) * @param string $refPullRequestNumbers 可选。依赖的当前仓库下的PR编号,置空则清空依赖的PR。如:17,18,19 (optional) + * @param bool $closeRelatedIssue 可选,合并后是否关闭关联的 Issue,默认根据仓库配置设置 (optional) * @param bool $draft 是否设置为草稿 (optional) * @param bool $squash 接受 Pull Request 时使用扁平化(Squash)合并 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoPullsNumberAsync($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $draft = null, $squash = null) + public function patchV5ReposOwnerRepoPullsNumberAsync($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $closeRelatedIssue = null, $draft = null, $squash = null) { - return $this->patchV5ReposOwnerRepoPullsNumberAsyncWithHttpInfo($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $draft, $squash) + return $this->patchV5ReposOwnerRepoPullsNumberAsyncWithHttpInfo($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $closeRelatedIssue, $draft, $squash) ->then( function ($response) { return $response[0]; @@ -5100,16 +5158,17 @@ function ($response) { * @param int $assigneesNumber 可选。最少审查人数 (optional) * @param int $testersNumber 可选。最少测试人数 (optional) * @param string $refPullRequestNumbers 可选。依赖的当前仓库下的PR编号,置空则清空依赖的PR。如:17,18,19 (optional) + * @param bool $closeRelatedIssue 可选,合并后是否关闭关联的 Issue,默认根据仓库配置设置 (optional) * @param bool $draft 是否设置为草稿 (optional) * @param bool $squash 接受 Pull Request 时使用扁平化(Squash)合并 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoPullsNumberAsyncWithHttpInfo($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $draft = null, $squash = null) + public function patchV5ReposOwnerRepoPullsNumberAsyncWithHttpInfo($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $closeRelatedIssue = null, $draft = null, $squash = null) { $returnType = '\Gitee\Model\PullRequest'; - $request = $this->patchV5ReposOwnerRepoPullsNumberRequest($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $draft, $squash); + $request = $this->patchV5ReposOwnerRepoPullsNumberRequest($owner, $repo, $number, $accessToken, $title, $body, $state, $milestoneNumber, $labels, $assigneesNumber, $testersNumber, $refPullRequestNumbers, $closeRelatedIssue, $draft, $squash); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5163,13 +5222,14 @@ function ($exception) { * @param int $assigneesNumber 可选。最少审查人数 (optional) * @param int $testersNumber 可选。最少测试人数 (optional) * @param string $refPullRequestNumbers 可选。依赖的当前仓库下的PR编号,置空则清空依赖的PR。如:17,18,19 (optional) + * @param bool $closeRelatedIssue 可选,合并后是否关闭关联的 Issue,默认根据仓库配置设置 (optional) * @param bool $draft 是否设置为草稿 (optional) * @param bool $squash 接受 Pull Request 时使用扁平化(Squash)合并 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function patchV5ReposOwnerRepoPullsNumberRequest($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $draft = null, $squash = null) + protected function patchV5ReposOwnerRepoPullsNumberRequest($owner, $repo, $number, $accessToken = null, $title = null, $body = null, $state = null, $milestoneNumber = null, $labels = null, $assigneesNumber = null, $testersNumber = null, $refPullRequestNumbers = null, $closeRelatedIssue = null, $draft = null, $squash = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { @@ -5260,6 +5320,10 @@ protected function patchV5ReposOwnerRepoPullsNumberRequest($owner, $repo, $numbe $formParams['ref_pull_request_numbers'] = ObjectSerializer::toFormValue($refPullRequestNumbers); } // form params + if ($closeRelatedIssue !== null) { + $formParams['close_related_issue'] = ObjectSerializer::toFormValue($closeRelatedIssue); + } + // form params if ($draft !== null) { $formParams['draft'] = ObjectSerializer::toFormValue($draft); } @@ -7149,7 +7213,7 @@ protected function postV5ReposOwnerRepoPullsNumberCommentsRequest($owner, $repo, * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Label + * @return \Gitee\Model\Label[] */ public function postV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $body, $accessToken = null) { @@ -7170,11 +7234,11 @@ public function postV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $b * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Label, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Label[], HTTP status code, HTTP response headers (array of strings) */ public function postV5ReposOwnerRepoPullsNumberLabelsWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->postV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); try { @@ -7226,7 +7290,7 @@ public function postV5ReposOwnerRepoPullsNumberLabelsWithHttpInfo($owner, $repo, case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Label', + '\Gitee\Model\Label[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7276,7 +7340,7 @@ function ($response) { */ public function postV5ReposOwnerRepoPullsNumberLabelsAsyncWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->postV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); return $this->client @@ -7362,6 +7426,10 @@ protected function postV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $ $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -7388,10 +7456,6 @@ protected function postV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $ ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } // body params $_tempBody = null; if (isset($body)) { @@ -8386,7 +8450,7 @@ protected function postV5ReposOwnerRepoPullsNumberTestersRequest($owner, $repo, * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Label + * @return \Gitee\Model\Label[] */ public function putV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $body, $accessToken = null) { @@ -8407,11 +8471,11 @@ public function putV5ReposOwnerRepoPullsNumberLabels($owner, $repo, $number, $bo * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Label, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Label[], HTTP status code, HTTP response headers (array of strings) */ public function putV5ReposOwnerRepoPullsNumberLabelsWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->putV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); try { @@ -8463,7 +8527,7 @@ public function putV5ReposOwnerRepoPullsNumberLabelsWithHttpInfo($owner, $repo, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Label', + '\Gitee\Model\Label[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8513,7 +8577,7 @@ function ($response) { */ public function putV5ReposOwnerRepoPullsNumberLabelsAsyncWithHttpInfo($owner, $repo, $number, $body, $accessToken = null) { - $returnType = '\Gitee\Model\Label'; + $returnType = '\Gitee\Model\Label[]'; $request = $this->putV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $number, $body, $accessToken); return $this->client @@ -8599,6 +8663,10 @@ protected function putV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $n $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -8625,10 +8693,6 @@ protected function putV5ReposOwnerRepoPullsNumberLabelsRequest($owner, $repo, $n ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } // body params $_tempBody = null; if (isset($body)) { diff --git a/src/Api/RepositoriesApi.php b/src/Api/RepositoriesApi.php index 390c512..5c7e726 100644 --- a/src/Api/RepositoriesApi.php +++ b/src/Api/RepositoriesApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -889,7 +889,7 @@ protected function deleteV5ReposOwnerRepoBranchesBranchProtectionRequest($owner, /** * Operation deleteV5ReposOwnerRepoBranchesWildcardSetting * - * 删除仓库保护分支策略 + * 删除保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -909,7 +909,7 @@ public function deleteV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wi /** * Operation deleteV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo * - * 删除仓库保护分支策略 + * 删除保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -987,7 +987,7 @@ public function deleteV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo($owner /** * Operation deleteV5ReposOwnerRepoBranchesWildcardSettingAsync * - * 删除仓库保护分支策略 + * 删除保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -1010,7 +1010,7 @@ function ($response) { /** * Operation deleteV5ReposOwnerRepoBranchesWildcardSettingAsyncWithHttpInfo * - * 删除仓库保护分支策略 + * 删除保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -2989,47 +2989,44 @@ protected function deleteV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $ } /** - * Operation getV5EnterprisesEnterpriseRepos + * Operation deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId * - * 获取企业的所有仓库 + * 删除仓库下指定 Release 的指定附件 * - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId releaseId (required) + * @param int $attachFileId attachFileId (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) - * @param bool $direct 只获取直属仓库,默认: false (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return void */ - public function getV5EnterprisesEnterpriseRepos($enterprise, $accessToken = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') + public function deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - list($response) = $this->getV5EnterprisesEnterpriseReposWithHttpInfo($enterprise, $accessToken, $type, $direct, $page, $perPage); - return $response; + $this->deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken); } /** - * Operation getV5EnterprisesEnterpriseReposWithHttpInfo + * Operation deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdWithHttpInfo * - * 获取企业的所有仓库 + * 删除仓库下指定 Release 的指定附件 * - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId (required) + * @param int $attachFileId (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) - * @param bool $direct 只获取直属仓库,默认: false (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getV5EnterprisesEnterpriseReposWithHttpInfo($enterprise, $accessToken = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') + public function deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5EnterprisesEnterpriseReposRequest($enterprise, $accessToken, $type, $direct, $page, $perPage); + $returnType = ''; + $request = $this->deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdRequest($owner, $repo, $releaseId, $attachFileId, $accessToken); try { $options = $this->createHttpClientOption(); @@ -3059,55 +3056,32 @@ public function getV5EnterprisesEnterpriseReposWithHttpInfo($enterprise, $access ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Gitee\Model\Project', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getV5EnterprisesEnterpriseReposAsync + * Operation deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsync * - * 获取企业的所有仓库 + * 删除仓库下指定 Release 的指定附件 * - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId (required) + * @param int $attachFileId (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) - * @param bool $direct 只获取直属仓库,默认: false (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5EnterprisesEnterpriseReposAsync($enterprise, $accessToken = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') + public function deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsync($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - return $this->getV5EnterprisesEnterpriseReposAsyncWithHttpInfo($enterprise, $accessToken, $type, $direct, $page, $perPage) + return $this->deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsyncWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken) ->then( function ($response) { return $response[0]; @@ -3116,44 +3090,29 @@ function ($response) { } /** - * Operation getV5EnterprisesEnterpriseReposAsyncWithHttpInfo + * Operation deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsyncWithHttpInfo * - * 获取企业的所有仓库 + * 删除仓库下指定 Release 的指定附件 * - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId (required) + * @param int $attachFileId (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) - * @param bool $direct 只获取直属仓库,默认: false (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5EnterprisesEnterpriseReposAsyncWithHttpInfo($enterprise, $accessToken = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') + public function deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsyncWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5EnterprisesEnterpriseReposRequest($enterprise, $accessToken, $type, $direct, $page, $perPage); + $returnType = ''; + $request = $this->deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdRequest($owner, $repo, $releaseId, $attachFileId, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -3173,28 +3132,45 @@ function ($exception) { } /** - * Create request for operation 'getV5EnterprisesEnterpriseRepos' + * Create request for operation 'deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' * - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId (required) + * @param int $attachFileId (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) - * @param bool $direct 只获取直属仓库,默认: false (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5EnterprisesEnterpriseReposRequest($enterprise, $accessToken = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') + protected function deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdRequest($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - // verify the required parameter 'enterprise' is set - if ($enterprise === null || (is_array($enterprise) && count($enterprise) === 0)) { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $enterprise when calling getV5EnterprisesEnterpriseRepos' + 'Missing the required parameter $owner when calling deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' + ); + } + // verify the required parameter 'releaseId' is set + if ($releaseId === null || (is_array($releaseId) && count($releaseId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $releaseId when calling deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' + ); + } + // verify the required parameter 'attachFileId' is set + if ($attachFileId === null || (is_array($attachFileId) && count($attachFileId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attachFileId when calling deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' ); } - $resourcePath = '/v5/enterprises/{enterprise}/repos'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3205,28 +3181,36 @@ protected function getV5EnterprisesEnterpriseReposRequest($enterprise, $accessTo if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // query params - if ($type !== null) { - $queryParams['type'] = ObjectSerializer::toQueryValue($type); - } - // query params - if ($direct !== null) { - $queryParams['direct'] = ObjectSerializer::toQueryValue($direct); + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); } - // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); } - // query params - if ($perPage !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + // path params + if ($releaseId !== null) { + $resourcePath = str_replace( + '{' . 'release_id' . '}', + ObjectSerializer::toPathValue($releaseId), + $resourcePath + ); } - // path params - if ($enterprise !== null) { + if ($attachFileId !== null) { $resourcePath = str_replace( - '{' . 'enterprise' . '}', - ObjectSerializer::toPathValue($enterprise), + '{' . 'attach_file_id' . '}', + ObjectSerializer::toPathValue($attachFileId), $resourcePath ); } @@ -3295,7 +3279,7 @@ protected function getV5EnterprisesEnterpriseReposRequest($enterprise, $accessTo $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3303,45 +3287,49 @@ protected function getV5EnterprisesEnterpriseReposRequest($enterprise, $accessTo } /** - * Operation getV5OrgsOrgRepos + * Operation getV5EnterprisesEnterpriseRepos * - * 获取一个组织的仓库 + * 获取企业的所有仓库 * - * @param string $org 组织的路径(path/login) (required) + * @param string $enterprise 企业的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param string $search 搜索字符串 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) + * @param bool $direct 只获取直属仓库,默认: false (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\Project[] */ - public function getV5OrgsOrgRepos($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') + public function getV5EnterprisesEnterpriseRepos($enterprise, $accessToken = null, $search = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') { - list($response) = $this->getV5OrgsOrgReposWithHttpInfo($org, $accessToken, $type, $page, $perPage); + list($response) = $this->getV5EnterprisesEnterpriseReposWithHttpInfo($enterprise, $accessToken, $search, $type, $direct, $page, $perPage); return $response; } /** - * Operation getV5OrgsOrgReposWithHttpInfo + * Operation getV5EnterprisesEnterpriseReposWithHttpInfo * - * 获取一个组织的仓库 + * 获取企业的所有仓库 * - * @param string $org 组织的路径(path/login) (required) + * @param string $enterprise 企业的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param string $search 搜索字符串 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) + * @param bool $direct 只获取直属仓库,默认: false (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Project[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5OrgsOrgReposWithHttpInfo($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') + public function getV5EnterprisesEnterpriseReposWithHttpInfo($enterprise, $accessToken = null, $search = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5OrgsOrgReposRequest($org, $accessToken, $type, $page, $perPage); + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5EnterprisesEnterpriseReposRequest($enterprise, $accessToken, $search, $type, $direct, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -3392,7 +3380,7 @@ public function getV5OrgsOrgReposWithHttpInfo($org, $accessToken = null, $type = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\Project[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3403,22 +3391,24 @@ public function getV5OrgsOrgReposWithHttpInfo($org, $accessToken = null, $type = } /** - * Operation getV5OrgsOrgReposAsync + * Operation getV5EnterprisesEnterpriseReposAsync * - * 获取一个组织的仓库 + * 获取企业的所有仓库 * - * @param string $org 组织的路径(path/login) (required) + * @param string $enterprise 企业的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param string $search 搜索字符串 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) + * @param bool $direct 只获取直属仓库,默认: false (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5OrgsOrgReposAsync($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') + public function getV5EnterprisesEnterpriseReposAsync($enterprise, $accessToken = null, $search = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') { - return $this->getV5OrgsOrgReposAsyncWithHttpInfo($org, $accessToken, $type, $page, $perPage) + return $this->getV5EnterprisesEnterpriseReposAsyncWithHttpInfo($enterprise, $accessToken, $search, $type, $direct, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -3427,23 +3417,25 @@ function ($response) { } /** - * Operation getV5OrgsOrgReposAsyncWithHttpInfo + * Operation getV5EnterprisesEnterpriseReposAsyncWithHttpInfo * - * 获取一个组织的仓库 + * 获取企业的所有仓库 * - * @param string $org 组织的路径(path/login) (required) + * @param string $enterprise 企业的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param string $search 搜索字符串 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) + * @param bool $direct 只获取直属仓库,默认: false (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5OrgsOrgReposAsyncWithHttpInfo($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') + public function getV5EnterprisesEnterpriseReposAsyncWithHttpInfo($enterprise, $accessToken = null, $search = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5OrgsOrgReposRequest($org, $accessToken, $type, $page, $perPage); + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5EnterprisesEnterpriseReposRequest($enterprise, $accessToken, $search, $type, $direct, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3483,27 +3475,36 @@ function ($exception) { } /** - * Create request for operation 'getV5OrgsOrgRepos' + * Create request for operation 'getV5EnterprisesEnterpriseRepos' * - * @param string $org 组织的路径(path/login) (required) + * @param string $enterprise 企业的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param string $search 搜索字符串 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, internal, private。默认: all (optional, default to all) + * @param bool $direct 只获取直属仓库,默认: false (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5OrgsOrgReposRequest($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') + protected function getV5EnterprisesEnterpriseReposRequest($enterprise, $accessToken = null, $search = null, $type = 'all', $direct = null, $page = '1', $perPage = '20') { - // verify the required parameter 'org' is set - if ($org === null || (is_array($org) && count($org) === 0)) { + // verify the required parameter 'enterprise' is set + if ($enterprise === null || (is_array($enterprise) && count($enterprise) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $org when calling getV5OrgsOrgRepos' + 'Missing the required parameter $enterprise when calling getV5EnterprisesEnterpriseRepos' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5EnterprisesEnterpriseRepos, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5EnterprisesEnterpriseRepos, must be bigger than or equal to 1.'); + } - $resourcePath = '/v5/orgs/{org}/repos'; + + $resourcePath = '/v5/enterprises/{enterprise}/repos'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3515,10 +3516,18 @@ protected function getV5OrgsOrgReposRequest($org, $accessToken = null, $type = ' $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params + if ($search !== null) { + $queryParams['search'] = ObjectSerializer::toQueryValue($search); + } + // query params if ($type !== null) { $queryParams['type'] = ObjectSerializer::toQueryValue($type); } // query params + if ($direct !== null) { + $queryParams['direct'] = ObjectSerializer::toQueryValue($direct); + } + // query params if ($page !== null) { $queryParams['page'] = ObjectSerializer::toQueryValue($page); } @@ -3528,10 +3537,10 @@ protected function getV5OrgsOrgReposRequest($org, $accessToken = null, $type = ' } // path params - if ($org !== null) { + if ($enterprise !== null) { $resourcePath = str_replace( - '{' . 'org' . '}', - ObjectSerializer::toPathValue($org), + '{' . 'enterprise' . '}', + ObjectSerializer::toPathValue($enterprise), $resourcePath ); } @@ -3608,41 +3617,45 @@ protected function getV5OrgsOrgReposRequest($org, $accessToken = null, $type = ' } /** - * Operation getV5ReposOwnerRepo + * Operation getV5OrgsOrgRepos * - * 获取用户的某个仓库 + * 获取一个组织的仓库 * - * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) + * @param string $org 组织的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\Project[] */ - public function getV5ReposOwnerRepo($owner, $repo, $accessToken = null) + public function getV5OrgsOrgRepos($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') { - list($response) = $this->getV5ReposOwnerRepoWithHttpInfo($owner, $repo, $accessToken); + list($response) = $this->getV5OrgsOrgReposWithHttpInfo($org, $accessToken, $type, $page, $perPage); return $response; } /** - * Operation getV5ReposOwnerRepoWithHttpInfo + * Operation getV5OrgsOrgReposWithHttpInfo * - * 获取用户的某个仓库 + * 获取一个组织的仓库 * - * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) + * @param string $org 组织的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Project[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5OrgsOrgReposWithHttpInfo($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5ReposOwnerRepoRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5OrgsOrgReposRequest($org, $accessToken, $type, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -3693,7 +3706,7 @@ public function getV5ReposOwnerRepoWithHttpInfo($owner, $repo, $accessToken = nu case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\Project[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3704,20 +3717,22 @@ public function getV5ReposOwnerRepoWithHttpInfo($owner, $repo, $accessToken = nu } /** - * Operation getV5ReposOwnerRepoAsync + * Operation getV5OrgsOrgReposAsync * - * 获取用户的某个仓库 + * 获取一个组织的仓库 * - * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) + * @param string $org 组织的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoAsync($owner, $repo, $accessToken = null) + public function getV5OrgsOrgReposAsync($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') { - return $this->getV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->getV5OrgsOrgReposAsyncWithHttpInfo($org, $accessToken, $type, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -3726,21 +3741,23 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoAsyncWithHttpInfo + * Operation getV5OrgsOrgReposAsyncWithHttpInfo * - * 获取用户的某个仓库 + * 获取一个组织的仓库 * - * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) + * @param string $org 组织的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5OrgsOrgReposAsyncWithHttpInfo($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5ReposOwnerRepoRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5OrgsOrgReposRequest($org, $accessToken, $type, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3780,31 +3797,34 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepo' + * Create request for operation 'getV5OrgsOrgRepos' * - * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) + * @param string $org 组织的路径(path/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $type 筛选仓库的类型,可以是 all, public, private。默认: all (optional, default to all) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoRequest($owner, $repo, $accessToken = null) + protected function getV5OrgsOrgReposRequest($org, $accessToken = null, $type = 'all', $page = '1', $perPage = '20') { - // verify the required parameter 'owner' is set - if ($owner === null || (is_array($owner) && count($owner) === 0)) { + // verify the required parameter 'org' is set + if ($org === null || (is_array($org) && count($org) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepo' + 'Missing the required parameter $org when calling getV5OrgsOrgRepos' ); } - // verify the required parameter 'repo' is set - if ($repo === null || (is_array($repo) && count($repo) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepo' - ); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5OrgsOrgRepos, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5OrgsOrgRepos, must be bigger than or equal to 1.'); } - $resourcePath = '/v5/repos/{owner}/{repo}'; + + $resourcePath = '/v5/orgs/{org}/repos'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3815,20 +3835,24 @@ protected function getV5ReposOwnerRepoRequest($owner, $repo, $accessToken = null if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - - // path params - if ($owner !== null) { - $resourcePath = str_replace( - '{' . 'owner' . '}', - ObjectSerializer::toPathValue($owner), - $resourcePath - ); + // query params + if ($type !== null) { + $queryParams['type'] = ObjectSerializer::toQueryValue($type); + } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); } + // path params - if ($repo !== null) { + if ($org !== null) { $resourcePath = str_replace( - '{' . 'repo' . '}', - ObjectSerializer::toPathValue($repo), + '{' . 'org' . '}', + ObjectSerializer::toPathValue($org), $resourcePath ); } @@ -3905,9 +3929,9 @@ protected function getV5ReposOwnerRepoRequest($owner, $repo, $accessToken = null } /** - * Operation getV5ReposOwnerRepoBaiduStatisticKey + * Operation getV5ReposOwnerRepo * - * 获取仓库的百度统计 key + * 获取用户的某个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -3915,17 +3939,18 @@ protected function getV5ReposOwnerRepoRequest($owner, $repo, $accessToken = null * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Gitee\Model\Project */ - public function getV5ReposOwnerRepoBaiduStatisticKey($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepo($owner, $repo, $accessToken = null) { - $this->getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken); + list($response) = $this->getV5ReposOwnerRepoWithHttpInfo($owner, $repo, $accessToken); + return $response; } /** - * Operation getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo + * Operation getV5ReposOwnerRepoWithHttpInfo * - * 获取仓库的百度统计 key + * 获取用户的某个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -3933,12 +3958,12 @@ public function getV5ReposOwnerRepoBaiduStatisticKey($owner, $repo, $accessToken * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = ''; - $request = $this->getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Project'; + $request = $this->getV5ReposOwnerRepoRequest($owner, $repo, $accessToken); try { $options = $this->createHttpClientOption(); @@ -3968,19 +3993,41 @@ public function getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Project', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation getV5ReposOwnerRepoBaiduStatisticKeyAsync + * Operation getV5ReposOwnerRepoAsync * - * 获取仓库的百度统计 key + * 获取用户的某个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -3989,9 +4036,9 @@ public function getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoBaiduStatisticKeyAsync($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoAsync($owner, $repo, $accessToken = null) { - return $this->getV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->getV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $accessToken) ->then( function ($response) { return $response[0]; @@ -4000,9 +4047,9 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoAsyncWithHttpInfo * - * 获取仓库的百度统计 key + * 获取用户的某个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -4011,16 +4058,30 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = ''; - $request = $this->getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Project'; + $request = $this->getV5ReposOwnerRepoRequest($owner, $repo, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -4040,7 +4101,7 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoBaiduStatisticKey' + * Create request for operation 'getV5ReposOwnerRepo' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -4049,22 +4110,22 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken = null) + protected function getV5ReposOwnerRepoRequest($owner, $repo, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoBaiduStatisticKey' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepo' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoBaiduStatisticKey' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepo' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/baidu_statistic_key'; + $resourcePath = '/v5/repos/{owner}/{repo}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4165,9 +4226,9 @@ protected function getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $a } /** - * Operation getV5ReposOwnerRepoBranches + * Operation getV5ReposOwnerRepoBaiduStatisticKey * - * 获取所有分支 + * 获取仓库的百度统计 key * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -4175,18 +4236,17 @@ protected function getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $a * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Branch[] + * @return void */ - public function getV5ReposOwnerRepoBranches($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoBaiduStatisticKey($owner, $repo, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $accessToken); - return $response; + $this->getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken); } /** - * Operation getV5ReposOwnerRepoBranchesWithHttpInfo + * Operation getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo * - * 获取所有分支 + * 获取仓库的百度统计 key * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -4194,12 +4254,12 @@ public function getV5ReposOwnerRepoBranches($owner, $repo, $accessToken = null) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Branch[], HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Branch[]'; - $request = $this->getV5ReposOwnerRepoBranchesRequest($owner, $repo, $accessToken); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken); try { $options = $this->createHttpClientOption(); @@ -4229,41 +4289,19 @@ public function getV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $accessTo ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Gitee\Model\Branch[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getV5ReposOwnerRepoBranchesAsync + * Operation getV5ReposOwnerRepoBaiduStatisticKeyAsync * - * 获取所有分支 + * 获取仓库的百度统计 key * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -4272,9 +4310,9 @@ public function getV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $accessTo * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoBranchesAsync($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoBaiduStatisticKeyAsync($owner, $repo, $accessToken = null) { - return $this->getV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->getV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken) ->then( function ($response) { return $response[0]; @@ -4283,9 +4321,9 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoBranchesAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo * - * 获取所有分支 + * 获取仓库的百度统计 key * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -4294,30 +4332,16 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Branch[]'; - $request = $this->getV5ReposOwnerRepoBranchesRequest($owner, $repo, $accessToken); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -4337,7 +4361,7 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoBranches' + * Create request for operation 'getV5ReposOwnerRepoBaiduStatisticKey' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -4346,22 +4370,22 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoBranchesRequest($owner, $repo, $accessToken = null) + protected function getV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoBranches' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoBaiduStatisticKey' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoBranches' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoBaiduStatisticKey' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/branches'; + $resourcePath = '/v5/repos/{owner}/{repo}/baidu_statistic_key'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4462,43 +4486,45 @@ protected function getV5ReposOwnerRepoBranchesRequest($owner, $repo, $accessToke } /** - * Operation getV5ReposOwnerRepoBranchesBranch + * Operation getV5ReposOwnerRepoBlamePath * - * 获取单个分支 + * Blame * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $branch 分支名称 (required) + * @param string $path 文件的路径(1 MB 以内的文件文件) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\CompleteBranch + * @return \Gitee\Model\Blame[] */ - public function getV5ReposOwnerRepoBranchesBranch($owner, $repo, $branch, $accessToken = null) + public function getV5ReposOwnerRepoBlamePath($owner, $repo, $path, $accessToken = null, $ref = null) { - list($response) = $this->getV5ReposOwnerRepoBranchesBranchWithHttpInfo($owner, $repo, $branch, $accessToken); + list($response) = $this->getV5ReposOwnerRepoBlamePathWithHttpInfo($owner, $repo, $path, $accessToken, $ref); return $response; } /** - * Operation getV5ReposOwnerRepoBranchesBranchWithHttpInfo + * Operation getV5ReposOwnerRepoBlamePathWithHttpInfo * - * 获取单个分支 + * Blame * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $branch 分支名称 (required) + * @param string $path 文件的路径(1 MB 以内的文件文件) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\CompleteBranch, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Blame[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoBranchesBranchWithHttpInfo($owner, $repo, $branch, $accessToken = null) + public function getV5ReposOwnerRepoBlamePathWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\CompleteBranch'; - $request = $this->getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $branch, $accessToken); + $returnType = '\Gitee\Model\Blame[]'; + $request = $this->getV5ReposOwnerRepoBlamePathRequest($owner, $repo, $path, $accessToken, $ref); try { $options = $this->createHttpClientOption(); @@ -4549,7 +4575,7 @@ public function getV5ReposOwnerRepoBranchesBranchWithHttpInfo($owner, $repo, $br case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\CompleteBranch', + '\Gitee\Model\Blame[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4560,21 +4586,22 @@ public function getV5ReposOwnerRepoBranchesBranchWithHttpInfo($owner, $repo, $br } /** - * Operation getV5ReposOwnerRepoBranchesBranchAsync + * Operation getV5ReposOwnerRepoBlamePathAsync * - * 获取单个分支 + * Blame * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $branch 分支名称 (required) + * @param string $path 文件的路径(1 MB 以内的文件文件) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoBranchesBranchAsync($owner, $repo, $branch, $accessToken = null) + public function getV5ReposOwnerRepoBlamePathAsync($owner, $repo, $path, $accessToken = null, $ref = null) { - return $this->getV5ReposOwnerRepoBranchesBranchAsyncWithHttpInfo($owner, $repo, $branch, $accessToken) + return $this->getV5ReposOwnerRepoBlamePathAsyncWithHttpInfo($owner, $repo, $path, $accessToken, $ref) ->then( function ($response) { return $response[0]; @@ -4583,22 +4610,23 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoBranchesBranchAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoBlamePathAsyncWithHttpInfo * - * 获取单个分支 + * Blame * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $branch 分支名称 (required) + * @param string $path 文件的路径(1 MB 以内的文件文件) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoBranchesBranchAsyncWithHttpInfo($owner, $repo, $branch, $accessToken = null) + public function getV5ReposOwnerRepoBlamePathAsyncWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\CompleteBranch'; - $request = $this->getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $branch, $accessToken); + $returnType = '\Gitee\Model\Blame[]'; + $request = $this->getV5ReposOwnerRepoBlamePathRequest($owner, $repo, $path, $accessToken, $ref); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4638,38 +4666,39 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoBranchesBranch' + * Create request for operation 'getV5ReposOwnerRepoBlamePath' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $branch 分支名称 (required) + * @param string $path 文件的路径(1 MB 以内的文件文件) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $branch, $accessToken = null) + protected function getV5ReposOwnerRepoBlamePathRequest($owner, $repo, $path, $accessToken = null, $ref = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoBranchesBranch' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoBlamePath' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoBranchesBranch' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoBlamePath' ); } - // verify the required parameter 'branch' is set - if ($branch === null || (is_array($branch) && count($branch) === 0)) { + // verify the required parameter 'path' is set + if ($path === null || (is_array($path) && count($path) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $branch when calling getV5ReposOwnerRepoBranchesBranch' + 'Missing the required parameter $path when calling getV5ReposOwnerRepoBlamePath' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/branches/{branch}'; + $resourcePath = '/v5/repos/{owner}/{repo}/blame/{path}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4680,6 +4709,10 @@ protected function getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $bran if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($ref !== null) { + $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); + } // path params if ($owner !== null) { @@ -4698,10 +4731,10 @@ protected function getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $bran ); } // path params - if ($branch !== null) { + if ($path !== null) { $resourcePath = str_replace( - '{' . 'branch' . '}', - ObjectSerializer::toPathValue($branch), + '{' . 'path' . '}', + ObjectSerializer::toPathValue($path), $resourcePath ); } @@ -4778,45 +4811,49 @@ protected function getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $bran } /** - * Operation getV5ReposOwnerRepoCollaborators + * Operation getV5ReposOwnerRepoBranches * - * 获取仓库的所有成员 + * 获取所有分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\ProjectMember + * @return \Gitee\Model\Branch[] */ - public function getV5ReposOwnerRepoCollaborators($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoBranches($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - list($response) = $this->getV5ReposOwnerRepoCollaboratorsWithHttpInfo($owner, $repo, $accessToken, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); return $response; } /** - * Operation getV5ReposOwnerRepoCollaboratorsWithHttpInfo + * Operation getV5ReposOwnerRepoBranchesWithHttpInfo * - * 获取仓库的所有成员 + * 获取所有分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\ProjectMember, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Branch[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCollaboratorsWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - $returnType = '\Gitee\Model\ProjectMember'; - $request = $this->getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $accessToken, $page, $perPage); + $returnType = '\Gitee\Model\Branch[]'; + $request = $this->getV5ReposOwnerRepoBranchesRequest($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -4867,7 +4904,7 @@ public function getV5ReposOwnerRepoCollaboratorsWithHttpInfo($owner, $repo, $acc case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\ProjectMember', + '\Gitee\Model\Branch[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4878,22 +4915,24 @@ public function getV5ReposOwnerRepoCollaboratorsWithHttpInfo($owner, $repo, $acc } /** - * Operation getV5ReposOwnerRepoCollaboratorsAsync + * Operation getV5ReposOwnerRepoBranchesAsync * - * 获取仓库的所有成员 + * 获取所有分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCollaboratorsAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoBranchesAsync($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - return $this->getV5ReposOwnerRepoCollaboratorsAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage) + return $this->getV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $accessToken, $sort, $direction, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -4902,23 +4941,25 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCollaboratorsAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoBranchesAsyncWithHttpInfo * - * 获取仓库的所有成员 + * 获取所有分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCollaboratorsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - $returnType = '\Gitee\Model\ProjectMember'; - $request = $this->getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $accessToken, $page, $perPage); + $returnType = '\Gitee\Model\Branch[]'; + $request = $this->getV5ReposOwnerRepoBranchesRequest($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4958,33 +4999,42 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCollaborators' + * Create request for operation 'getV5ReposOwnerRepoBranches' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoBranchesRequest($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCollaborators' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoBranches' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCollaborators' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoBranches' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoBranches, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoBranches, must be bigger than or equal to 1.'); + } - $resourcePath = '/v5/repos/{owner}/{repo}/collaborators'; + + $resourcePath = '/v5/repos/{owner}/{repo}/branches'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4996,6 +5046,14 @@ protected function getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $acces $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params + if ($sort !== null) { + $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); + } + // query params + if ($direction !== null) { + $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); + } + // query params if ($page !== null) { $queryParams['page'] = ObjectSerializer::toQueryValue($page); } @@ -5093,42 +5151,43 @@ protected function getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $acces } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsername + * Operation getV5ReposOwnerRepoBranchesBranch * - * 判断用户是否为仓库成员 + * 获取单个分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) + * @param string $branch 分支名称 (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Gitee\Model\CompleteBranch */ - public function getV5ReposOwnerRepoCollaboratorsUsername($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoBranchesBranch($owner, $repo, $branch, $accessToken = null) { - $this->getV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo($owner, $repo, $username, $accessToken); + list($response) = $this->getV5ReposOwnerRepoBranchesBranchWithHttpInfo($owner, $repo, $branch, $accessToken); + return $response; } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo + * Operation getV5ReposOwnerRepoBranchesBranchWithHttpInfo * - * 判断用户是否为仓库成员 + * 获取单个分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) + * @param string $branch 分支名称 (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\CompleteBranch, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoBranchesBranchWithHttpInfo($owner, $repo, $branch, $accessToken = null) { - $returnType = ''; - $request = $this->getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo, $username, $accessToken); + $returnType = '\Gitee\Model\CompleteBranch'; + $request = $this->getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $branch, $accessToken); try { $options = $this->createHttpClientOption(); @@ -5158,31 +5217,53 @@ public function getV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo($owner, $re ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\CompleteBranch', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsernameAsync + * Operation getV5ReposOwnerRepoBranchesBranchAsync * - * 判断用户是否为仓库成员 + * 获取单个分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) + * @param string $branch 分支名称 (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCollaboratorsUsernameAsync($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoBranchesBranchAsync($owner, $repo, $branch, $accessToken = null) { - return $this->getV5ReposOwnerRepoCollaboratorsUsernameAsyncWithHttpInfo($owner, $repo, $username, $accessToken) + return $this->getV5ReposOwnerRepoBranchesBranchAsyncWithHttpInfo($owner, $repo, $branch, $accessToken) ->then( function ($response) { return $response[0]; @@ -5191,28 +5272,42 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsernameAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoBranchesBranchAsyncWithHttpInfo * - * 判断用户是否为仓库成员 + * 获取单个分支 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) + * @param string $branch 分支名称 (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCollaboratorsUsernameAsyncWithHttpInfo($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoBranchesBranchAsyncWithHttpInfo($owner, $repo, $branch, $accessToken = null) { - $returnType = ''; - $request = $this->getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo, $username, $accessToken); + $returnType = '\Gitee\Model\CompleteBranch'; + $request = $this->getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $branch, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -5232,38 +5327,38 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCollaboratorsUsername' + * Create request for operation 'getV5ReposOwnerRepoBranchesBranch' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) + * @param string $branch 分支名称 (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo, $username, $accessToken = null) + protected function getV5ReposOwnerRepoBranchesBranchRequest($owner, $repo, $branch, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCollaboratorsUsername' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoBranchesBranch' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCollaboratorsUsername' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoBranchesBranch' ); } - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { + // verify the required parameter 'branch' is set + if ($branch === null || (is_array($branch) && count($branch) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling getV5ReposOwnerRepoCollaboratorsUsername' + 'Missing the required parameter $branch when calling getV5ReposOwnerRepoBranchesBranch' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/collaborators/{username}'; + $resourcePath = '/v5/repos/{owner}/{repo}/branches/{branch}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5292,10 +5387,10 @@ protected function getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo ); } // path params - if ($username !== null) { + if ($branch !== null) { $resourcePath = str_replace( - '{' . 'username' . '}', - ObjectSerializer::toPathValue($username), + '{' . 'branch' . '}', + ObjectSerializer::toPathValue($branch), $resourcePath ); } @@ -5372,43 +5467,45 @@ protected function getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermission + * Operation getV5ReposOwnerRepoCollaborators * - * 查看仓库成员的权限 + * 获取仓库的所有成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\ProjectMemberPermission + * @return \Gitee\Model\ProjectMember[] */ - public function getV5ReposOwnerRepoCollaboratorsUsernamePermission($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoCollaborators($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - list($response) = $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo($owner, $repo, $username, $accessToken); + list($response) = $this->getV5ReposOwnerRepoCollaboratorsWithHttpInfo($owner, $repo, $accessToken, $page, $perPage); return $response; } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo + * Operation getV5ReposOwnerRepoCollaboratorsWithHttpInfo * - * 查看仓库成员的权限 + * 获取仓库的所有成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\ProjectMemberPermission, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\ProjectMember[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoCollaboratorsWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\ProjectMemberPermission'; - $request = $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($owner, $repo, $username, $accessToken); + $returnType = '\Gitee\Model\ProjectMember[]'; + $request = $this->getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $accessToken, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -5459,7 +5556,7 @@ public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo($ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\ProjectMemberPermission', + '\Gitee\Model\ProjectMember[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5470,21 +5567,22 @@ public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo($ } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsync + * Operation getV5ReposOwnerRepoCollaboratorsAsync * - * 查看仓库成员的权限 + * 获取仓库的所有成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsync($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoCollaboratorsAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - return $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsyncWithHttpInfo($owner, $repo, $username, $accessToken) + return $this->getV5ReposOwnerRepoCollaboratorsAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -5493,22 +5591,23 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCollaboratorsAsyncWithHttpInfo * - * 查看仓库成员的权限 + * 获取仓库的所有成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsyncWithHttpInfo($owner, $repo, $username, $accessToken = null) + public function getV5ReposOwnerRepoCollaboratorsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\ProjectMemberPermission'; - $request = $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($owner, $repo, $username, $accessToken); + $returnType = '\Gitee\Model\ProjectMember[]'; + $request = $this->getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $accessToken, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5548,38 +5647,40 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCollaboratorsUsernamePermission' + * Create request for operation 'getV5ReposOwnerRepoCollaborators' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($owner, $repo, $username, $accessToken = null) + protected function getV5ReposOwnerRepoCollaboratorsRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCollaboratorsUsernamePermission' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCollaborators' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCollaboratorsUsernamePermission' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCollaborators' ); } - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling getV5ReposOwnerRepoCollaboratorsUsernamePermission' - ); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoCollaborators, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoCollaborators, must be bigger than or equal to 1.'); } - $resourcePath = '/v5/repos/{owner}/{repo}/collaborators/{username}/permission'; + + $resourcePath = '/v5/repos/{owner}/{repo}/collaborators'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5590,6 +5691,14 @@ protected function getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($ow if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } // path params if ($owner !== null) { @@ -5607,14 +5716,6 @@ protected function getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($ow $resourcePath ); } - // path params - if ($username !== null) { - $resourcePath = str_replace( - '{' . 'username' . '}', - ObjectSerializer::toPathValue($username), - $resourcePath - ); - } // body params $_tempBody = null; @@ -5688,47 +5789,42 @@ protected function getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($ow } /** - * Operation getV5ReposOwnerRepoComments + * Operation getV5ReposOwnerRepoCollaboratorsUsername * - * 获取仓库的Commit评论 + * 判断用户是否为仓库成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Note + * @return void */ - public function getV5ReposOwnerRepoComments($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') + public function getV5ReposOwnerRepoCollaboratorsUsername($owner, $repo, $username, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoCommentsWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $order); - return $response; + $this->getV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo($owner, $repo, $username, $accessToken); } /** - * Operation getV5ReposOwnerRepoCommentsWithHttpInfo + * Operation getV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo * - * 获取仓库的Commit评论 + * 判断用户是否为仓库成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCommentsWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') + public function getV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo($owner, $repo, $username, $accessToken = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToken, $page, $perPage, $order); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo, $username, $accessToken); try { $options = $this->createHttpClientOption(); @@ -5758,55 +5854,31 @@ public function getV5ReposOwnerRepoCommentsWithHttpInfo($owner, $repo, $accessTo ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Gitee\Model\Note', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getV5ReposOwnerRepoCommentsAsync + * Operation getV5ReposOwnerRepoCollaboratorsUsernameAsync * - * 获取仓库的Commit评论 + * 判断用户是否为仓库成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommentsAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') + public function getV5ReposOwnerRepoCollaboratorsUsernameAsync($owner, $repo, $username, $accessToken = null) { - return $this->getV5ReposOwnerRepoCommentsAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $order) + return $this->getV5ReposOwnerRepoCollaboratorsUsernameAsyncWithHttpInfo($owner, $repo, $username, $accessToken) ->then( function ($response) { return $response[0]; @@ -5815,44 +5887,28 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCommentsAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCollaboratorsUsernameAsyncWithHttpInfo * - * 获取仓库的Commit评论 + * 判断用户是否为仓库成员 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommentsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') + public function getV5ReposOwnerRepoCollaboratorsUsernameAsyncWithHttpInfo($owner, $repo, $username, $accessToken = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToken, $page, $perPage, $order); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo, $username, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -5872,34 +5928,38 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoComments' + * Create request for operation 'getV5ReposOwnerRepoCollaboratorsUsername' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') + protected function getV5ReposOwnerRepoCollaboratorsUsernameRequest($owner, $repo, $username, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoComments' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCollaboratorsUsername' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoComments' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCollaboratorsUsername' + ); + } + // verify the required parameter 'username' is set + if ($username === null || (is_array($username) && count($username) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $username when calling getV5ReposOwnerRepoCollaboratorsUsername' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/comments'; + $resourcePath = '/v5/repos/{owner}/{repo}/collaborators/{username}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5910,18 +5970,6 @@ protected function getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToke if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); - } - // query params - if ($perPage !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); - } - // query params - if ($order !== null) { - $queryParams['order'] = ObjectSerializer::toQueryValue($order); - } // path params if ($owner !== null) { @@ -5939,6 +5987,14 @@ protected function getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToke $resourcePath ); } + // path params + if ($username !== null) { + $resourcePath = str_replace( + '{' . 'username' . '}', + ObjectSerializer::toPathValue($username), + $resourcePath + ); + } // body params $_tempBody = null; @@ -6012,43 +6068,43 @@ protected function getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToke } /** - * Operation getV5ReposOwnerRepoCommentsId + * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermission * - * 获取仓库的某条Commit评论 + * 查看仓库成员的权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Note + * @return \Gitee\Model\ProjectMemberPermission */ - public function getV5ReposOwnerRepoCommentsId($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoCollaboratorsUsernamePermission($owner, $repo, $username, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $accessToken); + list($response) = $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo($owner, $repo, $username, $accessToken); return $response; } /** - * Operation getV5ReposOwnerRepoCommentsIdWithHttpInfo + * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo * - * 获取仓库的某条Commit评论 + * 查看仓库成员的权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\ProjectMemberPermission, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionWithHttpInfo($owner, $repo, $username, $accessToken = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $accessToken); + $returnType = '\Gitee\Model\ProjectMemberPermission'; + $request = $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($owner, $repo, $username, $accessToken); try { $options = $this->createHttpClientOption(); @@ -6099,7 +6155,7 @@ public function getV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $a case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Note', + '\Gitee\Model\ProjectMemberPermission', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6110,21 +6166,21 @@ public function getV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $a } /** - * Operation getV5ReposOwnerRepoCommentsIdAsync + * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsync * - * 获取仓库的某条Commit评论 + * 查看仓库成员的权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommentsIdAsync($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsync($owner, $repo, $username, $accessToken = null) { - return $this->getV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken) + return $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsyncWithHttpInfo($owner, $repo, $username, $accessToken) ->then( function ($response) { return $response[0]; @@ -6133,22 +6189,22 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsyncWithHttpInfo * - * 获取仓库的某条Commit评论 + * 查看仓库成员的权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoCollaboratorsUsernamePermissionAsyncWithHttpInfo($owner, $repo, $username, $accessToken = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $accessToken); + $returnType = '\Gitee\Model\ProjectMemberPermission'; + $request = $this->getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($owner, $repo, $username, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6188,38 +6244,38 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCommentsId' + * Create request for operation 'getV5ReposOwnerRepoCollaboratorsUsernamePermission' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) + * @param string $username 用户名(username/login) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $accessToken = null) + protected function getV5ReposOwnerRepoCollaboratorsUsernamePermissionRequest($owner, $repo, $username, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommentsId' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCollaboratorsUsernamePermission' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommentsId' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCollaboratorsUsernamePermission' ); } - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'username' is set + if ($username === null || (is_array($username) && count($username) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getV5ReposOwnerRepoCommentsId' + 'Missing the required parameter $username when calling getV5ReposOwnerRepoCollaboratorsUsernamePermission' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/comments/{id}'; + $resourcePath = '/v5/repos/{owner}/{repo}/collaborators/{username}/permission'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6248,10 +6304,10 @@ protected function getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $acc ); } // path params - if ($id !== null) { + if ($username !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'username' . '}', + ObjectSerializer::toPathValue($username), $resourcePath ); } @@ -6328,55 +6384,47 @@ protected function getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $acc } /** - * Operation getV5ReposOwnerRepoCommits + * Operation getV5ReposOwnerRepoComments * - * 仓库的所有提交 + * 获取仓库的 Commit 评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) - * @param string $path 包含该文件的提交 (optional) - * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) - * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) - * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\RepoCommit[] + * @return \Gitee\Model\Note[] */ - public function getV5ReposOwnerRepoCommits($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoComments($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') { - list($response) = $this->getV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoCommentsWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $order); return $response; } /** - * Operation getV5ReposOwnerRepoCommitsWithHttpInfo + * Operation getV5ReposOwnerRepoCommentsWithHttpInfo * - * 仓库的所有提交 + * 获取仓库的 Commit 评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) - * @param string $path 包含该文件的提交 (optional) - * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) - * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) - * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\RepoCommit[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Note[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoCommentsWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') { - $returnType = '\Gitee\Model\RepoCommit[]'; - $request = $this->getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage); + $returnType = '\Gitee\Model\Note[]'; + $request = $this->getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToken, $page, $perPage, $order); try { $options = $this->createHttpClientOption(); @@ -6427,7 +6475,7 @@ public function getV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $accessTok case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\RepoCommit[]', + '\Gitee\Model\Note[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6438,27 +6486,23 @@ public function getV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $accessTok } /** - * Operation getV5ReposOwnerRepoCommitsAsync + * Operation getV5ReposOwnerRepoCommentsAsync * - * 仓库的所有提交 + * 获取仓库的 Commit 评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) - * @param string $path 包含该文件的提交 (optional) - * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) - * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) - * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommitsAsync($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoCommentsAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') { - return $this->getV5ReposOwnerRepoCommitsAsyncWithHttpInfo($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage) + return $this->getV5ReposOwnerRepoCommentsAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $order) ->then( function ($response) { return $response[0]; @@ -6467,28 +6511,24 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCommitsAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCommentsAsyncWithHttpInfo * - * 仓库的所有提交 + * 获取仓库的 Commit 评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) - * @param string $path 包含该文件的提交 (optional) - * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) - * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) - * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommitsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoCommentsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') { - $returnType = '\Gitee\Model\RepoCommit[]'; - $request = $this->getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage); + $returnType = '\Gitee\Model\Note[]'; + $request = $this->getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToken, $page, $perPage, $order); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6528,38 +6568,41 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCommits' + * Create request for operation 'getV5ReposOwnerRepoComments' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) - * @param string $path 包含该文件的提交 (optional) - * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) - * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) - * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $order 排序顺序: asc(default),desc (optional, default to asc) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoCommentsRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $order = 'asc') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommits' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoComments' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommits' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoComments' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoComments, must be bigger than or equal to 1.'); + } - $resourcePath = '/v5/repos/{owner}/{repo}/commits'; + + $resourcePath = '/v5/repos/{owner}/{repo}/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6571,26 +6614,6 @@ protected function getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params - if ($sha !== null) { - $queryParams['sha'] = ObjectSerializer::toQueryValue($sha); - } - // query params - if ($path !== null) { - $queryParams['path'] = ObjectSerializer::toQueryValue($path); - } - // query params - if ($author !== null) { - $queryParams['author'] = ObjectSerializer::toQueryValue($author); - } - // query params - if ($since !== null) { - $queryParams['since'] = ObjectSerializer::toQueryValue($since); - } - // query params - if ($until !== null) { - $queryParams['until'] = ObjectSerializer::toQueryValue($until); - } - // query params if ($page !== null) { $queryParams['page'] = ObjectSerializer::toQueryValue($page); } @@ -6598,6 +6621,10 @@ protected function getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken if ($perPage !== null) { $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); } + // query params + if ($order !== null) { + $queryParams['order'] = ObjectSerializer::toQueryValue($order); + } // path params if ($owner !== null) { @@ -6688,47 +6715,43 @@ protected function getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken } /** - * Operation getV5ReposOwnerRepoCommitsRefComments + * Operation getV5ReposOwnerRepoCommentsId * - * 获取单个Commit的评论 + * 获取仓库的某条Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $ref Commit的Reference (required) + * @param int $id 评论的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Gitee\Model\Note */ - public function getV5ReposOwnerRepoCommitsRefComments($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoCommentsId($owner, $repo, $id, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoCommitsRefCommentsWithHttpInfo($owner, $repo, $ref, $accessToken, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $accessToken); return $response; } /** - * Operation getV5ReposOwnerRepoCommitsRefCommentsWithHttpInfo + * Operation getV5ReposOwnerRepoCommentsIdWithHttpInfo * - * 获取单个Commit的评论 + * 获取仓库的某条Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $ref Commit的Reference (required) + * @param int $id 评论的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCommitsRefCommentsWithHttpInfo($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $accessToken = null) { $returnType = '\Gitee\Model\Note'; - $request = $this->getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ref, $accessToken, $page, $perPage); + $request = $this->getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $accessToken); try { $options = $this->createHttpClientOption(); @@ -6790,23 +6813,21 @@ public function getV5ReposOwnerRepoCommitsRefCommentsWithHttpInfo($owner, $repo, } /** - * Operation getV5ReposOwnerRepoCommitsRefCommentsAsync + * Operation getV5ReposOwnerRepoCommentsIdAsync * - * 获取单个Commit的评论 + * 获取仓库的某条Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $ref Commit的Reference (required) + * @param int $id 评论的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommitsRefCommentsAsync($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoCommentsIdAsync($owner, $repo, $id, $accessToken = null) { - return $this->getV5ReposOwnerRepoCommitsRefCommentsAsyncWithHttpInfo($owner, $repo, $ref, $accessToken, $page, $perPage) + return $this->getV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken) ->then( function ($response) { return $response[0]; @@ -6815,24 +6836,22 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCommitsRefCommentsAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo * - * 获取单个Commit的评论 + * 获取仓库的某条Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $ref Commit的Reference (required) + * @param int $id 评论的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommitsRefCommentsAsyncWithHttpInfo($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken = null) { $returnType = '\Gitee\Model\Note'; - $request = $this->getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ref, $accessToken, $page, $perPage); + $request = $this->getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6872,40 +6891,38 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCommitsRefComments' + * Create request for operation 'getV5ReposOwnerRepoCommentsId' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $ref Commit的Reference (required) + * @param int $id 评论的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommitsRefComments' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommentsId' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommitsRefComments' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommentsId' ); } - // verify the required parameter 'ref' is set - if ($ref === null || (is_array($ref) && count($ref) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $ref when calling getV5ReposOwnerRepoCommitsRefComments' + 'Missing the required parameter $id when calling getV5ReposOwnerRepoCommentsId' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/commits/{ref}/comments'; + $resourcePath = '/v5/repos/{owner}/{repo}/comments/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6916,14 +6933,6 @@ protected function getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); - } - // query params - if ($perPage !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); - } // path params if ($owner !== null) { @@ -6942,10 +6951,10 @@ protected function getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ ); } // path params - if ($ref !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'ref' . '}', - ObjectSerializer::toPathValue($ref), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -7022,43 +7031,55 @@ protected function getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ } /** - * Operation getV5ReposOwnerRepoCommitsSha + * Operation getV5ReposOwnerRepoCommits * - * 仓库的某个提交 + * 仓库的所有提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) + * @param string $path 包含该文件的提交 (optional) + * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) + * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) + * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\RepoCommitWithFiles + * @return \Gitee\Model\RepoCommit[] */ - public function getV5ReposOwnerRepoCommitsSha($owner, $repo, $sha, $accessToken = null) + public function getV5ReposOwnerRepoCommits($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') { - list($response) = $this->getV5ReposOwnerRepoCommitsShaWithHttpInfo($owner, $repo, $sha, $accessToken); + list($response) = $this->getV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage); return $response; } /** - * Operation getV5ReposOwnerRepoCommitsShaWithHttpInfo + * Operation getV5ReposOwnerRepoCommitsWithHttpInfo * - * 仓库的某个提交 + * 仓库的所有提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) + * @param string $path 包含该文件的提交 (optional) + * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) + * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) + * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\RepoCommitWithFiles, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\RepoCommit[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCommitsShaWithHttpInfo($owner, $repo, $sha, $accessToken = null) + public function getV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\RepoCommitWithFiles'; - $request = $this->getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $accessToken); + $returnType = '\Gitee\Model\RepoCommit[]'; + $request = $this->getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -7109,7 +7130,7 @@ public function getV5ReposOwnerRepoCommitsShaWithHttpInfo($owner, $repo, $sha, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\RepoCommitWithFiles', + '\Gitee\Model\RepoCommit[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7120,21 +7141,27 @@ public function getV5ReposOwnerRepoCommitsShaWithHttpInfo($owner, $repo, $sha, $ } /** - * Operation getV5ReposOwnerRepoCommitsShaAsync + * Operation getV5ReposOwnerRepoCommitsAsync * - * 仓库的某个提交 + * 仓库的所有提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) + * @param string $path 包含该文件的提交 (optional) + * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) + * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) + * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommitsShaAsync($owner, $repo, $sha, $accessToken = null) + public function getV5ReposOwnerRepoCommitsAsync($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') { - return $this->getV5ReposOwnerRepoCommitsShaAsyncWithHttpInfo($owner, $repo, $sha, $accessToken) + return $this->getV5ReposOwnerRepoCommitsAsyncWithHttpInfo($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -7143,22 +7170,28 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCommitsShaAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCommitsAsyncWithHttpInfo * - * 仓库的某个提交 + * 仓库的所有提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) + * @param string $path 包含该文件的提交 (optional) + * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) + * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) + * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCommitsShaAsyncWithHttpInfo($owner, $repo, $sha, $accessToken = null) + public function getV5ReposOwnerRepoCommitsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\RepoCommitWithFiles'; - $request = $this->getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $accessToken); + $returnType = '\Gitee\Model\RepoCommit[]'; + $request = $this->getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken, $sha, $path, $author, $since, $until, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7198,38 +7231,45 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCommitsSha' + * Create request for operation 'getV5ReposOwnerRepoCommits' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sha 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 (optional) + * @param string $path 包含该文件的提交 (optional) + * @param string $author 提交作者的邮箱或个人空间地址(username/login) (optional) + * @param string $since 提交的起始时间,时间格式为 ISO 8601 (optional) + * @param string $until 提交的最后时间,时间格式为 ISO 8601 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $accessToken = null) + protected function getV5ReposOwnerRepoCommitsRequest($owner, $repo, $accessToken = null, $sha = null, $path = null, $author = null, $since = null, $until = null, $page = '1', $perPage = '20') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommitsSha' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommits' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommitsSha' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommits' ); } - // verify the required parameter 'sha' is set - if ($sha === null || (is_array($sha) && count($sha) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sha when calling getV5ReposOwnerRepoCommitsSha' - ); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoCommits, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoCommits, must be bigger than or equal to 1.'); } - $resourcePath = '/v5/repos/{owner}/{repo}/commits/{sha}'; + + $resourcePath = '/v5/repos/{owner}/{repo}/commits'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7240,6 +7280,34 @@ protected function getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $ac if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($sha !== null) { + $queryParams['sha'] = ObjectSerializer::toQueryValue($sha); + } + // query params + if ($path !== null) { + $queryParams['path'] = ObjectSerializer::toQueryValue($path); + } + // query params + if ($author !== null) { + $queryParams['author'] = ObjectSerializer::toQueryValue($author); + } + // query params + if ($since !== null) { + $queryParams['since'] = ObjectSerializer::toQueryValue($since); + } + // query params + if ($until !== null) { + $queryParams['until'] = ObjectSerializer::toQueryValue($until); + } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } // path params if ($owner !== null) { @@ -7257,14 +7325,6 @@ protected function getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $ac $resourcePath ); } - // path params - if ($sha !== null) { - $resourcePath = str_replace( - '{' . 'sha' . '}', - ObjectSerializer::toPathValue($sha), - $resourcePath - ); - } // body params $_tempBody = null; @@ -7338,45 +7398,47 @@ protected function getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $ac } /** - * Operation getV5ReposOwnerRepoCompareBaseHead + * Operation getV5ReposOwnerRepoCommitsRefComments * - * 两个Commits之间对比的版本差异 + * 获取单个Commit的评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $base Commit提交的SHA值或者分支名作为对比起点 (required) - * @param string $head Commit提交的SHA值或者分支名作为对比终点 (required) + * @param string $ref Commit的Reference (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Compare + * @return \Gitee\Model\Note[] */ - public function getV5ReposOwnerRepoCompareBaseHead($owner, $repo, $base, $head, $accessToken = null) + public function getV5ReposOwnerRepoCommitsRefComments($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') { - list($response) = $this->getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo($owner, $repo, $base, $head, $accessToken); + list($response) = $this->getV5ReposOwnerRepoCommitsRefCommentsWithHttpInfo($owner, $repo, $ref, $accessToken, $page, $perPage); return $response; } /** - * Operation getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo + * Operation getV5ReposOwnerRepoCommitsRefCommentsWithHttpInfo * - * 两个Commits之间对比的版本差异 + * 获取单个Commit的评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $base Commit提交的SHA值或者分支名作为对比起点 (required) - * @param string $head Commit提交的SHA值或者分支名作为对比终点 (required) + * @param string $ref Commit的Reference (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Compare, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Note[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo($owner, $repo, $base, $head, $accessToken = null) + public function getV5ReposOwnerRepoCommitsRefCommentsWithHttpInfo($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Compare'; - $request = $this->getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $base, $head, $accessToken); + $returnType = '\Gitee\Model\Note[]'; + $request = $this->getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ref, $accessToken, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -7427,7 +7489,7 @@ public function getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo($owner, $repo, $b case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Compare', + '\Gitee\Model\Note[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7438,22 +7500,23 @@ public function getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo($owner, $repo, $b } /** - * Operation getV5ReposOwnerRepoCompareBaseHeadAsync + * Operation getV5ReposOwnerRepoCommitsRefCommentsAsync * - * 两个Commits之间对比的版本差异 + * 获取单个Commit的评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $base Commit提交的SHA值或者分支名作为对比起点 (required) - * @param string $head Commit提交的SHA值或者分支名作为对比终点 (required) + * @param string $ref Commit的Reference (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCompareBaseHeadAsync($owner, $repo, $base, $head, $accessToken = null) + public function getV5ReposOwnerRepoCommitsRefCommentsAsync($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') { - return $this->getV5ReposOwnerRepoCompareBaseHeadAsyncWithHttpInfo($owner, $repo, $base, $head, $accessToken) + return $this->getV5ReposOwnerRepoCommitsRefCommentsAsyncWithHttpInfo($owner, $repo, $ref, $accessToken, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -7462,23 +7525,24 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoCompareBaseHeadAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCommitsRefCommentsAsyncWithHttpInfo * - * 两个Commits之间对比的版本差异 + * 获取单个Commit的评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $base Commit提交的SHA值或者分支名作为对比起点 (required) - * @param string $head Commit提交的SHA值或者分支名作为对比终点 (required) + * @param string $ref Commit的Reference (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoCompareBaseHeadAsyncWithHttpInfo($owner, $repo, $base, $head, $accessToken = null) + public function getV5ReposOwnerRepoCommitsRefCommentsAsyncWithHttpInfo($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\Compare'; - $request = $this->getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $base, $head, $accessToken); + $returnType = '\Gitee\Model\Note[]'; + $request = $this->getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ref, $accessToken, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7518,45 +7582,47 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoCompareBaseHead' + * Create request for operation 'getV5ReposOwnerRepoCommitsRefComments' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $base Commit提交的SHA值或者分支名作为对比起点 (required) - * @param string $head Commit提交的SHA值或者分支名作为对比终点 (required) + * @param string $ref Commit的Reference (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $base, $head, $accessToken = null) + protected function getV5ReposOwnerRepoCommitsRefCommentsRequest($owner, $repo, $ref, $accessToken = null, $page = '1', $perPage = '20') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCompareBaseHead' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommitsRefComments' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCompareBaseHead' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommitsRefComments' ); } - // verify the required parameter 'base' is set - if ($base === null || (is_array($base) && count($base) === 0)) { + // verify the required parameter 'ref' is set + if ($ref === null || (is_array($ref) && count($ref) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $base when calling getV5ReposOwnerRepoCompareBaseHead' + 'Missing the required parameter $ref when calling getV5ReposOwnerRepoCommitsRefComments' ); } - // verify the required parameter 'head' is set - if ($head === null || (is_array($head) && count($head) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $head when calling getV5ReposOwnerRepoCompareBaseHead' - ); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoCommitsRefComments, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoCommitsRefComments, must be bigger than or equal to 1.'); } - $resourcePath = '/v5/repos/{owner}/{repo}/compare/{base}...{head}'; + + $resourcePath = '/v5/repos/{owner}/{repo}/commits/{ref}/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7567,6 +7633,14 @@ protected function getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $bas if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } // path params if ($owner !== null) { @@ -7585,18 +7659,10 @@ protected function getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $bas ); } // path params - if ($base !== null) { - $resourcePath = str_replace( - '{' . 'base' . '}', - ObjectSerializer::toPathValue($base), - $resourcePath - ); - } - // path params - if ($head !== null) { + if ($ref !== null) { $resourcePath = str_replace( - '{' . 'head' . '}', - ObjectSerializer::toPathValue($head), + '{' . 'ref' . '}', + ObjectSerializer::toPathValue($ref), $resourcePath ); } @@ -7673,45 +7739,43 @@ protected function getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $bas } /** - * Operation getV5ReposOwnerRepoContentsPath + * Operation getV5ReposOwnerRepoCommitsSha * - * 获取仓库具体路径下的内容 + * 仓库的某个提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) + * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Content[] + * @return \Gitee\Model\RepoCommitWithFiles */ - public function getV5ReposOwnerRepoContentsPath($owner, $repo, $path, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoCommitsSha($owner, $repo, $sha, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $accessToken, $ref); + list($response) = $this->getV5ReposOwnerRepoCommitsShaWithHttpInfo($owner, $repo, $sha, $accessToken); return $response; } /** - * Operation getV5ReposOwnerRepoContentsPathWithHttpInfo + * Operation getV5ReposOwnerRepoCommitsShaWithHttpInfo * - * 获取仓库具体路径下的内容 + * 仓库的某个提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) + * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Content[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\RepoCommitWithFiles, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoCommitsShaWithHttpInfo($owner, $repo, $sha, $accessToken = null) { - $returnType = '\Gitee\Model\Content[]'; - $request = $this->getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $accessToken, $ref); + $returnType = '\Gitee\Model\RepoCommitWithFiles'; + $request = $this->getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $accessToken); try { $options = $this->createHttpClientOption(); @@ -7762,7 +7826,7 @@ public function getV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Content[]', + '\Gitee\Model\RepoCommitWithFiles', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7773,22 +7837,21 @@ public function getV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path } /** - * Operation getV5ReposOwnerRepoContentsPathAsync + * Operation getV5ReposOwnerRepoCommitsShaAsync * - * 获取仓库具体路径下的内容 + * 仓库的某个提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) + * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoContentsPathAsync($owner, $repo, $path, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoCommitsShaAsync($owner, $repo, $sha, $accessToken = null) { - return $this->getV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $accessToken, $ref) + return $this->getV5ReposOwnerRepoCommitsShaAsyncWithHttpInfo($owner, $repo, $sha, $accessToken) ->then( function ($response) { return $response[0]; @@ -7797,23 +7860,22 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoContentsPathAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCommitsShaAsyncWithHttpInfo * - * 获取仓库具体路径下的内容 + * 仓库的某个提交 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) + * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoCommitsShaAsyncWithHttpInfo($owner, $repo, $sha, $accessToken = null) { - $returnType = '\Gitee\Model\Content[]'; - $request = $this->getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $accessToken, $ref); + $returnType = '\Gitee\Model\RepoCommitWithFiles'; + $request = $this->getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7853,39 +7915,38 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoContentsPath' + * Create request for operation 'getV5ReposOwnerRepoCommitsSha' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) + * @param string $sha 提交的SHA值或者分支名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $accessToken = null, $ref = null) + protected function getV5ReposOwnerRepoCommitsShaRequest($owner, $repo, $sha, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoContentsPath' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCommitsSha' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoContentsPath' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCommitsSha' ); } - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { + // verify the required parameter 'sha' is set + if ($sha === null || (is_array($sha) && count($sha) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling getV5ReposOwnerRepoContentsPath' + 'Missing the required parameter $sha when calling getV5ReposOwnerRepoCommitsSha' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/contents(/{path})'; + $resourcePath = '/v5/repos/{owner}/{repo}/commits/{sha}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7896,10 +7957,6 @@ protected function getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // query params - if ($ref !== null) { - $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); - } // path params if ($owner !== null) { @@ -7918,10 +7975,10 @@ protected function getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, ); } // path params - if ($path !== null) { + if ($sha !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{' . 'sha' . '}', + ObjectSerializer::toPathValue($sha), $resourcePath ); } @@ -7998,43 +8055,49 @@ protected function getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, } /** - * Operation getV5ReposOwnerRepoContributors + * Operation getV5ReposOwnerRepoCompareBaseHead * - * 获取仓库贡献者 + * Commits 对比 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $base 对比的起点。Commit SHA、分支名或标签名 (required) + * @param string $head 对比的终点。Commit SHA、分支名或标签名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 贡献者类型 (optional, default to committers) + * @param bool $straight 是否直对比。默认 false (optional) + * @param string $suffix 按照文件后缀过滤文件,如 `.txt`。只影响 `files` (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Contributor + * @return \Gitee\Model\Compare */ - public function getV5ReposOwnerRepoContributors($owner, $repo, $accessToken = null, $type = 'committers') + public function getV5ReposOwnerRepoCompareBaseHead($owner, $repo, $base, $head, $accessToken = null, $straight = null, $suffix = null) { - list($response) = $this->getV5ReposOwnerRepoContributorsWithHttpInfo($owner, $repo, $accessToken, $type); + list($response) = $this->getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo($owner, $repo, $base, $head, $accessToken, $straight, $suffix); return $response; } /** - * Operation getV5ReposOwnerRepoContributorsWithHttpInfo + * Operation getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo * - * 获取仓库贡献者 + * Commits 对比 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $base 对比的起点。Commit SHA、分支名或标签名 (required) + * @param string $head 对比的终点。Commit SHA、分支名或标签名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 贡献者类型 (optional, default to committers) + * @param bool $straight 是否直对比。默认 false (optional) + * @param string $suffix 按照文件后缀过滤文件,如 `.txt`。只影响 `files` (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Contributor, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Compare, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoContributorsWithHttpInfo($owner, $repo, $accessToken = null, $type = 'committers') + public function getV5ReposOwnerRepoCompareBaseHeadWithHttpInfo($owner, $repo, $base, $head, $accessToken = null, $straight = null, $suffix = null) { - $returnType = '\Gitee\Model\Contributor'; - $request = $this->getV5ReposOwnerRepoContributorsRequest($owner, $repo, $accessToken, $type); + $returnType = '\Gitee\Model\Compare'; + $request = $this->getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $base, $head, $accessToken, $straight, $suffix); try { $options = $this->createHttpClientOption(); @@ -8085,7 +8148,7 @@ public function getV5ReposOwnerRepoContributorsWithHttpInfo($owner, $repo, $acce case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Contributor', + '\Gitee\Model\Compare', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8096,21 +8159,24 @@ public function getV5ReposOwnerRepoContributorsWithHttpInfo($owner, $repo, $acce } /** - * Operation getV5ReposOwnerRepoContributorsAsync + * Operation getV5ReposOwnerRepoCompareBaseHeadAsync * - * 获取仓库贡献者 + * Commits 对比 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $base 对比的起点。Commit SHA、分支名或标签名 (required) + * @param string $head 对比的终点。Commit SHA、分支名或标签名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 贡献者类型 (optional, default to committers) + * @param bool $straight 是否直对比。默认 false (optional) + * @param string $suffix 按照文件后缀过滤文件,如 `.txt`。只影响 `files` (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoContributorsAsync($owner, $repo, $accessToken = null, $type = 'committers') + public function getV5ReposOwnerRepoCompareBaseHeadAsync($owner, $repo, $base, $head, $accessToken = null, $straight = null, $suffix = null) { - return $this->getV5ReposOwnerRepoContributorsAsyncWithHttpInfo($owner, $repo, $accessToken, $type) + return $this->getV5ReposOwnerRepoCompareBaseHeadAsyncWithHttpInfo($owner, $repo, $base, $head, $accessToken, $straight, $suffix) ->then( function ($response) { return $response[0]; @@ -8119,22 +8185,25 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoContributorsAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoCompareBaseHeadAsyncWithHttpInfo * - * 获取仓库贡献者 + * Commits 对比 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $base 对比的起点。Commit SHA、分支名或标签名 (required) + * @param string $head 对比的终点。Commit SHA、分支名或标签名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 贡献者类型 (optional, default to committers) + * @param bool $straight 是否直对比。默认 false (optional) + * @param string $suffix 按照文件后缀过滤文件,如 `.txt`。只影响 `files` (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoContributorsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $type = 'committers') + public function getV5ReposOwnerRepoCompareBaseHeadAsyncWithHttpInfo($owner, $repo, $base, $head, $accessToken = null, $straight = null, $suffix = null) { - $returnType = '\Gitee\Model\Contributor'; - $request = $this->getV5ReposOwnerRepoContributorsRequest($owner, $repo, $accessToken, $type); + $returnType = '\Gitee\Model\Compare'; + $request = $this->getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $base, $head, $accessToken, $straight, $suffix); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8174,32 +8243,47 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoContributors' + * Create request for operation 'getV5ReposOwnerRepoCompareBaseHead' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $base 对比的起点。Commit SHA、分支名或标签名 (required) + * @param string $head 对比的终点。Commit SHA、分支名或标签名 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 贡献者类型 (optional, default to committers) + * @param bool $straight 是否直对比。默认 false (optional) + * @param string $suffix 按照文件后缀过滤文件,如 `.txt`。只影响 `files` (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoContributorsRequest($owner, $repo, $accessToken = null, $type = 'committers') + protected function getV5ReposOwnerRepoCompareBaseHeadRequest($owner, $repo, $base, $head, $accessToken = null, $straight = null, $suffix = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoContributors' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoCompareBaseHead' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoContributors' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoCompareBaseHead' + ); + } + // verify the required parameter 'base' is set + if ($base === null || (is_array($base) && count($base) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $base when calling getV5ReposOwnerRepoCompareBaseHead' + ); + } + // verify the required parameter 'head' is set + if ($head === null || (is_array($head) && count($head) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $head when calling getV5ReposOwnerRepoCompareBaseHead' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/contributors'; + $resourcePath = '/v5/repos/{owner}/{repo}/compare/{base}...{head}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8211,8 +8295,12 @@ protected function getV5ReposOwnerRepoContributorsRequest($owner, $repo, $access $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params - if ($type !== null) { - $queryParams['type'] = ObjectSerializer::toQueryValue($type); + if ($straight !== null) { + $queryParams['straight'] = ObjectSerializer::toQueryValue($straight); + } + // query params + if ($suffix !== null) { + $queryParams['suffix'] = ObjectSerializer::toQueryValue($suffix); } // path params @@ -8231,6 +8319,22 @@ protected function getV5ReposOwnerRepoContributorsRequest($owner, $repo, $access $resourcePath ); } + // path params + if ($base !== null) { + $resourcePath = str_replace( + '{' . 'base' . '}', + ObjectSerializer::toPathValue($base), + $resourcePath + ); + } + // path params + if ($head !== null) { + $resourcePath = str_replace( + '{' . 'head' . '}', + ObjectSerializer::toPathValue($head), + $resourcePath + ); + } // body params $_tempBody = null; @@ -8304,47 +8408,45 @@ protected function getV5ReposOwnerRepoContributorsRequest($owner, $repo, $access } /** - * Operation getV5ReposOwnerRepoForks + * Operation getV5ReposOwnerRepoContentsPath * - * 查看仓库的Forks + * 获取仓库具体路径下的内容 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\Content[] */ - public function getV5ReposOwnerRepoForks($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContentsPath($owner, $repo, $path, $accessToken = null, $ref = null) { - list($response) = $this->getV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken, $sort, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $accessToken, $ref); return $response; } /** - * Operation getV5ReposOwnerRepoForksWithHttpInfo + * Operation getV5ReposOwnerRepoContentsPathWithHttpInfo * - * 查看仓库的Forks + * 获取仓库具体路径下的内容 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Content[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $sort, $page, $perPage); + $returnType = '\Gitee\Model\Content[]'; + $request = $this->getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $accessToken, $ref); try { $options = $this->createHttpClientOption(); @@ -8395,7 +8497,7 @@ public function getV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\Content[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8406,23 +8508,22 @@ public function getV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken } /** - * Operation getV5ReposOwnerRepoForksAsync + * Operation getV5ReposOwnerRepoContentsPathAsync * - * 查看仓库的Forks + * 获取仓库具体路径下的内容 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoForksAsync($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContentsPathAsync($owner, $repo, $path, $accessToken = null, $ref = null) { - return $this->getV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken, $sort, $page, $perPage) + return $this->getV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $accessToken, $ref) ->then( function ($response) { return $response[0]; @@ -8431,24 +8532,23 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoForksAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoContentsPathAsyncWithHttpInfo * - * 查看仓库的Forks + * 获取仓库具体路径下的内容 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $sort, $page, $perPage); + $returnType = '\Gitee\Model\Content[]'; + $request = $this->getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $accessToken, $ref); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8488,34 +8588,39 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoForks' + * Create request for operation 'getV5ReposOwnerRepoContentsPath' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $accessToken = null, $ref = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoForks' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoContentsPath' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoForks' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoContentsPath' + ); + } + // verify the required parameter 'path' is set + if ($path === null || (is_array($path) && count($path) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $path when calling getV5ReposOwnerRepoContentsPath' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/forks'; + $resourcePath = '/v5/repos/{owner}/{repo}/contents(/{path})'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8527,16 +8632,8 @@ protected function getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken = $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params - if ($sort !== null) { - $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); - } - // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); - } - // query params - if ($perPage !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + if ($ref !== null) { + $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); } // path params @@ -8555,6 +8652,14 @@ protected function getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken = $resourcePath ); } + // path params + if ($path !== null) { + $resourcePath = str_replace( + '{' . 'path' . '}', + ObjectSerializer::toPathValue($path), + $resourcePath + ); + } // body params $_tempBody = null; @@ -8628,45 +8733,43 @@ protected function getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken = } /** - * Operation getV5ReposOwnerRepoKeys + * Operation getV5ReposOwnerRepoContributors * - * 获取仓库已部署的公钥 + * 获取仓库贡献者 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $type 贡献者类型 (optional, default to committers) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\SSHKey[] + * @return \Gitee\Model\Contributor[] */ - public function getV5ReposOwnerRepoKeys($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContributors($owner, $repo, $accessToken = null, $type = 'committers') { - list($response) = $this->getV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $accessToken, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoContributorsWithHttpInfo($owner, $repo, $accessToken, $type); return $response; } /** - * Operation getV5ReposOwnerRepoKeysWithHttpInfo + * Operation getV5ReposOwnerRepoContributorsWithHttpInfo * - * 获取仓库已部署的公钥 + * 获取仓库贡献者 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $type 贡献者类型 (optional, default to committers) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\SSHKey[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Contributor[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContributorsWithHttpInfo($owner, $repo, $accessToken = null, $type = 'committers') { - $returnType = '\Gitee\Model\SSHKey[]'; - $request = $this->getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken, $page, $perPage); + $returnType = '\Gitee\Model\Contributor[]'; + $request = $this->getV5ReposOwnerRepoContributorsRequest($owner, $repo, $accessToken, $type); try { $options = $this->createHttpClientOption(); @@ -8717,7 +8820,7 @@ public function getV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $accessToken case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\SSHKey[]', + '\Gitee\Model\Contributor[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8728,22 +8831,21 @@ public function getV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $accessToken } /** - * Operation getV5ReposOwnerRepoKeysAsync + * Operation getV5ReposOwnerRepoContributorsAsync * - * 获取仓库已部署的公钥 + * 获取仓库贡献者 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $type 贡献者类型 (optional, default to committers) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoKeysAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContributorsAsync($owner, $repo, $accessToken = null, $type = 'committers') { - return $this->getV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage) + return $this->getV5ReposOwnerRepoContributorsAsyncWithHttpInfo($owner, $repo, $accessToken, $type) ->then( function ($response) { return $response[0]; @@ -8752,23 +8854,22 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoKeysAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoContributorsAsyncWithHttpInfo * - * 获取仓库已部署的公钥 + * 获取仓库贡献者 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $type 贡献者类型 (optional, default to committers) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoContributorsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $type = 'committers') { - $returnType = '\Gitee\Model\SSHKey[]'; - $request = $this->getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken, $page, $perPage); + $returnType = '\Gitee\Model\Contributor[]'; + $request = $this->getV5ReposOwnerRepoContributorsRequest($owner, $repo, $accessToken, $type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8808,33 +8909,32 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoKeys' + * Create request for operation 'getV5ReposOwnerRepoContributors' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $type 贡献者类型 (optional, default to committers) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoContributorsRequest($owner, $repo, $accessToken = null, $type = 'committers') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoKeys' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoContributors' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoKeys' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoContributors' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/keys'; + $resourcePath = '/v5/repos/{owner}/{repo}/contributors'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8846,12 +8946,8 @@ protected function getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken = $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); - } - // query params - if ($perPage !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + if ($type !== null) { + $queryParams['type'] = ObjectSerializer::toQueryValue($type); } // path params @@ -8943,45 +9039,47 @@ protected function getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken = } /** - * Operation getV5ReposOwnerRepoKeysAvailable + * Operation getV5ReposOwnerRepoForks * - * 获取仓库可部署的公钥 + * 查看仓库的Forks * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\SSHKeyBasic[] + * @return \Gitee\Model\Project[] */ - public function getV5ReposOwnerRepoKeysAvailable($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoForks($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') { - list($response) = $this->getV5ReposOwnerRepoKeysAvailableWithHttpInfo($owner, $repo, $accessToken, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken, $sort, $page, $perPage); return $response; } /** - * Operation getV5ReposOwnerRepoKeysAvailableWithHttpInfo + * Operation getV5ReposOwnerRepoForksWithHttpInfo * - * 获取仓库可部署的公钥 + * 查看仓库的Forks * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\SSHKeyBasic[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Project[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoKeysAvailableWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\SSHKeyBasic[]'; - $request = $this->getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $accessToken, $page, $perPage); + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $sort, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -9032,7 +9130,7 @@ public function getV5ReposOwnerRepoKeysAvailableWithHttpInfo($owner, $repo, $acc case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\SSHKeyBasic[]', + '\Gitee\Model\Project[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9043,22 +9141,23 @@ public function getV5ReposOwnerRepoKeysAvailableWithHttpInfo($owner, $repo, $acc } /** - * Operation getV5ReposOwnerRepoKeysAvailableAsync + * Operation getV5ReposOwnerRepoForksAsync * - * 获取仓库可部署的公钥 + * 查看仓库的Forks * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoKeysAvailableAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoForksAsync($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') { - return $this->getV5ReposOwnerRepoKeysAvailableAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage) + return $this->getV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken, $sort, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -9067,23 +9166,24 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoKeysAvailableAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoForksAsyncWithHttpInfo * - * 获取仓库可部署的公钥 + * 查看仓库的Forks * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoKeysAvailableAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\SSHKeyBasic[]'; - $request = $this->getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $accessToken, $page, $perPage); + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $sort, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9123,33 +9223,41 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoKeysAvailable' + * Create request for operation 'getV5ReposOwnerRepoForks' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $sort 排序方式: fork的时间(newest, oldest),star的人数(stargazers) (optional, default to newest) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken = null, $sort = 'newest', $page = '1', $perPage = '20') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoKeysAvailable' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoForks' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoKeysAvailable' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoForks' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoForks, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoForks, must be bigger than or equal to 1.'); + } - $resourcePath = '/v5/repos/{owner}/{repo}/keys/available'; + + $resourcePath = '/v5/repos/{owner}/{repo}/forks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9161,6 +9269,10 @@ protected function getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $acces $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params + if ($sort !== null) { + $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); + } + // query params if ($page !== null) { $queryParams['page'] = ObjectSerializer::toQueryValue($page); } @@ -9258,43 +9370,45 @@ protected function getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $acces } /** - * Operation getV5ReposOwnerRepoKeysId + * Operation getV5ReposOwnerRepoKeys * - * 获取仓库的单个公钥 + * 获取仓库已部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\SSHKey + * @return \Gitee\Model\SSHKey[] */ - public function getV5ReposOwnerRepoKeysId($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoKeys($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - list($response) = $this->getV5ReposOwnerRepoKeysIdWithHttpInfo($owner, $repo, $id, $accessToken); + list($response) = $this->getV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $accessToken, $page, $perPage); return $response; } /** - * Operation getV5ReposOwnerRepoKeysIdWithHttpInfo + * Operation getV5ReposOwnerRepoKeysWithHttpInfo * - * 获取仓库的单个公钥 + * 获取仓库已部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\SSHKey, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\SSHKey[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoKeysIdWithHttpInfo($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\SSHKey'; - $request = $this->getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessToken); + $returnType = '\Gitee\Model\SSHKey[]'; + $request = $this->getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -9345,7 +9459,7 @@ public function getV5ReposOwnerRepoKeysIdWithHttpInfo($owner, $repo, $id, $acces case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\SSHKey', + '\Gitee\Model\SSHKey[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9356,21 +9470,22 @@ public function getV5ReposOwnerRepoKeysIdWithHttpInfo($owner, $repo, $id, $acces } /** - * Operation getV5ReposOwnerRepoKeysIdAsync + * Operation getV5ReposOwnerRepoKeysAsync * - * 获取仓库的单个公钥 + * 获取仓库已部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoKeysIdAsync($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoKeysAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - return $this->getV5ReposOwnerRepoKeysIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken) + return $this->getV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -9379,22 +9494,23 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoKeysIdAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoKeysAsyncWithHttpInfo * - * 获取仓库的单个公钥 + * 获取仓库已部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoKeysIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = '\Gitee\Model\SSHKey'; - $request = $this->getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessToken); + $returnType = '\Gitee\Model\SSHKey[]'; + $request = $this->getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9434,38 +9550,40 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoKeysId' + * Create request for operation 'getV5ReposOwnerRepoKeys' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessToken = null) + protected function getV5ReposOwnerRepoKeysRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoKeysId' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoKeys' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoKeysId' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoKeys' ); } - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getV5ReposOwnerRepoKeysId' - ); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoKeys, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoKeys, must be bigger than or equal to 1.'); } - $resourcePath = '/v5/repos/{owner}/{repo}/keys/{id}'; + + $resourcePath = '/v5/repos/{owner}/{repo}/keys'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9476,6 +9594,14 @@ protected function getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessT if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } // path params if ($owner !== null) { @@ -9493,14 +9619,6 @@ protected function getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessT $resourcePath ); } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; @@ -9574,40 +9692,45 @@ protected function getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessT } /** - * Operation getV5ReposOwnerRepoPages + * Operation getV5ReposOwnerRepoKeysAvailable * - * 获取Pages信息 + * 获取仓库可部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Gitee\Model\SSHKeyBasic[] */ - public function getV5ReposOwnerRepoPages($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysAvailable($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - $this->getV5ReposOwnerRepoPagesWithHttpInfo($owner, $repo, $accessToken); + list($response) = $this->getV5ReposOwnerRepoKeysAvailableWithHttpInfo($owner, $repo, $accessToken, $page, $perPage); + return $response; } /** - * Operation getV5ReposOwnerRepoPagesWithHttpInfo + * Operation getV5ReposOwnerRepoKeysAvailableWithHttpInfo * - * 获取Pages信息 + * 获取仓库可部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\SSHKeyBasic[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoPagesWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysAvailableWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = ''; - $request = $this->getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\SSHKeyBasic[]'; + $request = $this->getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $accessToken, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -9637,30 +9760,54 @@ public function getV5ReposOwnerRepoPagesWithHttpInfo($owner, $repo, $accessToken ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\SSHKeyBasic[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation getV5ReposOwnerRepoPagesAsync + * Operation getV5ReposOwnerRepoKeysAvailableAsync * - * 获取Pages信息 + * 获取仓库可部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoPagesAsync($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysAvailableAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - return $this->getV5ReposOwnerRepoPagesAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->getV5ReposOwnerRepoKeysAvailableAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -9669,27 +9816,43 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoPagesAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoKeysAvailableAsyncWithHttpInfo * - * 获取Pages信息 + * 获取仓库可部署的公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoPagesAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysAvailableAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { - $returnType = ''; - $request = $this->getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\SSHKeyBasic[]'; + $request = $this->getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $accessToken, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -9709,31 +9872,40 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoPages' + * Create request for operation 'getV5ReposOwnerRepoKeysAvailable' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken = null) + protected function getV5ReposOwnerRepoKeysAvailableRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20') { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoPages' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoKeysAvailable' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoPages' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoKeysAvailable' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoKeysAvailable, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoKeysAvailable, must be bigger than or equal to 1.'); + } - $resourcePath = '/v5/repos/{owner}/{repo}/pages'; + + $resourcePath = '/v5/repos/{owner}/{repo}/keys/available'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9744,6 +9916,14 @@ protected function getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken = if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } // path params if ($owner !== null) { @@ -9834,41 +10014,43 @@ protected function getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken = } /** - * Operation getV5ReposOwnerRepoPushConfig + * Operation getV5ReposOwnerRepoKeysId * - * 获取仓库推送规则设置 + * 获取仓库的单个公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\ProjectPushConfig + * @return \Gitee\Model\SSHKey */ - public function getV5ReposOwnerRepoPushConfig($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysId($owner, $repo, $id, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoPushConfigWithHttpInfo($owner, $repo, $accessToken); + list($response) = $this->getV5ReposOwnerRepoKeysIdWithHttpInfo($owner, $repo, $id, $accessToken); return $response; } /** - * Operation getV5ReposOwnerRepoPushConfigWithHttpInfo + * Operation getV5ReposOwnerRepoKeysIdWithHttpInfo * - * 获取仓库推送规则设置 + * 获取仓库的单个公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\ProjectPushConfig, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\SSHKey, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoPushConfigWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysIdWithHttpInfo($owner, $repo, $id, $accessToken = null) { - $returnType = '\Gitee\Model\ProjectPushConfig'; - $request = $this->getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\SSHKey'; + $request = $this->getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessToken); try { $options = $this->createHttpClientOption(); @@ -9919,7 +10101,7 @@ public function getV5ReposOwnerRepoPushConfigWithHttpInfo($owner, $repo, $access case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\ProjectPushConfig', + '\Gitee\Model\SSHKey', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9930,20 +10112,21 @@ public function getV5ReposOwnerRepoPushConfigWithHttpInfo($owner, $repo, $access } /** - * Operation getV5ReposOwnerRepoPushConfigAsync + * Operation getV5ReposOwnerRepoKeysIdAsync * - * 获取仓库推送规则设置 + * 获取仓库的单个公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoPushConfigAsync($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysIdAsync($owner, $repo, $id, $accessToken = null) { - return $this->getV5ReposOwnerRepoPushConfigAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->getV5ReposOwnerRepoKeysIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken) ->then( function ($response) { return $response[0]; @@ -9952,21 +10135,22 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoPushConfigAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoKeysIdAsyncWithHttpInfo * - * 获取仓库推送规则设置 + * 获取仓库的单个公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoPushConfigAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoKeysIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken = null) { - $returnType = '\Gitee\Model\ProjectPushConfig'; - $request = $this->getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\SSHKey'; + $request = $this->getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10006,31 +10190,38 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoPushConfig' + * Create request for operation 'getV5ReposOwnerRepoKeysId' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 公钥 ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessToken = null) + protected function getV5ReposOwnerRepoKeysIdRequest($owner, $repo, $id, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoPushConfig' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoKeysId' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoPushConfig' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoKeysId' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getV5ReposOwnerRepoKeysId' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/push_config'; + $resourcePath = '/v5/repos/{owner}/{repo}/keys/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10058,6 +10249,14 @@ protected function getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessTo $resourcePath ); } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; @@ -10131,43 +10330,40 @@ protected function getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessTo } /** - * Operation getV5ReposOwnerRepoReadme + * Operation getV5ReposOwnerRepoPages * - * 获取仓库README + * 获取Pages信息 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Content + * @return void */ - public function getV5ReposOwnerRepoReadme($owner, $repo, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoPages($owner, $repo, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoReadmeWithHttpInfo($owner, $repo, $accessToken, $ref); - return $response; + $this->getV5ReposOwnerRepoPagesWithHttpInfo($owner, $repo, $accessToken); } /** - * Operation getV5ReposOwnerRepoReadmeWithHttpInfo + * Operation getV5ReposOwnerRepoPagesWithHttpInfo * - * 获取仓库README + * 获取Pages信息 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Content, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoReadmeWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoPagesWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Content'; - $request = $this->getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken, $ref); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken); try { $options = $this->createHttpClientOption(); @@ -10197,53 +10393,30 @@ public function getV5ReposOwnerRepoReadmeWithHttpInfo($owner, $repo, $accessToke ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Gitee\Model\Content', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getV5ReposOwnerRepoReadmeAsync + * Operation getV5ReposOwnerRepoPagesAsync * - * 获取仓库README + * 获取Pages信息 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReadmeAsync($owner, $repo, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoPagesAsync($owner, $repo, $accessToken = null) { - return $this->getV5ReposOwnerRepoReadmeAsyncWithHttpInfo($owner, $repo, $accessToken, $ref) + return $this->getV5ReposOwnerRepoPagesAsyncWithHttpInfo($owner, $repo, $accessToken) ->then( function ($response) { return $response[0]; @@ -10252,42 +10425,27 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoReadmeAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoPagesAsyncWithHttpInfo * - * 获取仓库README + * 获取Pages信息 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReadmeAsyncWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) + public function getV5ReposOwnerRepoPagesAsyncWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Content'; - $request = $this->getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken, $ref); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -10307,32 +10465,31 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoReadme' + * Create request for operation 'getV5ReposOwnerRepoPages' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken = null, $ref = null) + protected function getV5ReposOwnerRepoPagesRequest($owner, $repo, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReadme' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoPages' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReadme' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoPages' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/readme'; + $resourcePath = '/v5/repos/{owner}/{repo}/pages'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10343,10 +10500,6 @@ protected function getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // query params - if ($ref !== null) { - $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); - } // path params if ($owner !== null) { @@ -10437,47 +10590,41 @@ protected function getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken } /** - * Operation getV5ReposOwnerRepoReleases + * Operation getV5ReposOwnerRepoPushConfig * - * 获取仓库的所有Releases + * 获取仓库推送规则设置 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Release[] + * @return \Gitee\Model\ProjectPushConfig */ - public function getV5ReposOwnerRepoReleases($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) + public function getV5ReposOwnerRepoPushConfig($owner, $repo, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $direction); + list($response) = $this->getV5ReposOwnerRepoPushConfigWithHttpInfo($owner, $repo, $accessToken); return $response; } /** - * Operation getV5ReposOwnerRepoReleasesWithHttpInfo + * Operation getV5ReposOwnerRepoPushConfigWithHttpInfo * - * 获取仓库的所有Releases + * 获取仓库推送规则设置 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Release[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\ProjectPushConfig, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) + public function getV5ReposOwnerRepoPushConfigWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Release[]'; - $request = $this->getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToken, $page, $perPage, $direction); + $returnType = '\Gitee\Model\ProjectPushConfig'; + $request = $this->getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessToken); try { $options = $this->createHttpClientOption(); @@ -10528,7 +10675,7 @@ public function getV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $accessTo case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Release[]', + '\Gitee\Model\ProjectPushConfig', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10539,23 +10686,20 @@ public function getV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $accessTo } /** - * Operation getV5ReposOwnerRepoReleasesAsync + * Operation getV5ReposOwnerRepoPushConfigAsync * - * 获取仓库的所有Releases + * 获取仓库推送规则设置 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) + public function getV5ReposOwnerRepoPushConfigAsync($owner, $repo, $accessToken = null) { - return $this->getV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $direction) + return $this->getV5ReposOwnerRepoPushConfigAsyncWithHttpInfo($owner, $repo, $accessToken) ->then( function ($response) { return $response[0]; @@ -10564,24 +10708,21 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoReleasesAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoPushConfigAsyncWithHttpInfo * - * 获取仓库的所有Releases + * 获取仓库推送规则设置 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) + public function getV5ReposOwnerRepoPushConfigAsyncWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Release[]'; - $request = $this->getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToken, $page, $perPage, $direction); + $returnType = '\Gitee\Model\ProjectPushConfig'; + $request = $this->getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10621,34 +10762,31 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoReleases' + * Create request for operation 'getV5ReposOwnerRepoPushConfig' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) - * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) + protected function getV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleases' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoPushConfig' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleases' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoPushConfig' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/releases'; + $resourcePath = '/v5/repos/{owner}/{repo}/push_config'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10659,18 +10797,6 @@ protected function getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToke if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); - } - // query params - if ($perPage !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); - } - // query params - if ($direction !== null) { - $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); - } // path params if ($owner !== null) { @@ -10761,43 +10887,44 @@ protected function getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToke } /** - * Operation getV5ReposOwnerRepoReleasesId + * Operation getV5ReposOwnerRepoRawPath * - * 获取仓库的单个Releases + * 获取 raw 文件(100MB 以内) * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 发行版本的ID (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Release + * @return void */ - public function getV5ReposOwnerRepoReleasesId($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoRawPath($owner, $repo, $path, $accessToken = null, $ref = null) { - list($response) = $this->getV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $id, $accessToken); - return $response; + $this->getV5ReposOwnerRepoRawPathWithHttpInfo($owner, $repo, $path, $accessToken, $ref); } /** - * Operation getV5ReposOwnerRepoReleasesIdWithHttpInfo + * Operation getV5ReposOwnerRepoRawPathWithHttpInfo * - * 获取仓库的单个Releases + * 获取 raw 文件(100MB 以内) * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 发行版本的ID (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoRawPathWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $accessToken); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoRawPathRequest($owner, $repo, $path, $accessToken, $ref); try { $options = $this->createHttpClientOption(); @@ -10827,53 +10954,32 @@ public function getV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $id, $a ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Gitee\Model\Release', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getV5ReposOwnerRepoReleasesIdAsync + * Operation getV5ReposOwnerRepoRawPathAsync * - * 获取仓库的单个Releases + * 获取 raw 文件(100MB 以内) * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 发行版本的ID (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesIdAsync($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoRawPathAsync($owner, $repo, $path, $accessToken = null, $ref = null) { - return $this->getV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken) + return $this->getV5ReposOwnerRepoRawPathAsyncWithHttpInfo($owner, $repo, $path, $accessToken, $ref) ->then( function ($response) { return $response[0]; @@ -10882,42 +10988,29 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoRawPathAsyncWithHttpInfo * - * 获取仓库的单个Releases + * 获取 raw 文件(100MB 以内) * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 发行版本的ID (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken = null) + public function getV5ReposOwnerRepoRawPathAsyncWithHttpInfo($owner, $repo, $path, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $accessToken); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoRawPathRequest($owner, $repo, $path, $accessToken, $ref); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -10937,38 +11030,39 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoReleasesId' + * Create request for operation 'getV5ReposOwnerRepoRawPath' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 发行版本的ID (required) + * @param string $path 文件的路径 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag 或 commit。默认: 仓库的默认分支(通常是 master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $accessToken = null) + protected function getV5ReposOwnerRepoRawPathRequest($owner, $repo, $path, $accessToken = null, $ref = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesId' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoRawPath' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesId' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoRawPath' ); } - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'path' is set + if ($path === null || (is_array($path) && count($path) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getV5ReposOwnerRepoReleasesId' + 'Missing the required parameter $path when calling getV5ReposOwnerRepoRawPath' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/releases/{id}'; + $resourcePath = '/v5/repos/{owner}/{repo}/raw/{path}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10979,6 +11073,10 @@ protected function getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $acc if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($ref !== null) { + $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); + } // path params if ($owner !== null) { @@ -10997,10 +11095,10 @@ protected function getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $acc ); } // path params - if ($id !== null) { + if ($path !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'path' . '}', + ObjectSerializer::toPathValue($path), $resourcePath ); } @@ -11010,11 +11108,11 @@ protected function getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $acc if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -11077,41 +11175,43 @@ protected function getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $acc } /** - * Operation getV5ReposOwnerRepoReleasesLatest + * Operation getV5ReposOwnerRepoReadme * - * 获取仓库的最后更新的Release + * 获取仓库README * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Release + * @return \Gitee\Model\Content */ - public function getV5ReposOwnerRepoReleasesLatest($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReadme($owner, $repo, $accessToken = null, $ref = null) { - list($response) = $this->getV5ReposOwnerRepoReleasesLatestWithHttpInfo($owner, $repo, $accessToken); + list($response) = $this->getV5ReposOwnerRepoReadmeWithHttpInfo($owner, $repo, $accessToken, $ref); return $response; } /** - * Operation getV5ReposOwnerRepoReleasesLatestWithHttpInfo + * Operation getV5ReposOwnerRepoReadmeWithHttpInfo * - * 获取仓库的最后更新的Release + * 获取仓库README * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Content, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoReleasesLatestWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReadmeWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Content'; + $request = $this->getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken, $ref); try { $options = $this->createHttpClientOption(); @@ -11162,7 +11262,7 @@ public function getV5ReposOwnerRepoReleasesLatestWithHttpInfo($owner, $repo, $ac case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Release', + '\Gitee\Model\Content', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11173,20 +11273,21 @@ public function getV5ReposOwnerRepoReleasesLatestWithHttpInfo($owner, $repo, $ac } /** - * Operation getV5ReposOwnerRepoReleasesLatestAsync + * Operation getV5ReposOwnerRepoReadmeAsync * - * 获取仓库的最后更新的Release + * 获取仓库README * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesLatestAsync($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReadmeAsync($owner, $repo, $accessToken = null, $ref = null) { - return $this->getV5ReposOwnerRepoReleasesLatestAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->getV5ReposOwnerRepoReadmeAsyncWithHttpInfo($owner, $repo, $accessToken, $ref) ->then( function ($response) { return $response[0]; @@ -11195,21 +11296,22 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoReleasesLatestAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReadmeAsyncWithHttpInfo * - * 获取仓库的最后更新的Release + * 获取仓库README * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesLatestAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReadmeAsyncWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Content'; + $request = $this->getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken, $ref); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11249,31 +11351,32 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoReleasesLatest' + * Create request for operation 'getV5ReposOwnerRepoReadme' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $accessToken = null) + protected function getV5ReposOwnerRepoReadmeRequest($owner, $repo, $accessToken = null, $ref = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesLatest' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReadme' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesLatest' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReadme' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/releases/latest'; + $resourcePath = '/v5/repos/{owner}/{repo}/readme'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11284,6 +11387,10 @@ protected function getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $acce if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($ref !== null) { + $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); + } // path params if ($owner !== null) { @@ -11374,43 +11481,47 @@ protected function getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $acce } /** - * Operation getV5ReposOwnerRepoReleasesTagsTag + * Operation getV5ReposOwnerRepoReleases * - * 根据Tag名称获取仓库的Release + * 获取仓库的所有Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Release + * @return \Gitee\Model\Release[] */ - public function getV5ReposOwnerRepoReleasesTagsTag($owner, $repo, $tag, $accessToken = null) + public function getV5ReposOwnerRepoReleases($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - list($response) = $this->getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo($owner, $repo, $tag, $accessToken); + list($response) = $this->getV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $direction); return $response; } /** - * Operation getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesWithHttpInfo * - * 根据Tag名称获取仓库的Release + * 获取仓库的所有Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Release[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo($owner, $repo, $tag, $accessToken = null) + public function getV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag, $accessToken); + $returnType = '\Gitee\Model\Release[]'; + $request = $this->getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToken, $page, $perPage, $direction); try { $options = $this->createHttpClientOption(); @@ -11461,7 +11572,7 @@ public function getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo($owner, $repo, $t case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Release', + '\Gitee\Model\Release[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11472,21 +11583,23 @@ public function getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo($owner, $repo, $t } /** - * Operation getV5ReposOwnerRepoReleasesTagsTagAsync + * Operation getV5ReposOwnerRepoReleasesAsync * - * 根据Tag名称获取仓库的Release + * 获取仓库的所有Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesTagsTagAsync($owner, $repo, $tag, $accessToken = null) + public function getV5ReposOwnerRepoReleasesAsync($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - return $this->getV5ReposOwnerRepoReleasesTagsTagAsyncWithHttpInfo($owner, $repo, $tag, $accessToken) + return $this->getV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $accessToken, $page, $perPage, $direction) ->then( function ($response) { return $response[0]; @@ -11495,22 +11608,24 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoReleasesTagsTagAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesAsyncWithHttpInfo * - * 根据Tag名称获取仓库的Release + * 获取仓库的所有Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoReleasesTagsTagAsyncWithHttpInfo($owner, $repo, $tag, $accessToken = null) + public function getV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag, $accessToken); + $returnType = '\Gitee\Model\Release[]'; + $request = $this->getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToken, $page, $perPage, $direction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11550,38 +11665,41 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoReleasesTagsTag' + * Create request for operation 'getV5ReposOwnerRepoReleases' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选。升序/降序。不填为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag, $accessToken = null) + protected function getV5ReposOwnerRepoReleasesRequest($owner, $repo, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesTagsTag' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleases' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesTagsTag' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleases' ); } - // verify the required parameter 'tag' is set - if ($tag === null || (is_array($tag) && count($tag) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag when calling getV5ReposOwnerRepoReleasesTagsTag' - ); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoReleases, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoReleases, must be bigger than or equal to 1.'); } - $resourcePath = '/v5/repos/{owner}/{repo}/releases/tags/{tag}'; + + $resourcePath = '/v5/repos/{owner}/{repo}/releases'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11592,6 +11710,18 @@ protected function getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } + // query params + if ($direction !== null) { + $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); + } // path params if ($owner !== null) { @@ -11609,14 +11739,6 @@ protected function getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag $resourcePath ); } - // path params - if ($tag !== null) { - $resourcePath = str_replace( - '{' . 'tag' . '}', - ObjectSerializer::toPathValue($tag), - $resourcePath - ); - } // body params $_tempBody = null; @@ -11690,41 +11812,43 @@ protected function getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag } /** - * Operation getV5ReposOwnerRepoTags + * Operation getV5ReposOwnerRepoReleasesId * - * 列出仓库所有的tags + * 获取仓库的单个Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Tag + * @return \Gitee\Model\Release */ - public function getV5ReposOwnerRepoTags($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReleasesId($owner, $repo, $id, $accessToken = null) { - list($response) = $this->getV5ReposOwnerRepoTagsWithHttpInfo($owner, $repo, $accessToken); + list($response) = $this->getV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $id, $accessToken); return $response; } /** - * Operation getV5ReposOwnerRepoTagsWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesIdWithHttpInfo * - * 列出仓库所有的tags + * 获取仓库的单个Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Tag, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) */ - public function getV5ReposOwnerRepoTagsWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $id, $accessToken = null) { - $returnType = '\Gitee\Model\Tag'; - $request = $this->getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Release'; + $request = $this->getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $accessToken); try { $options = $this->createHttpClientOption(); @@ -11775,7 +11899,7 @@ public function getV5ReposOwnerRepoTagsWithHttpInfo($owner, $repo, $accessToken case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Tag', + '\Gitee\Model\Release', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11786,20 +11910,21 @@ public function getV5ReposOwnerRepoTagsWithHttpInfo($owner, $repo, $accessToken } /** - * Operation getV5ReposOwnerRepoTagsAsync + * Operation getV5ReposOwnerRepoReleasesIdAsync * - * 列出仓库所有的tags + * 获取仓库的单个Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoTagsAsync($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReleasesIdAsync($owner, $repo, $id, $accessToken = null) { - return $this->getV5ReposOwnerRepoTagsAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->getV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken) ->then( function ($response) { return $response[0]; @@ -11808,21 +11933,22 @@ function ($response) { } /** - * Operation getV5ReposOwnerRepoTagsAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo * - * 列出仓库所有的tags + * 获取仓库的单个Releases * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5ReposOwnerRepoTagsAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function getV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $id, $accessToken = null) { - $returnType = '\Gitee\Model\Tag'; - $request = $this->getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Release'; + $request = $this->getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11862,31 +11988,38 @@ function ($exception) { } /** - * Create request for operation 'getV5ReposOwnerRepoTags' + * Create request for operation 'getV5ReposOwnerRepoReleasesId' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param int $id 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken = null) + protected function getV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $id, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling getV5ReposOwnerRepoTags' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesId' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling getV5ReposOwnerRepoTags' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesId' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getV5ReposOwnerRepoReleasesId' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/tags'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11914,6 +12047,14 @@ protected function getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken = $resourcePath ); } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; @@ -11987,53 +12128,41 @@ protected function getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken = } /** - * Operation getV5UserRepos + * Operation getV5ReposOwnerRepoReleasesLatest * - * 列出授权用户的所有仓库 + * 获取仓库的最后更新的Release * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) - * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) - * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) - * @param string $q 搜索关键字 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\Release */ - public function getV5UserRepos($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesLatest($owner, $repo, $accessToken = null) { - list($response) = $this->getV5UserReposWithHttpInfo($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoReleasesLatestWithHttpInfo($owner, $repo, $accessToken); return $response; } /** - * Operation getV5UserReposWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesLatestWithHttpInfo * - * 列出授权用户的所有仓库 + * 获取仓库的最后更新的Release * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) - * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) - * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) - * @param string $q 搜索关键字 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) */ - public function getV5UserReposWithHttpInfo($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesLatestWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5UserReposRequest($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage); + $returnType = '\Gitee\Model\Release'; + $request = $this->getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $accessToken); try { $options = $this->createHttpClientOption(); @@ -12084,7 +12213,7 @@ public function getV5UserReposWithHttpInfo($accessToken = null, $visibility = nu case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\Release', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12095,26 +12224,20 @@ public function getV5UserReposWithHttpInfo($accessToken = null, $visibility = nu } /** - * Operation getV5UserReposAsync + * Operation getV5ReposOwnerRepoReleasesLatestAsync * - * 列出授权用户的所有仓库 + * 获取仓库的最后更新的Release * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) - * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) - * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) - * @param string $q 搜索关键字 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5UserReposAsync($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesLatestAsync($owner, $repo, $accessToken = null) { - return $this->getV5UserReposAsyncWithHttpInfo($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage) + return $this->getV5ReposOwnerRepoReleasesLatestAsyncWithHttpInfo($owner, $repo, $accessToken) ->then( function ($response) { return $response[0]; @@ -12123,27 +12246,21 @@ function ($response) { } /** - * Operation getV5UserReposAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesLatestAsyncWithHttpInfo * - * 列出授权用户的所有仓库 + * 获取仓库的最后更新的Release * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) - * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) - * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) - * @param string $q 搜索关键字 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5UserReposAsyncWithHttpInfo($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesLatestAsyncWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5UserReposRequest($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage); + $returnType = '\Gitee\Model\Release'; + $request = $this->getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12183,25 +12300,31 @@ function ($exception) { } /** - * Create request for operation 'getV5UserRepos' + * Create request for operation 'getV5ReposOwnerRepoReleasesLatest' * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) - * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) - * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) - * @param string $q 搜索关键字 (optional) - * @param int $page 当前的页码 (optional, default to 1) - * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5UserReposRequest($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoReleasesLatestRequest($owner, $repo, $accessToken = null) { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesLatest' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesLatest' + ); + } - $resourcePath = '/v5/user/repos'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases/latest'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12212,40 +12335,24 @@ protected function getV5UserReposRequest($accessToken = null, $visibility = null if ($accessToken !== null) { $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // query params - if ($visibility !== null) { - $queryParams['visibility'] = ObjectSerializer::toQueryValue($visibility); - } - // query params - if ($affiliation !== null) { - $queryParams['affiliation'] = ObjectSerializer::toQueryValue($affiliation); - } - // query params - if ($type !== null) { - $queryParams['type'] = ObjectSerializer::toQueryValue($type); - } - // query params - if ($sort !== null) { - $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); - } - // query params - if ($direction !== null) { - $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); - } - // query params - if ($q !== null) { - $queryParams['q'] = ObjectSerializer::toQueryValue($q); - } - // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); } - // query params - if ($perPage !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); } - // body params $_tempBody = null; @@ -12318,49 +12425,49 @@ protected function getV5UserReposRequest($accessToken = null, $visibility = null } /** - * Operation getV5UsersUsernameRepos + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFiles * - * 获取某个用户的公开仓库 + * 获取仓库下的指定 Release 的所有附件 * - * @param string $username 用户名(username/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选: 升序/降序,默认为升序 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\AttachFile[] */ - public function getV5UsersUsernameRepos($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFiles($owner, $repo, $releaseId, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - list($response) = $this->getV5UsersUsernameReposWithHttpInfo($username, $accessToken, $type, $sort, $direction, $page, $perPage); + list($response) = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesWithHttpInfo($owner, $repo, $releaseId, $accessToken, $page, $perPage, $direction); return $response; } /** - * Operation getV5UsersUsernameReposWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesWithHttpInfo * - * 获取某个用户的公开仓库 + * 获取仓库下的指定 Release 的所有附件 * - * @param string $username 用户名(username/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选: 升序/降序,默认为升序 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\AttachFile[], HTTP status code, HTTP response headers (array of strings) */ - public function getV5UsersUsernameReposWithHttpInfo($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesWithHttpInfo($owner, $repo, $releaseId, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5UsersUsernameReposRequest($username, $accessToken, $type, $sort, $direction, $page, $perPage); + $returnType = '\Gitee\Model\AttachFile[]'; + $request = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesRequest($owner, $repo, $releaseId, $accessToken, $page, $perPage, $direction); try { $options = $this->createHttpClientOption(); @@ -12411,7 +12518,7 @@ public function getV5UsersUsernameReposWithHttpInfo($username, $accessToken = nu case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\AttachFile[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12422,24 +12529,24 @@ public function getV5UsersUsernameReposWithHttpInfo($username, $accessToken = nu } /** - * Operation getV5UsersUsernameReposAsync + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsync * - * 获取某个用户的公开仓库 + * 获取仓库下的指定 Release 的所有附件 * - * @param string $username 用户名(username/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选: 升序/降序,默认为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5UsersUsernameReposAsync($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsync($owner, $repo, $releaseId, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - return $this->getV5UsersUsernameReposAsyncWithHttpInfo($username, $accessToken, $type, $sort, $direction, $page, $perPage) + return $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsyncWithHttpInfo($owner, $repo, $releaseId, $accessToken, $page, $perPage, $direction) ->then( function ($response) { return $response[0]; @@ -12448,25 +12555,25 @@ function ($response) { } /** - * Operation getV5UsersUsernameReposAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsyncWithHttpInfo * - * 获取某个用户的公开仓库 + * 获取仓库下的指定 Release 的所有附件 * - * @param string $username 用户名(username/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选: 升序/降序,默认为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getV5UsersUsernameReposAsyncWithHttpInfo($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsyncWithHttpInfo($owner, $repo, $releaseId, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->getV5UsersUsernameReposRequest($username, $accessToken, $type, $sort, $direction, $page, $perPage); + $returnType = '\Gitee\Model\AttachFile[]'; + $request = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesRequest($owner, $repo, $releaseId, $accessToken, $page, $perPage, $direction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12506,29 +12613,48 @@ function ($exception) { } /** - * Create request for operation 'getV5UsersUsernameRepos' + * Create request for operation 'getV5ReposOwnerRepoReleasesReleaseIdAttachFiles' * - * @param string $username 用户名(username/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $releaseId 发行版本的ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) - * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) - * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) * @param int $page 当前的页码 (optional, default to 1) * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * @param string $direction 可选: 升序/降序,默认为升序 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getV5UsersUsernameReposRequest($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + protected function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesRequest($owner, $repo, $releaseId, $accessToken = null, $page = '1', $perPage = '20', $direction = null) { - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling getV5UsersUsernameRepos' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFiles' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFiles' ); } + // verify the required parameter 'releaseId' is set + if ($releaseId === null || (is_array($releaseId) && count($releaseId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $releaseId when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFiles' + ); + } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoReleasesReleaseIdAttachFiles, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoReleasesReleaseIdAttachFiles, must be bigger than or equal to 1.'); + } - $resourcePath = '/v5/users/{username}/repos'; + + $resourcePath = '/v5/repos/{owner}/{repo}/releases/{release_id}/attach_files'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12540,18 +12666,6 @@ protected function getV5UsersUsernameReposRequest($username, $accessToken = null $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } // query params - if ($type !== null) { - $queryParams['type'] = ObjectSerializer::toQueryValue($type); - } - // query params - if ($sort !== null) { - $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); - } - // query params - if ($direction !== null) { - $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); - } - // query params if ($page !== null) { $queryParams['page'] = ObjectSerializer::toQueryValue($page); } @@ -12559,12 +12673,32 @@ protected function getV5UsersUsernameReposRequest($username, $accessToken = null if ($perPage !== null) { $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); } - + // query params + if ($direction !== null) { + $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); + } + // path params - if ($username !== null) { + if ($owner !== null) { $resourcePath = str_replace( - '{' . 'username' . '}', - ObjectSerializer::toPathValue($username), + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + // path params + if ($releaseId !== null) { + $resourcePath = str_replace( + '{' . 'release_id' . '}', + ObjectSerializer::toPathValue($releaseId), $resourcePath ); } @@ -12641,79 +12775,45 @@ protected function getV5UsersUsernameReposRequest($username, $accessToken = null } /** - * Operation patchV5ReposOwnerRepo + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId * - * 更新仓库设置 + * 获取仓库下指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $name 仓库名称 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) - * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) - * @param bool $private 仓库公开或私有。 (optional) - * @param string $path 更新仓库路径 (optional) - * @param string $defaultBranch 更新默认分支 (optional) - * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) - * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) - * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) - * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) - * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) - * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) - * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) - * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\AttachFile */ - public function patchV5ReposOwnerRepo($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - list($response) = $this->patchV5ReposOwnerRepoWithHttpInfo($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource); + list($response) = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken); return $response; } /** - * Operation patchV5ReposOwnerRepoWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdWithHttpInfo * - * 更新仓库设置 + * 获取仓库下指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $name 仓库名称 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) - * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) - * @param bool $private 仓库公开或私有。 (optional) - * @param string $path 更新仓库路径 (optional) - * @param string $defaultBranch 更新默认分支 (optional) - * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) - * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) - * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) - * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) - * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) - * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) - * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) - * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\AttachFile, HTTP status code, HTTP response headers (array of strings) */ - public function patchV5ReposOwnerRepoWithHttpInfo($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource); + $returnType = '\Gitee\Model\AttachFile'; + $request = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdRequest($owner, $repo, $releaseId, $attachFileId, $accessToken); try { $options = $this->createHttpClientOption(); @@ -12764,7 +12864,7 @@ public function patchV5ReposOwnerRepoWithHttpInfo($owner, $repo, $name, $accessT case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\AttachFile', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12775,39 +12875,22 @@ public function patchV5ReposOwnerRepoWithHttpInfo($owner, $repo, $name, $accessT } /** - * Operation patchV5ReposOwnerRepoAsync + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsync * - * 更新仓库设置 + * 获取仓库下指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $name 仓库名称 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) - * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) - * @param bool $private 仓库公开或私有。 (optional) - * @param string $path 更新仓库路径 (optional) - * @param string $defaultBranch 更新默认分支 (optional) - * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) - * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) - * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) - * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) - * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) - * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) - * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) - * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoAsync($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsync($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - return $this->patchV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource) + return $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsyncWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken) ->then( function ($response) { return $response[0]; @@ -12816,40 +12899,23 @@ function ($response) { } /** - * Operation patchV5ReposOwnerRepoAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsyncWithHttpInfo * - * 更新仓库设置 + * 获取仓库下指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $name 仓库名称 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) - * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) - * @param bool $private 仓库公开或私有。 (optional) - * @param string $path 更新仓库路径 (optional) - * @param string $defaultBranch 更新默认分支 (optional) - * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) - * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) - * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) - * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) - * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) - * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) - * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) - * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdAsyncWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource); + $returnType = '\Gitee\Model\AttachFile'; + $request = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdRequest($owner, $repo, $releaseId, $attachFileId, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12889,62 +12955,55 @@ function ($exception) { } /** - * Create request for operation 'patchV5ReposOwnerRepo' + * Create request for operation 'getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $name 仓库名称 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) - * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) - * @param bool $private 仓库公开或私有。 (optional) - * @param string $path 更新仓库路径 (optional) - * @param string $defaultBranch 更新默认分支 (optional) - * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) - * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) - * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) - * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) - * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) - * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) - * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) - * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + protected function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdRequest($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling patchV5ReposOwnerRepo' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling patchV5ReposOwnerRepo' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' ); } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'releaseId' is set + if ($releaseId === null || (is_array($releaseId) && count($releaseId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling patchV5ReposOwnerRepo' + 'Missing the required parameter $releaseId when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' + ); + } + // verify the required parameter 'attachFileId' is set + if ($attachFileId === null || (is_array($attachFileId) && count($attachFileId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attachFileId when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId' ); } - $resourcePath = '/v5/repos/{owner}/{repo}'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -12962,87 +13021,23 @@ protected function patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessTok $resourcePath ); } - - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } - // form params - if ($name !== null) { - $formParams['name'] = ObjectSerializer::toFormValue($name); - } - // form params - if ($description !== null) { - $formParams['description'] = ObjectSerializer::toFormValue($description); - } - // form params - if ($homepage !== null) { - $formParams['homepage'] = ObjectSerializer::toFormValue($homepage); - } - // form params - if ($hasIssues !== null) { - $formParams['has_issues'] = ObjectSerializer::toFormValue($hasIssues); - } - // form params - if ($hasWiki !== null) { - $formParams['has_wiki'] = ObjectSerializer::toFormValue($hasWiki); - } - // form params - if ($canComment !== null) { - $formParams['can_comment'] = ObjectSerializer::toFormValue($canComment); - } - // form params - if ($issueComment !== null) { - $formParams['issue_comment'] = ObjectSerializer::toFormValue($issueComment); - } - // form params - if ($securityHoleEnabled !== null) { - $formParams['security_hole_enabled'] = ObjectSerializer::toFormValue($securityHoleEnabled); - } - // form params - if ($private !== null) { - $formParams['private'] = ObjectSerializer::toFormValue($private); - } - // form params - if ($path !== null) { - $formParams['path'] = ObjectSerializer::toFormValue($path); - } - // form params - if ($defaultBranch !== null) { - $formParams['default_branch'] = ObjectSerializer::toFormValue($defaultBranch); - } - // form params - if ($pullRequestsEnabled !== null) { - $formParams['pull_requests_enabled'] = ObjectSerializer::toFormValue($pullRequestsEnabled); - } - // form params - if ($onlineEditEnabled !== null) { - $formParams['online_edit_enabled'] = ObjectSerializer::toFormValue($onlineEditEnabled); - } - // form params - if ($lightweightPrEnabled !== null) { - $formParams['lightweight_pr_enabled'] = ObjectSerializer::toFormValue($lightweightPrEnabled); - } - // form params - if ($mergeEnabled !== null) { - $formParams['merge_enabled'] = ObjectSerializer::toFormValue($mergeEnabled); - } - // form params - if ($squashEnabled !== null) { - $formParams['squash_enabled'] = ObjectSerializer::toFormValue($squashEnabled); - } - // form params - if ($rebaseEnabled !== null) { - $formParams['rebase_enabled'] = ObjectSerializer::toFormValue($rebaseEnabled); - } - // form params - if ($defaultMergeMethod !== null) { - $formParams['default_merge_method'] = ObjectSerializer::toFormValue($defaultMergeMethod); + // path params + if ($releaseId !== null) { + $resourcePath = str_replace( + '{' . 'release_id' . '}', + ObjectSerializer::toPathValue($releaseId), + $resourcePath + ); } - // form params - if ($issueTemplateSource !== null) { - $formParams['issue_template_source'] = ObjectSerializer::toFormValue($issueTemplateSource); + // path params + if ($attachFileId !== null) { + $resourcePath = str_replace( + '{' . 'attach_file_id' . '}', + ObjectSerializer::toPathValue($attachFileId), + $resourcePath + ); } + // body params $_tempBody = null; @@ -13107,7 +13102,7 @@ protected function patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessTok $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -13115,45 +13110,44 @@ protected function patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessTok } /** - * Operation patchV5ReposOwnerRepoCommentsId + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload * - * 更新Commit评论 + * 下载指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) - * @param string $body 评论的内容 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Note + * @return void */ - public function patchV5ReposOwnerRepoCommentsId($owner, $repo, $id, $body, $accessToken = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - list($response) = $this->patchV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $body, $accessToken); - return $response; + $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken); } /** - * Operation patchV5ReposOwnerRepoCommentsIdWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadWithHttpInfo * - * 更新Commit评论 + * 下载指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) - * @param string $body 评论的内容 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function patchV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $body, $accessToken = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $body, $accessToken); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadRequest($owner, $repo, $releaseId, $attachFileId, $accessToken); try { $options = $this->createHttpClientOption(); @@ -13183,54 +13177,32 @@ public function patchV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Gitee\Model\Note', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation patchV5ReposOwnerRepoCommentsIdAsync + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadAsync * - * 更新Commit评论 + * 下载指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) - * @param string $body 评论的内容 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoCommentsIdAsync($owner, $repo, $id, $body, $accessToken = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadAsync($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - return $this->patchV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $body, $accessToken) + return $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadAsyncWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken) ->then( function ($response) { return $response[0]; @@ -13239,43 +13211,29 @@ function ($response) { } /** - * Operation patchV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadAsyncWithHttpInfo * - * 更新Commit评论 + * 下载指定 Release 的单个附件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) - * @param string $body 评论的内容 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $body, $accessToken = null) + public function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadAsyncWithHttpInfo($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $body, $accessToken); + $returnType = ''; + $request = $this->getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadRequest($owner, $repo, $releaseId, $attachFileId, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -13295,51 +13253,55 @@ function ($exception) { } /** - * Create request for operation 'patchV5ReposOwnerRepoCommentsId' + * Create request for operation 'getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param int $id 评论的ID (required) - * @param string $body 评论的内容 (required) + * @param int $releaseId 发行版本的ID (required) + * @param int $attachFileId 发行版本下的附件ID (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $body, $accessToken = null) + protected function getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownloadRequest($owner, $repo, $releaseId, $attachFileId, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling patchV5ReposOwnerRepoCommentsId' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling patchV5ReposOwnerRepoCommentsId' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload' ); } - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'releaseId' is set + if ($releaseId === null || (is_array($releaseId) && count($releaseId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling patchV5ReposOwnerRepoCommentsId' + 'Missing the required parameter $releaseId when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'attachFileId' is set + if ($attachFileId === null || (is_array($attachFileId) && count($attachFileId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling patchV5ReposOwnerRepoCommentsId' + 'Missing the required parameter $attachFileId when calling getV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileIdDownload' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/comments/{id}'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases/{release_id}/attach_files/{attach_file_id}/download'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -13358,32 +13320,32 @@ protected function patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $b ); } // path params - if ($id !== null) { + if ($releaseId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'release_id' . '}', + ObjectSerializer::toPathValue($releaseId), $resourcePath ); } - - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } - // form params - if ($body !== null) { - $formParams['body'] = ObjectSerializer::toFormValue($body); + // path params + if ($attachFileId !== null) { + $resourcePath = str_replace( + '{' . 'attach_file_id' . '}', + ObjectSerializer::toPathValue($attachFileId), + $resourcePath + ); } + // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -13438,7 +13400,7 @@ protected function patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $b $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -13446,51 +13408,43 @@ protected function patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $b } /** - * Operation patchV5ReposOwnerRepoReleasesId + * Operation getV5ReposOwnerRepoReleasesTagsTag * - * 更新仓库Release + * 根据Tag名称获取仓库的Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param int $id id (required) + * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Gitee\Model\Release */ - public function patchV5ReposOwnerRepoReleasesId($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + public function getV5ReposOwnerRepoReleasesTagsTag($owner, $repo, $tag, $accessToken = null) { - list($response) = $this->patchV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease); + list($response) = $this->getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo($owner, $repo, $tag, $accessToken); return $response; } /** - * Operation patchV5ReposOwnerRepoReleasesIdWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo * - * 更新仓库Release + * 根据Tag名称获取仓库的Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param int $id (required) + * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) */ - public function patchV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + public function getV5ReposOwnerRepoReleasesTagsTagWithHttpInfo($owner, $repo, $tag, $accessToken = null) { $returnType = '\Gitee\Model\Release'; - $request = $this->patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease); + $request = $this->getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag, $accessToken); try { $options = $this->createHttpClientOption(); @@ -13552,25 +13506,21 @@ public function patchV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $tagN } /** - * Operation patchV5ReposOwnerRepoReleasesIdAsync + * Operation getV5ReposOwnerRepoReleasesTagsTagAsync * - * 更新仓库Release + * 根据Tag名称获取仓库的Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param int $id (required) + * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoReleasesIdAsync($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + public function getV5ReposOwnerRepoReleasesTagsTagAsync($owner, $repo, $tag, $accessToken = null) { - return $this->patchV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease) + return $this->getV5ReposOwnerRepoReleasesTagsTagAsyncWithHttpInfo($owner, $repo, $tag, $accessToken) ->then( function ($response) { return $response[0]; @@ -13579,26 +13529,22 @@ function ($response) { } /** - * Operation patchV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoReleasesTagsTagAsyncWithHttpInfo * - * 更新仓库Release + * 根据Tag名称获取仓库的Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param int $id (required) + * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + public function getV5ReposOwnerRepoReleasesTagsTagAsyncWithHttpInfo($owner, $repo, $tag, $accessToken = null) { $returnType = '\Gitee\Model\Release'; - $request = $this->patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease); + $request = $this->getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13638,66 +13584,48 @@ function ($exception) { } /** - * Create request for operation 'patchV5ReposOwnerRepoReleasesId' + * Create request for operation 'getV5ReposOwnerRepoReleasesTagsTag' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param int $id (required) + * @param string $tag Tag 名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + protected function getV5ReposOwnerRepoReleasesTagsTagRequest($owner, $repo, $tag, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling patchV5ReposOwnerRepoReleasesId' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoReleasesTagsTag' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling patchV5ReposOwnerRepoReleasesId' - ); - } - // verify the required parameter 'tagName' is set - if ($tagName === null || (is_array($tagName) && count($tagName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tagName when calling patchV5ReposOwnerRepoReleasesId' - ); - } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling patchV5ReposOwnerRepoReleasesId' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling patchV5ReposOwnerRepoReleasesId' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoReleasesTagsTag' ); } - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'tag' is set + if ($tag === null || (is_array($tag) && count($tag) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling patchV5ReposOwnerRepoReleasesId' + 'Missing the required parameter $tag when calling getV5ReposOwnerRepoReleasesTagsTag' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/releases/{id}'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases/tags/{tag}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } // path params if ($owner !== null) { @@ -13716,34 +13644,14 @@ protected function patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagNam ); } // path params - if ($id !== null) { + if ($tag !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'tag' . '}', + ObjectSerializer::toPathValue($tag), $resourcePath ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } - // form params - if ($tagName !== null) { - $formParams['tag_name'] = ObjectSerializer::toFormValue($tagName); - } - // form params - if ($name !== null) { - $formParams['name'] = ObjectSerializer::toFormValue($name); - } - // form params - if ($body !== null) { - $formParams['body'] = ObjectSerializer::toFormValue($body); - } - // form params - if ($prerelease !== null) { - $formParams['prerelease'] = ObjectSerializer::toFormValue($prerelease); - } // body params $_tempBody = null; @@ -13808,7 +13716,7 @@ protected function patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagNam $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -13816,67 +13724,49 @@ protected function patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagNam } /** - * Operation postV5EnterprisesEnterpriseRepos + * Operation getV5ReposOwnerRepoTags * - * 创建企业仓库 + * 列出仓库所有的 tags * - * @param string $name 仓库名称 (required) - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) - * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) - * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) - * @param string $projectCreator 负责人的username (optional) - * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\Tag[] */ - public function postV5EnterprisesEnterpriseRepos($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + public function getV5ReposOwnerRepoTags($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - list($response) = $this->postV5EnterprisesEnterpriseReposWithHttpInfo($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members); + list($response) = $this->getV5ReposOwnerRepoTagsWithHttpInfo($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); return $response; } /** - * Operation postV5EnterprisesEnterpriseReposWithHttpInfo + * Operation getV5ReposOwnerRepoTagsWithHttpInfo * - * 创建企业仓库 + * 列出仓库所有的 tags * - * @param string $name 仓库名称 (required) - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) - * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) - * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) - * @param string $projectCreator 负责人的username (optional) - * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Tag[], HTTP status code, HTTP response headers (array of strings) */ - public function postV5EnterprisesEnterpriseReposWithHttpInfo($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + public function getV5ReposOwnerRepoTagsWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members); + $returnType = '\Gitee\Model\Tag[]'; + $request = $this->getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); try { $options = $this->createHttpClientOption(); @@ -13924,10 +13814,10 @@ public function postV5EnterprisesEnterpriseReposWithHttpInfo($name, $enterprise, } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\Tag[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13938,33 +13828,24 @@ public function postV5EnterprisesEnterpriseReposWithHttpInfo($name, $enterprise, } /** - * Operation postV5EnterprisesEnterpriseReposAsync + * Operation getV5ReposOwnerRepoTagsAsync * - * 创建企业仓库 + * 列出仓库所有的 tags * - * @param string $name 仓库名称 (required) - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) - * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) - * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) - * @param string $projectCreator 负责人的username (optional) - * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5EnterprisesEnterpriseReposAsync($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + public function getV5ReposOwnerRepoTagsAsync($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - return $this->postV5EnterprisesEnterpriseReposAsyncWithHttpInfo($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members) + return $this->getV5ReposOwnerRepoTagsAsyncWithHttpInfo($owner, $repo, $accessToken, $sort, $direction, $page, $perPage) ->then( function ($response) { return $response[0]; @@ -13973,34 +13854,25 @@ function ($response) { } /** - * Operation postV5EnterprisesEnterpriseReposAsyncWithHttpInfo + * Operation getV5ReposOwnerRepoTagsAsyncWithHttpInfo * - * 创建企业仓库 + * 列出仓库所有的 tags * - * @param string $name 仓库名称 (required) - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) - * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) - * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) - * @param string $projectCreator 负责人的username (optional) - * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5EnterprisesEnterpriseReposAsyncWithHttpInfo($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + public function getV5ReposOwnerRepoTagsAsyncWithHttpInfo($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members); + $returnType = '\Gitee\Model\Tag[]'; + $request = $this->getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken, $sort, $direction, $page, $perPage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14040,120 +13912,86 @@ function ($exception) { } /** - * Create request for operation 'postV5EnterprisesEnterpriseRepos' + * Create request for operation 'getV5ReposOwnerRepoTags' * - * @param string $name 仓库名称 (required) - * @param string $enterprise 企业的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) - * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) - * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) - * @param string $projectCreator 负责人的username (optional) - * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * @param string $sort 排序字段 (optional, default to name) + * @param string $direction 排序方向 (optional, default to asc) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + protected function getV5ReposOwnerRepoTagsRequest($owner, $repo, $accessToken = null, $sort = 'name', $direction = 'asc', $page = '1', $perPage = null) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling postV5EnterprisesEnterpriseRepos' + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoTags' ); } - // verify the required parameter 'enterprise' is set - if ($enterprise === null || (is_array($enterprise) && count($enterprise) === 0)) { + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $enterprise when calling postV5EnterprisesEnterpriseRepos' + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoTags' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoTags, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5ReposOwnerRepoTags, must be bigger than or equal to 1.'); + } - $resourcePath = '/v5/enterprises/{enterprise}/repos'; + + $resourcePath = '/v5/repos/{owner}/{repo}/tags'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - // path params - if ($enterprise !== null) { - $resourcePath = str_replace( - '{' . 'enterprise' . '}', - ObjectSerializer::toPathValue($enterprise), - $resourcePath - ); - } - - // form params + // query params if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } - // form params - if ($name !== null) { - $formParams['name'] = ObjectSerializer::toFormValue($name); - } - // form params - if ($description !== null) { - $formParams['description'] = ObjectSerializer::toFormValue($description); - } - // form params - if ($homepage !== null) { - $formParams['homepage'] = ObjectSerializer::toFormValue($homepage); - } - // form params - if ($hasIssues !== null) { - $formParams['has_issues'] = ObjectSerializer::toFormValue($hasIssues); - } - // form params - if ($hasWiki !== null) { - $formParams['has_wiki'] = ObjectSerializer::toFormValue($hasWiki); - } - // form params - if ($canComment !== null) { - $formParams['can_comment'] = ObjectSerializer::toFormValue($canComment); - } - // form params - if ($autoInit !== null) { - $formParams['auto_init'] = ObjectSerializer::toFormValue($autoInit); - } - // form params - if ($gitignoreTemplate !== null) { - $formParams['gitignore_template'] = ObjectSerializer::toFormValue($gitignoreTemplate); + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); } - // form params - if ($licenseTemplate !== null) { - $formParams['license_template'] = ObjectSerializer::toFormValue($licenseTemplate); + // query params + if ($sort !== null) { + $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); } - // form params - if ($path !== null) { - $formParams['path'] = ObjectSerializer::toFormValue($path); + // query params + if ($direction !== null) { + $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); } - // form params - if ($private !== null) { - $formParams['private'] = ObjectSerializer::toFormValue($private); + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } - // form params - if ($outsourced !== null) { - $formParams['outsourced'] = ObjectSerializer::toFormValue($outsourced); + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); } - // form params - if ($projectCreator !== null) { - $formParams['project_creator'] = ObjectSerializer::toFormValue($projectCreator); + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); } - // form params - if ($members !== null) { - $formParams['members'] = ObjectSerializer::toFormValue($members); + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); } + // body params $_tempBody = null; @@ -14164,7 +14002,7 @@ protected function postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $ } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -14218,7 +14056,7 @@ protected function postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $ $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14226,63 +14064,3497 @@ protected function postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $ } /** - * Operation postV5OrgsOrgRepos + * Operation getV5ReposOwnerRepoTarball * - * 创建组织仓库 + * 下载仓库 tar.gz * - * @param string $name 仓库名称 (required) - * @param string $org 组织的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function getV5ReposOwnerRepoTarball($owner, $repo, $accessToken = null, $ref = null) + { + $this->getV5ReposOwnerRepoTarballWithHttpInfo($owner, $repo, $accessToken, $ref); + } + + /** + * Operation getV5ReposOwnerRepoTarballWithHttpInfo + * + * 下载仓库 tar.gz + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getV5ReposOwnerRepoTarballWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) + { + $returnType = ''; + $request = $this->getV5ReposOwnerRepoTarballRequest($owner, $repo, $accessToken, $ref); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation getV5ReposOwnerRepoTarballAsync + * + * 下载仓库 tar.gz + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoTarballAsync($owner, $repo, $accessToken = null, $ref = null) + { + return $this->getV5ReposOwnerRepoTarballAsyncWithHttpInfo($owner, $repo, $accessToken, $ref) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5ReposOwnerRepoTarballAsyncWithHttpInfo + * + * 下载仓库 tar.gz + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoTarballAsyncWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) + { + $returnType = ''; + $request = $this->getV5ReposOwnerRepoTarballRequest($owner, $repo, $accessToken, $ref); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5ReposOwnerRepoTarball' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5ReposOwnerRepoTarballRequest($owner, $repo, $accessToken = null, $ref = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoTarball' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoTarball' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/tarball'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + // query params + if ($ref !== null) { + $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); + } + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/gzip'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/gzip'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getV5ReposOwnerRepoZipball + * + * 下载仓库 zip + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function getV5ReposOwnerRepoZipball($owner, $repo, $accessToken = null, $ref = null) + { + $this->getV5ReposOwnerRepoZipballWithHttpInfo($owner, $repo, $accessToken, $ref); + } + + /** + * Operation getV5ReposOwnerRepoZipballWithHttpInfo + * + * 下载仓库 zip + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getV5ReposOwnerRepoZipballWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) + { + $returnType = ''; + $request = $this->getV5ReposOwnerRepoZipballRequest($owner, $repo, $accessToken, $ref); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation getV5ReposOwnerRepoZipballAsync + * + * 下载仓库 zip + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoZipballAsync($owner, $repo, $accessToken = null, $ref = null) + { + return $this->getV5ReposOwnerRepoZipballAsyncWithHttpInfo($owner, $repo, $accessToken, $ref) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5ReposOwnerRepoZipballAsyncWithHttpInfo + * + * 下载仓库 zip + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5ReposOwnerRepoZipballAsyncWithHttpInfo($owner, $repo, $accessToken = null, $ref = null) + { + $returnType = ''; + $request = $this->getV5ReposOwnerRepoZipballRequest($owner, $repo, $accessToken, $ref); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5ReposOwnerRepoZipball' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $ref 分支、tag或commit。默认: 仓库的默认分支(通常是master) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5ReposOwnerRepoZipballRequest($owner, $repo, $accessToken = null, $ref = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling getV5ReposOwnerRepoZipball' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling getV5ReposOwnerRepoZipball' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/zipball'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + // query params + if ($ref !== null) { + $queryParams['ref'] = ObjectSerializer::toQueryValue($ref); + } + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/zip'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/zip'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getV5UserRepos + * + * 列出授权用户的所有仓库 + * + * @param string $accessToken 用户授权码 (optional) + * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) + * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) + * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param string $q 搜索关键字 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\Project[] + */ + public function getV5UserRepos($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + { + list($response) = $this->getV5UserReposWithHttpInfo($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage); + return $response; + } + + /** + * Operation getV5UserReposWithHttpInfo + * + * 列出授权用户的所有仓库 + * + * @param string $accessToken 用户授权码 (optional) + * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) + * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) + * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param string $q 搜索关键字 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\Project[], HTTP status code, HTTP response headers (array of strings) + */ + public function getV5UserReposWithHttpInfo($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + { + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5UserReposRequest($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Project[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getV5UserReposAsync + * + * 列出授权用户的所有仓库 + * + * @param string $accessToken 用户授权码 (optional) + * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) + * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) + * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param string $q 搜索关键字 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5UserReposAsync($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + { + return $this->getV5UserReposAsyncWithHttpInfo($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5UserReposAsyncWithHttpInfo + * + * 列出授权用户的所有仓库 + * + * @param string $accessToken 用户授权码 (optional) + * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) + * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) + * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param string $q 搜索关键字 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5UserReposAsyncWithHttpInfo($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + { + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5UserReposRequest($accessToken, $visibility, $affiliation, $type, $sort, $direction, $q, $page, $perPage); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5UserRepos' + * + * @param string $accessToken 用户授权码 (optional) + * @param string $visibility 公开(public)、私有(private)或者所有(all),默认: 所有(all) (optional) + * @param string $affiliation owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member (optional) + * @param string $type 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 (optional) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param string $q 搜索关键字 (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5UserReposRequest($accessToken = null, $visibility = null, $affiliation = null, $type = null, $sort = 'full_name', $direction = null, $q = null, $page = '1', $perPage = '20') + { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5UserRepos, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5UserRepos, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v5/user/repos'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + // query params + if ($visibility !== null) { + $queryParams['visibility'] = ObjectSerializer::toQueryValue($visibility); + } + // query params + if ($affiliation !== null) { + $queryParams['affiliation'] = ObjectSerializer::toQueryValue($affiliation); + } + // query params + if ($type !== null) { + $queryParams['type'] = ObjectSerializer::toQueryValue($type); + } + // query params + if ($sort !== null) { + $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); + } + // query params + if ($direction !== null) { + $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); + } + // query params + if ($q !== null) { + $queryParams['q'] = ObjectSerializer::toQueryValue($q); + } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getV5UsersUsernameRepos + * + * 获取某个用户的公开仓库 + * + * @param string $username 用户名(username/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\Project[] + */ + public function getV5UsersUsernameRepos($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + { + list($response) = $this->getV5UsersUsernameReposWithHttpInfo($username, $accessToken, $type, $sort, $direction, $page, $perPage); + return $response; + } + + /** + * Operation getV5UsersUsernameReposWithHttpInfo + * + * 获取某个用户的公开仓库 + * + * @param string $username 用户名(username/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\Project[], HTTP status code, HTTP response headers (array of strings) + */ + public function getV5UsersUsernameReposWithHttpInfo($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + { + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5UsersUsernameReposRequest($username, $accessToken, $type, $sort, $direction, $page, $perPage); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Project[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getV5UsersUsernameReposAsync + * + * 获取某个用户的公开仓库 + * + * @param string $username 用户名(username/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5UsersUsernameReposAsync($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + { + return $this->getV5UsersUsernameReposAsyncWithHttpInfo($username, $accessToken, $type, $sort, $direction, $page, $perPage) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getV5UsersUsernameReposAsyncWithHttpInfo + * + * 获取某个用户的公开仓库 + * + * @param string $username 用户名(username/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getV5UsersUsernameReposAsyncWithHttpInfo($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + { + $returnType = '\Gitee\Model\Project[]'; + $request = $this->getV5UsersUsernameReposRequest($username, $accessToken, $type, $sort, $direction, $page, $perPage); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getV5UsersUsernameRepos' + * + * @param string $username 用户名(username/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $type 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) (optional, default to all) + * @param string $sort 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name (optional, default to full_name) + * @param string $direction 如果sort参数为full_name,用升序(asc)。否则降序(desc) (optional) + * @param int $page 当前的页码 (optional, default to 1) + * @param int $perPage 每页的数量,最大为 100 (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getV5UsersUsernameReposRequest($username, $accessToken = null, $type = 'all', $sort = 'full_name', $direction = null, $page = '1', $perPage = '20') + { + // verify the required parameter 'username' is set + if ($username === null || (is_array($username) && count($username) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $username when calling getV5UsersUsernameRepos' + ); + } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5UsersUsernameRepos, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling RepositoriesApi.getV5UsersUsernameRepos, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v5/users/{username}/repos'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($accessToken !== null) { + $queryParams['access_token'] = ObjectSerializer::toQueryValue($accessToken); + } + // query params + if ($type !== null) { + $queryParams['type'] = ObjectSerializer::toQueryValue($type); + } + // query params + if ($sort !== null) { + $queryParams['sort'] = ObjectSerializer::toQueryValue($sort); + } + // query params + if ($direction !== null) { + $queryParams['direction'] = ObjectSerializer::toQueryValue($direction); + } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + // query params + if ($perPage !== null) { + $queryParams['per_page'] = ObjectSerializer::toQueryValue($perPage); + } + + // path params + if ($username !== null) { + $resourcePath = str_replace( + '{' . 'username' . '}', + ObjectSerializer::toPathValue($username), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation patchV5ReposOwnerRepo + * + * 更新仓库设置 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $name 仓库名称 (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) + * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) + * @param bool $private 仓库公开或私有。 (optional) + * @param string $path 更新仓库路径 (optional) + * @param string $defaultBranch 更新默认分支 (optional) + * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) + * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) + * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) + * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) + * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) + * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) + * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) + * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\Project + */ + public function patchV5ReposOwnerRepo($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + { + list($response) = $this->patchV5ReposOwnerRepoWithHttpInfo($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource); + return $response; + } + + /** + * Operation patchV5ReposOwnerRepoWithHttpInfo + * + * 更新仓库设置 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $name 仓库名称 (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) + * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) + * @param bool $private 仓库公开或私有。 (optional) + * @param string $path 更新仓库路径 (optional) + * @param string $defaultBranch 更新默认分支 (optional) + * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) + * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) + * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) + * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) + * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) + * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) + * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) + * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + */ + public function patchV5ReposOwnerRepoWithHttpInfo($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + { + $returnType = '\Gitee\Model\Project'; + $request = $this->patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Project', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation patchV5ReposOwnerRepoAsync + * + * 更新仓库设置 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $name 仓库名称 (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) + * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) + * @param bool $private 仓库公开或私有。 (optional) + * @param string $path 更新仓库路径 (optional) + * @param string $defaultBranch 更新默认分支 (optional) + * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) + * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) + * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) + * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) + * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) + * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) + * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) + * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoAsync($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + { + return $this->patchV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation patchV5ReposOwnerRepoAsyncWithHttpInfo + * + * 更新仓库设置 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $name 仓库名称 (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) + * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) + * @param bool $private 仓库公开或私有。 (optional) + * @param string $path 更新仓库路径 (optional) + * @param string $defaultBranch 更新默认分支 (optional) + * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) + * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) + * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) + * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) + * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) + * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) + * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) + * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoAsyncWithHttpInfo($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + { + $returnType = '\Gitee\Model\Project'; + $request = $this->patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $issueComment, $securityHoleEnabled, $private, $path, $defaultBranch, $pullRequestsEnabled, $onlineEditEnabled, $lightweightPrEnabled, $mergeEnabled, $squashEnabled, $rebaseEnabled, $defaultMergeMethod, $issueTemplateSource); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'patchV5ReposOwnerRepo' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $name 仓库名称 (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $issueComment 允许对“关闭”状态的 Issue 进行评论。默认: 不允许(false) (optional) + * @param bool $securityHoleEnabled 这个Issue涉及到安全/隐私问题,提交后不公开此Issue(可见范围:仓库成员, 企业成员) (optional) + * @param bool $private 仓库公开或私有。 (optional) + * @param string $path 更新仓库路径 (optional) + * @param string $defaultBranch 更新默认分支 (optional) + * @param bool $pullRequestsEnabled 接受 pull request,协作开发 (optional) + * @param bool $onlineEditEnabled 是否允许仓库文件在线编辑 (optional) + * @param bool $lightweightPrEnabled 是否接受轻量级 pull request (optional) + * @param bool $mergeEnabled 是否开启 merge 合并方式, 默认为开启 (optional) + * @param bool $squashEnabled 是否开启 squash 合并方式, 默认为开启 (optional) + * @param bool $rebaseEnabled 是否开启 rebase 合并方式, 默认为开启 (optional) + * @param string $defaultMergeMethod 选择默认合并 Pull Request 的方式,分别为 merge squash rebase (optional) + * @param string $issueTemplateSource Issue 模版来源 project: 使用仓库 Issue Template 作为模版; enterprise: 使用企业工作项作为模版 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function patchV5ReposOwnerRepoRequest($owner, $repo, $name, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $issueComment = null, $securityHoleEnabled = null, $private = null, $path = null, $defaultBranch = null, $pullRequestsEnabled = null, $onlineEditEnabled = null, $lightweightPrEnabled = null, $mergeEnabled = null, $squashEnabled = null, $rebaseEnabled = null, $defaultMergeMethod = null, $issueTemplateSource = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling patchV5ReposOwnerRepo' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling patchV5ReposOwnerRepo' + ); + } + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling patchV5ReposOwnerRepo' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($description !== null) { + $formParams['description'] = ObjectSerializer::toFormValue($description); + } + // form params + if ($homepage !== null) { + $formParams['homepage'] = ObjectSerializer::toFormValue($homepage); + } + // form params + if ($hasIssues !== null) { + $formParams['has_issues'] = ObjectSerializer::toFormValue($hasIssues); + } + // form params + if ($hasWiki !== null) { + $formParams['has_wiki'] = ObjectSerializer::toFormValue($hasWiki); + } + // form params + if ($canComment !== null) { + $formParams['can_comment'] = ObjectSerializer::toFormValue($canComment); + } + // form params + if ($issueComment !== null) { + $formParams['issue_comment'] = ObjectSerializer::toFormValue($issueComment); + } + // form params + if ($securityHoleEnabled !== null) { + $formParams['security_hole_enabled'] = ObjectSerializer::toFormValue($securityHoleEnabled); + } + // form params + if ($private !== null) { + $formParams['private'] = ObjectSerializer::toFormValue($private); + } + // form params + if ($path !== null) { + $formParams['path'] = ObjectSerializer::toFormValue($path); + } + // form params + if ($defaultBranch !== null) { + $formParams['default_branch'] = ObjectSerializer::toFormValue($defaultBranch); + } + // form params + if ($pullRequestsEnabled !== null) { + $formParams['pull_requests_enabled'] = ObjectSerializer::toFormValue($pullRequestsEnabled); + } + // form params + if ($onlineEditEnabled !== null) { + $formParams['online_edit_enabled'] = ObjectSerializer::toFormValue($onlineEditEnabled); + } + // form params + if ($lightweightPrEnabled !== null) { + $formParams['lightweight_pr_enabled'] = ObjectSerializer::toFormValue($lightweightPrEnabled); + } + // form params + if ($mergeEnabled !== null) { + $formParams['merge_enabled'] = ObjectSerializer::toFormValue($mergeEnabled); + } + // form params + if ($squashEnabled !== null) { + $formParams['squash_enabled'] = ObjectSerializer::toFormValue($squashEnabled); + } + // form params + if ($rebaseEnabled !== null) { + $formParams['rebase_enabled'] = ObjectSerializer::toFormValue($rebaseEnabled); + } + // form params + if ($defaultMergeMethod !== null) { + $formParams['default_merge_method'] = ObjectSerializer::toFormValue($defaultMergeMethod); + } + // form params + if ($issueTemplateSource !== null) { + $formParams['issue_template_source'] = ObjectSerializer::toFormValue($issueTemplateSource); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation patchV5ReposOwnerRepoCommentsId + * + * 更新Commit评论 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $id 评论的ID (required) + * @param string $body 评论的内容 (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\Note + */ + public function patchV5ReposOwnerRepoCommentsId($owner, $repo, $id, $body, $accessToken = null) + { + list($response) = $this->patchV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $body, $accessToken); + return $response; + } + + /** + * Operation patchV5ReposOwnerRepoCommentsIdWithHttpInfo + * + * 更新Commit评论 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $id 评论的ID (required) + * @param string $body 评论的内容 (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) + */ + public function patchV5ReposOwnerRepoCommentsIdWithHttpInfo($owner, $repo, $id, $body, $accessToken = null) + { + $returnType = '\Gitee\Model\Note'; + $request = $this->patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $body, $accessToken); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Note', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation patchV5ReposOwnerRepoCommentsIdAsync + * + * 更新Commit评论 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $id 评论的ID (required) + * @param string $body 评论的内容 (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoCommentsIdAsync($owner, $repo, $id, $body, $accessToken = null) + { + return $this->patchV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $body, $accessToken) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation patchV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo + * + * 更新Commit评论 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $id 评论的ID (required) + * @param string $body 评论的内容 (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoCommentsIdAsyncWithHttpInfo($owner, $repo, $id, $body, $accessToken = null) + { + $returnType = '\Gitee\Model\Note'; + $request = $this->patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $body, $accessToken); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'patchV5ReposOwnerRepoCommentsId' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param int $id 评论的ID (required) + * @param string $body 评论的内容 (required) + * @param string $accessToken 用户授权码 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function patchV5ReposOwnerRepoCommentsIdRequest($owner, $repo, $id, $body, $accessToken = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling patchV5ReposOwnerRepoCommentsId' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling patchV5ReposOwnerRepoCommentsId' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling patchV5ReposOwnerRepoCommentsId' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling patchV5ReposOwnerRepoCommentsId' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/comments/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($body !== null) { + $formParams['body'] = ObjectSerializer::toFormValue($body); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation patchV5ReposOwnerRepoReleasesId + * + * 更新仓库Release + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param int $id id (required) + * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\Release + */ + public function patchV5ReposOwnerRepoReleasesId($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + { + list($response) = $this->patchV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease); + return $response; + } + + /** + * Operation patchV5ReposOwnerRepoReleasesIdWithHttpInfo + * + * 更新仓库Release + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param int $id (required) + * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) + */ + public function patchV5ReposOwnerRepoReleasesIdWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + { + $returnType = '\Gitee\Model\Release'; + $request = $this->patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Release', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation patchV5ReposOwnerRepoReleasesIdAsync + * + * 更新仓库Release + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param int $id (required) + * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoReleasesIdAsync($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + { + return $this->patchV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation patchV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo + * + * 更新仓库Release + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param int $id (required) + * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function patchV5ReposOwnerRepoReleasesIdAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + { + $returnType = '\Gitee\Model\Release'; + $request = $this->patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagName, $name, $body, $id, $accessToken, $prerelease); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'patchV5ReposOwnerRepoReleasesId' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param int $id (required) + * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function patchV5ReposOwnerRepoReleasesIdRequest($owner, $repo, $tagName, $name, $body, $id, $accessToken = null, $prerelease = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling patchV5ReposOwnerRepoReleasesId' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling patchV5ReposOwnerRepoReleasesId' + ); + } + // verify the required parameter 'tagName' is set + if ($tagName === null || (is_array($tagName) && count($tagName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tagName when calling patchV5ReposOwnerRepoReleasesId' + ); + } + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling patchV5ReposOwnerRepoReleasesId' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling patchV5ReposOwnerRepoReleasesId' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling patchV5ReposOwnerRepoReleasesId' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/releases/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($tagName !== null) { + $formParams['tag_name'] = ObjectSerializer::toFormValue($tagName); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($body !== null) { + $formParams['body'] = ObjectSerializer::toFormValue($body); + } + // form params + if ($prerelease !== null) { + $formParams['prerelease'] = ObjectSerializer::toFormValue($prerelease); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postV5EnterprisesEnterpriseRepos + * + * 创建企业仓库 + * + * @param string $name 仓库名称 (required) + * @param string $enterprise 企业的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) + * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) + * @param string $projectCreator 负责人的username (optional) + * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\Project + */ + public function postV5EnterprisesEnterpriseRepos($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + { + list($response) = $this->postV5EnterprisesEnterpriseReposWithHttpInfo($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members); + return $response; + } + + /** + * Operation postV5EnterprisesEnterpriseReposWithHttpInfo + * + * 创建企业仓库 + * + * @param string $name 仓库名称 (required) + * @param string $enterprise 企业的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) + * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) + * @param string $projectCreator 负责人的username (optional) + * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + */ + public function postV5EnterprisesEnterpriseReposWithHttpInfo($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + { + $returnType = '\Gitee\Model\Project'; + $request = $this->postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Project', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postV5EnterprisesEnterpriseReposAsync + * + * 创建企业仓库 + * + * @param string $name 仓库名称 (required) + * @param string $enterprise 企业的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) + * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) + * @param string $projectCreator 负责人的username (optional) + * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5EnterprisesEnterpriseReposAsync($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + { + return $this->postV5EnterprisesEnterpriseReposAsyncWithHttpInfo($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postV5EnterprisesEnterpriseReposAsyncWithHttpInfo + * + * 创建企业仓库 + * + * @param string $name 仓库名称 (required) + * @param string $enterprise 企业的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) + * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) + * @param string $projectCreator 负责人的username (optional) + * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5EnterprisesEnterpriseReposAsyncWithHttpInfo($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + { + $returnType = '\Gitee\Model\Project'; + $request = $this->postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $autoInit, $gitignoreTemplate, $licenseTemplate, $path, $private, $outsourced, $projectCreator, $members); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postV5EnterprisesEnterpriseRepos' + * + * @param string $name 仓库名称 (required) + * @param string $enterprise 企业的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * @param int $private 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 (optional, default to 0) + * @param bool $outsourced 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) (optional) + * @param string $projectCreator 负责人的username (optional) + * @param string $members 用逗号分开的仓库成员。如: member1,member2 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function postV5EnterprisesEnterpriseReposRequest($name, $enterprise, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null, $private = '0', $outsourced = null, $projectCreator = null, $members = null) + { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling postV5EnterprisesEnterpriseRepos' + ); + } + // verify the required parameter 'enterprise' is set + if ($enterprise === null || (is_array($enterprise) && count($enterprise) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $enterprise when calling postV5EnterprisesEnterpriseRepos' + ); + } + + $resourcePath = '/v5/enterprises/{enterprise}/repos'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($enterprise !== null) { + $resourcePath = str_replace( + '{' . 'enterprise' . '}', + ObjectSerializer::toPathValue($enterprise), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($description !== null) { + $formParams['description'] = ObjectSerializer::toFormValue($description); + } + // form params + if ($homepage !== null) { + $formParams['homepage'] = ObjectSerializer::toFormValue($homepage); + } + // form params + if ($hasIssues !== null) { + $formParams['has_issues'] = ObjectSerializer::toFormValue($hasIssues); + } + // form params + if ($hasWiki !== null) { + $formParams['has_wiki'] = ObjectSerializer::toFormValue($hasWiki); + } + // form params + if ($canComment !== null) { + $formParams['can_comment'] = ObjectSerializer::toFormValue($canComment); + } + // form params + if ($autoInit !== null) { + $formParams['auto_init'] = ObjectSerializer::toFormValue($autoInit); + } + // form params + if ($gitignoreTemplate !== null) { + $formParams['gitignore_template'] = ObjectSerializer::toFormValue($gitignoreTemplate); + } + // form params + if ($licenseTemplate !== null) { + $formParams['license_template'] = ObjectSerializer::toFormValue($licenseTemplate); + } + // form params + if ($path !== null) { + $formParams['path'] = ObjectSerializer::toFormValue($path); + } + // form params + if ($private !== null) { + $formParams['private'] = ObjectSerializer::toFormValue($private); + } + // form params + if ($outsourced !== null) { + $formParams['outsourced'] = ObjectSerializer::toFormValue($outsourced); + } + // form params + if ($projectCreator !== null) { + $formParams['project_creator'] = ObjectSerializer::toFormValue($projectCreator); + } + // form params + if ($members !== null) { + $formParams['members'] = ObjectSerializer::toFormValue($members); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postV5OrgsOrgRepos + * + * 创建组织仓库 + * + * @param string $name 仓库名称 (required) + * @param string $org 组织的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) + * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gitee\Model\Project + */ + public function postV5OrgsOrgRepos($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + { + list($response) = $this->postV5OrgsOrgReposWithHttpInfo($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path); + return $response; + } + + /** + * Operation postV5OrgsOrgReposWithHttpInfo + * + * 创建组织仓库 + * + * @param string $name 仓库名称 (required) + * @param string $org 组织的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) + * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + */ + public function postV5OrgsOrgReposWithHttpInfo($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + { + $returnType = '\Gitee\Model\Project'; + $request = $this->postV5OrgsOrgReposRequest($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Project', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postV5OrgsOrgReposAsync + * + * 创建组织仓库 + * + * @param string $name 仓库名称 (required) + * @param string $org 组织的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) + * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5OrgsOrgReposAsync($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + { + return $this->postV5OrgsOrgReposAsyncWithHttpInfo($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postV5OrgsOrgReposAsyncWithHttpInfo + * + * 创建组织仓库 + * + * @param string $name 仓库名称 (required) + * @param string $org 组织的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) + * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5OrgsOrgReposAsyncWithHttpInfo($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + { + $returnType = '\Gitee\Model\Project'; + $request = $this->postV5OrgsOrgReposRequest($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postV5OrgsOrgRepos' + * + * @param string $name 仓库名称 (required) + * @param string $org 组织的路径(path/login) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $description 仓库描述 (optional) + * @param string $homepage 主页(eg: https://gitee.com) (optional) + * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) + * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) + * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) + * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) + * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) + * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) + * @param string $gitignoreTemplate Git Ignore模版 (optional) + * @param string $licenseTemplate License模版 (optional) + * @param string $path 仓库路径 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function postV5OrgsOrgReposRequest($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling postV5OrgsOrgRepos' + ); + } + // verify the required parameter 'org' is set + if ($org === null || (is_array($org) && count($org) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $org when calling postV5OrgsOrgRepos' + ); + } + + $resourcePath = '/v5/orgs/{org}/repos'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($org !== null) { + $resourcePath = str_replace( + '{' . 'org' . '}', + ObjectSerializer::toPathValue($org), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($description !== null) { + $formParams['description'] = ObjectSerializer::toFormValue($description); + } + // form params + if ($homepage !== null) { + $formParams['homepage'] = ObjectSerializer::toFormValue($homepage); + } + // form params + if ($hasIssues !== null) { + $formParams['has_issues'] = ObjectSerializer::toFormValue($hasIssues); + } + // form params + if ($hasWiki !== null) { + $formParams['has_wiki'] = ObjectSerializer::toFormValue($hasWiki); + } + // form params + if ($canComment !== null) { + $formParams['can_comment'] = ObjectSerializer::toFormValue($canComment); + } + // form params + if ($public !== null) { + $formParams['public'] = ObjectSerializer::toFormValue($public); + } + // form params + if ($private !== null) { + $formParams['private'] = ObjectSerializer::toFormValue($private); + } + // form params + if ($autoInit !== null) { + $formParams['auto_init'] = ObjectSerializer::toFormValue($autoInit); + } + // form params + if ($gitignoreTemplate !== null) { + $formParams['gitignore_template'] = ObjectSerializer::toFormValue($gitignoreTemplate); + } + // form params + if ($licenseTemplate !== null) { + $formParams['license_template'] = ObjectSerializer::toFormValue($licenseTemplate); + } + // form params + if ($path !== null) { + $formParams['path'] = ObjectSerializer::toFormValue($path); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postV5ReposOwnerRepoBaiduStatisticKey + * + * 设置/更新仓库的百度统计 key + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function postV5ReposOwnerRepoBaiduStatisticKey($owner, $repo, $accessToken = null, $key = null) + { + $this->postV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken, $key); + } + + /** + * Operation postV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo + * + * 设置/更新仓库的百度统计 key + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * + * @throws \Gitee\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function postV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken = null, $key = null) + { + $returnType = ''; + $request = $this->postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken, $key); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation postV5ReposOwnerRepoBaiduStatisticKeyAsync + * + * 设置/更新仓库的百度统计 key + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5ReposOwnerRepoBaiduStatisticKeyAsync($owner, $repo, $accessToken = null, $key = null) + { + return $this->postV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken, $key) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo + * + * 设置/更新仓库的百度统计 key + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken = null, $key = null) + { + $returnType = ''; + $request = $this->postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken, $key); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postV5ReposOwnerRepoBaiduStatisticKey' + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $accessToken 用户授权码 (optional) + * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken = null, $key = null) + { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoBaiduStatisticKey' + ); + } + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoBaiduStatisticKey' + ); + } + + $resourcePath = '/v5/repos/{owner}/{repo}/baidu_statistic_key'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($owner !== null) { + $resourcePath = str_replace( + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), + $resourcePath + ); + } + + // form params + if ($accessToken !== null) { + $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); + } + // form params + if ($key !== null) { + $formParams['key'] = ObjectSerializer::toFormValue($key); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postV5ReposOwnerRepoBranches + * + * 创建分支 + * + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $refs 起点名称, 默认:master (required) + * @param string $branchName 新创建的分支名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) - * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\CompleteBranch */ - public function postV5OrgsOrgRepos($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + public function postV5ReposOwnerRepoBranches($owner, $repo, $refs, $branchName, $accessToken = null) { - list($response) = $this->postV5OrgsOrgReposWithHttpInfo($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path); + list($response) = $this->postV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken); return $response; } /** - * Operation postV5OrgsOrgReposWithHttpInfo + * Operation postV5ReposOwnerRepoBranchesWithHttpInfo * - * 创建组织仓库 + * 创建分支 * - * @param string $name 仓库名称 (required) - * @param string $org 组织的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $refs 起点名称, 默认:master (required) + * @param string $branchName 新创建的分支名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) - * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\CompleteBranch, HTTP status code, HTTP response headers (array of strings) */ - public function postV5OrgsOrgReposWithHttpInfo($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + public function postV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->postV5OrgsOrgReposRequest($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path); + $returnType = '\Gitee\Model\CompleteBranch'; + $request = $this->postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $branchName, $accessToken); try { $options = $this->createHttpClientOption(); @@ -14333,7 +17605,7 @@ public function postV5OrgsOrgReposWithHttpInfo($name, $org, $accessToken = null, case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\CompleteBranch', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14344,31 +17616,22 @@ public function postV5OrgsOrgReposWithHttpInfo($name, $org, $accessToken = null, } /** - * Operation postV5OrgsOrgReposAsync + * Operation postV5ReposOwnerRepoBranchesAsync * - * 创建组织仓库 + * 创建分支 * - * @param string $name 仓库名称 (required) - * @param string $org 组织的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $refs 起点名称, 默认:master (required) + * @param string $branchName 新创建的分支名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) - * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5OrgsOrgReposAsync($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + public function postV5ReposOwnerRepoBranchesAsync($owner, $repo, $refs, $branchName, $accessToken = null) { - return $this->postV5OrgsOrgReposAsyncWithHttpInfo($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path) + return $this->postV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken) ->then( function ($response) { return $response[0]; @@ -14377,32 +17640,23 @@ function ($response) { } /** - * Operation postV5OrgsOrgReposAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoBranchesAsyncWithHttpInfo * - * 创建组织仓库 + * 创建分支 * - * @param string $name 仓库名称 (required) - * @param string $org 组织的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $refs 起点名称, 默认:master (required) + * @param string $branchName 新创建的分支名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) - * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5OrgsOrgReposAsyncWithHttpInfo($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + public function postV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->postV5OrgsOrgReposRequest($name, $org, $accessToken, $description, $homepage, $hasIssues, $hasWiki, $canComment, $public, $private, $autoInit, $gitignoreTemplate, $licenseTemplate, $path); + $returnType = '\Gitee\Model\CompleteBranch'; + $request = $this->postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $branchName, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14442,42 +17696,45 @@ function ($exception) { } /** - * Create request for operation 'postV5OrgsOrgRepos' + * Create request for operation 'postV5ReposOwnerRepoBranches' * - * @param string $name 仓库名称 (required) - * @param string $org 组织的路径(path/login) (required) + * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) + * @param string $repo 仓库路径(path) (required) + * @param string $refs 起点名称, 默认:master (required) + * @param string $branchName 新创建的分支名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $description 仓库描述 (optional) - * @param string $homepage 主页(eg: https://gitee.com) (optional) - * @param bool $hasIssues 允许提Issue与否。默认: 允许(true) (optional, default to true) - * @param bool $hasWiki 提供Wiki与否。默认: 提供(true) (optional, default to true) - * @param bool $canComment 允许用户对仓库进行评论。默认: 允许(true) (optional, default to true) - * @param int $public 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 (optional) - * @param bool $private 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 (optional) - * @param bool $autoInit 值为true时则会用README初始化仓库。默认: 不初始化(false) (optional) - * @param string $gitignoreTemplate Git Ignore模版 (optional) - * @param string $licenseTemplate License模版 (optional) - * @param string $path 仓库路径 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5OrgsOrgReposRequest($name, $org, $accessToken = null, $description = null, $homepage = null, $hasIssues = 'true', $hasWiki = 'true', $canComment = 'true', $public = null, $private = null, $autoInit = null, $gitignoreTemplate = null, $licenseTemplate = null, $path = null) + protected function postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $branchName, $accessToken = null) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'owner' is set + if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling postV5OrgsOrgRepos' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoBranches' ); } - // verify the required parameter 'org' is set - if ($org === null || (is_array($org) && count($org) === 0)) { + // verify the required parameter 'repo' is set + if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $org when calling postV5OrgsOrgRepos' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoBranches' + ); + } + // verify the required parameter 'refs' is set + if ($refs === null || (is_array($refs) && count($refs) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $refs when calling postV5ReposOwnerRepoBranches' + ); + } + // verify the required parameter 'branchName' is set + if ($branchName === null || (is_array($branchName) && count($branchName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $branchName when calling postV5ReposOwnerRepoBranches' ); } - $resourcePath = '/v5/orgs/{org}/repos'; + $resourcePath = '/v5/repos/{owner}/{repo}/branches'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14486,10 +17743,18 @@ protected function postV5OrgsOrgReposRequest($name, $org, $accessToken = null, $ // path params - if ($org !== null) { + if ($owner !== null) { $resourcePath = str_replace( - '{' . 'org' . '}', - ObjectSerializer::toPathValue($org), + '{' . 'owner' . '}', + ObjectSerializer::toPathValue($owner), + $resourcePath + ); + } + // path params + if ($repo !== null) { + $resourcePath = str_replace( + '{' . 'repo' . '}', + ObjectSerializer::toPathValue($repo), $resourcePath ); } @@ -14499,52 +17764,12 @@ protected function postV5OrgsOrgReposRequest($name, $org, $accessToken = null, $ $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } // form params - if ($name !== null) { - $formParams['name'] = ObjectSerializer::toFormValue($name); - } - // form params - if ($description !== null) { - $formParams['description'] = ObjectSerializer::toFormValue($description); - } - // form params - if ($homepage !== null) { - $formParams['homepage'] = ObjectSerializer::toFormValue($homepage); - } - // form params - if ($hasIssues !== null) { - $formParams['has_issues'] = ObjectSerializer::toFormValue($hasIssues); - } - // form params - if ($hasWiki !== null) { - $formParams['has_wiki'] = ObjectSerializer::toFormValue($hasWiki); - } - // form params - if ($canComment !== null) { - $formParams['can_comment'] = ObjectSerializer::toFormValue($canComment); - } - // form params - if ($public !== null) { - $formParams['public'] = ObjectSerializer::toFormValue($public); - } - // form params - if ($private !== null) { - $formParams['private'] = ObjectSerializer::toFormValue($private); - } - // form params - if ($autoInit !== null) { - $formParams['auto_init'] = ObjectSerializer::toFormValue($autoInit); - } - // form params - if ($gitignoreTemplate !== null) { - $formParams['gitignore_template'] = ObjectSerializer::toFormValue($gitignoreTemplate); - } - // form params - if ($licenseTemplate !== null) { - $formParams['license_template'] = ObjectSerializer::toFormValue($licenseTemplate); + if ($refs !== null) { + $formParams['refs'] = ObjectSerializer::toFormValue($refs); } // form params - if ($path !== null) { - $formParams['path'] = ObjectSerializer::toFormValue($path); + if ($branchName !== null) { + $formParams['branch_name'] = ObjectSerializer::toFormValue($branchName); } // body params $_tempBody = null; @@ -14618,42 +17843,41 @@ protected function postV5OrgsOrgReposRequest($name, $org, $accessToken = null, $ } /** - * Operation postV5ReposOwnerRepoBaiduStatisticKey + * Operation postV5ReposOwnerRepoCommits * - * 设置/更新仓库的百度统计 key + * 提交多个文件变更 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $accessToken 用户授权码 (optional) - * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * @param \Gitee\Model\PostV5ReposOwnerRepoCommits $v5ReposOwnerRepoCommits v5ReposOwnerRepoCommits (required) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Gitee\Model\RepoCommitWithFiles */ - public function postV5ReposOwnerRepoBaiduStatisticKey($owner, $repo, $accessToken = null, $key = null) + public function postV5ReposOwnerRepoCommits($owner, $repo, $v5ReposOwnerRepoCommits) { - $this->postV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken, $key); + list($response) = $this->postV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $v5ReposOwnerRepoCommits); + return $response; } /** - * Operation postV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo + * Operation postV5ReposOwnerRepoCommitsWithHttpInfo * - * 设置/更新仓库的百度统计 key + * 提交多个文件变更 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $accessToken 用户授权码 (optional) - * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * @param \Gitee\Model\PostV5ReposOwnerRepoCommits $v5ReposOwnerRepoCommits (required) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\RepoCommitWithFiles, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, $accessToken = null, $key = null) + public function postV5ReposOwnerRepoCommitsWithHttpInfo($owner, $repo, $v5ReposOwnerRepoCommits) { - $returnType = ''; - $request = $this->postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken, $key); + $returnType = '\Gitee\Model\RepoCommitWithFiles'; + $request = $this->postV5ReposOwnerRepoCommitsRequest($owner, $repo, $v5ReposOwnerRepoCommits); try { $options = $this->createHttpClientOption(); @@ -14683,31 +17907,52 @@ public function postV5ReposOwnerRepoBaiduStatisticKeyWithHttpInfo($owner, $repo, ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\RepoCommitWithFiles', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation postV5ReposOwnerRepoBaiduStatisticKeyAsync + * Operation postV5ReposOwnerRepoCommitsAsync * - * 设置/更新仓库的百度统计 key + * 提交多个文件变更 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) - * @param string $accessToken 用户授权码 (optional) - * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * @param string $repo 仓库路径(path) (required) + * @param \Gitee\Model\PostV5ReposOwnerRepoCommits $v5ReposOwnerRepoCommits (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoBaiduStatisticKeyAsync($owner, $repo, $accessToken = null, $key = null) + public function postV5ReposOwnerRepoCommitsAsync($owner, $repo, $v5ReposOwnerRepoCommits) { - return $this->postV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken, $key) + return $this->postV5ReposOwnerRepoCommitsAsyncWithHttpInfo($owner, $repo, $v5ReposOwnerRepoCommits) ->then( function ($response) { return $response[0]; @@ -14716,28 +17961,41 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoCommitsAsyncWithHttpInfo * - * 设置/更新仓库的百度统计 key + * 提交多个文件变更 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $accessToken 用户授权码 (optional) - * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * @param \Gitee\Model\PostV5ReposOwnerRepoCommits $v5ReposOwnerRepoCommits (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoBaiduStatisticKeyAsyncWithHttpInfo($owner, $repo, $accessToken = null, $key = null) + public function postV5ReposOwnerRepoCommitsAsyncWithHttpInfo($owner, $repo, $v5ReposOwnerRepoCommits) { - $returnType = ''; - $request = $this->postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken, $key); + $returnType = '\Gitee\Model\RepoCommitWithFiles'; + $request = $this->postV5ReposOwnerRepoCommitsRequest($owner, $repo, $v5ReposOwnerRepoCommits); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -14757,32 +18015,37 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoBaiduStatisticKey' + * Create request for operation 'postV5ReposOwnerRepoCommits' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $accessToken 用户授权码 (optional) - * @param string $key 通过百度统计页面获取的 hm.js? 后面的 key (optional) + * @param \Gitee\Model\PostV5ReposOwnerRepoCommits $v5ReposOwnerRepoCommits (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $accessToken = null, $key = null) + protected function postV5ReposOwnerRepoCommitsRequest($owner, $repo, $v5ReposOwnerRepoCommits) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoBaiduStatisticKey' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoCommits' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoBaiduStatisticKey' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoCommits' + ); + } + // verify the required parameter 'v5ReposOwnerRepoCommits' is set + if ($v5ReposOwnerRepoCommits === null || (is_array($v5ReposOwnerRepoCommits) && count($v5ReposOwnerRepoCommits) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $v5ReposOwnerRepoCommits when calling postV5ReposOwnerRepoCommits' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/baidu_statistic_key'; + $resourcePath = '/v5/repos/{owner}/{repo}/commits'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14807,16 +18070,11 @@ protected function postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $ ); } - // form params - if ($accessToken !== null) { - $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); - } - // form params - if ($key !== null) { - $formParams['key'] = ObjectSerializer::toFormValue($key); - } // body params $_tempBody = null; + if (isset($v5ReposOwnerRepoCommits)) { + $_tempBody = $v5ReposOwnerRepoCommits; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -14887,45 +18145,49 @@ protected function postV5ReposOwnerRepoBaiduStatisticKeyRequest($owner, $repo, $ } /** - * Operation postV5ReposOwnerRepoBranches + * Operation postV5ReposOwnerRepoCommitsShaComments * - * 创建分支 + * 创建Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $refs 起点名称, 默认:master (required) - * @param string $branchName 新创建的分支名称 (required) + * @param string $sha 评论的sha值 (required) + * @param string $body 评论的内容 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $path 文件的相对路径 (optional) + * @param int $position Diff的相对行数 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\CompleteBranch + * @return \Gitee\Model\Note */ - public function postV5ReposOwnerRepoBranches($owner, $repo, $refs, $branchName, $accessToken = null) + public function postV5ReposOwnerRepoCommitsShaComments($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) { - list($response) = $this->postV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken); + list($response) = $this->postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo($owner, $repo, $sha, $body, $accessToken, $path, $position); return $response; } /** - * Operation postV5ReposOwnerRepoBranchesWithHttpInfo + * Operation postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo * - * 创建分支 + * 创建Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $refs 起点名称, 默认:master (required) - * @param string $branchName 新创建的分支名称 (required) + * @param string $sha 评论的sha值 (required) + * @param string $body 评论的内容 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $path 文件的相对路径 (optional) + * @param int $position Diff的相对行数 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\CompleteBranch, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken = null) + public function postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) { - $returnType = '\Gitee\Model\CompleteBranch'; - $request = $this->postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $branchName, $accessToken); + $returnType = '\Gitee\Model\Note'; + $request = $this->postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, $sha, $body, $accessToken, $path, $position); try { $options = $this->createHttpClientOption(); @@ -14976,7 +18238,7 @@ public function postV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $refs, $ case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\CompleteBranch', + '\Gitee\Model\Note', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14987,22 +18249,24 @@ public function postV5ReposOwnerRepoBranchesWithHttpInfo($owner, $repo, $refs, $ } /** - * Operation postV5ReposOwnerRepoBranchesAsync + * Operation postV5ReposOwnerRepoCommitsShaCommentsAsync * - * 创建分支 + * 创建Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $refs 起点名称, 默认:master (required) - * @param string $branchName 新创建的分支名称 (required) + * @param string $sha 评论的sha值 (required) + * @param string $body 评论的内容 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $path 文件的相对路径 (optional) + * @param int $position Diff的相对行数 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoBranchesAsync($owner, $repo, $refs, $branchName, $accessToken = null) + public function postV5ReposOwnerRepoCommitsShaCommentsAsync($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) { - return $this->postV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken) + return $this->postV5ReposOwnerRepoCommitsShaCommentsAsyncWithHttpInfo($owner, $repo, $sha, $body, $accessToken, $path, $position) ->then( function ($response) { return $response[0]; @@ -15011,23 +18275,25 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoBranchesAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoCommitsShaCommentsAsyncWithHttpInfo * - * 创建分支 + * 创建Commit评论 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $refs 起点名称, 默认:master (required) - * @param string $branchName 新创建的分支名称 (required) + * @param string $sha 评论的sha值 (required) + * @param string $body 评论的内容 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $path 文件的相对路径 (optional) + * @param int $position Diff的相对行数 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoBranchesAsyncWithHttpInfo($owner, $repo, $refs, $branchName, $accessToken = null) + public function postV5ReposOwnerRepoCommitsShaCommentsAsyncWithHttpInfo($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) { - $returnType = '\Gitee\Model\CompleteBranch'; - $request = $this->postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $branchName, $accessToken); + $returnType = '\Gitee\Model\Note'; + $request = $this->postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, $sha, $body, $accessToken, $path, $position); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15067,45 +18333,47 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoBranches' + * Create request for operation 'postV5ReposOwnerRepoCommitsShaComments' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $refs 起点名称, 默认:master (required) - * @param string $branchName 新创建的分支名称 (required) + * @param string $sha 评论的sha值 (required) + * @param string $body 评论的内容 (required) * @param string $accessToken 用户授权码 (optional) + * @param string $path 文件的相对路径 (optional) + * @param int $position Diff的相对行数 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $branchName, $accessToken = null) + protected function postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoBranches' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoCommitsShaComments' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoBranches' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoCommitsShaComments' ); } - // verify the required parameter 'refs' is set - if ($refs === null || (is_array($refs) && count($refs) === 0)) { + // verify the required parameter 'sha' is set + if ($sha === null || (is_array($sha) && count($sha) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $refs when calling postV5ReposOwnerRepoBranches' + 'Missing the required parameter $sha when calling postV5ReposOwnerRepoCommitsShaComments' ); } - // verify the required parameter 'branchName' is set - if ($branchName === null || (is_array($branchName) && count($branchName) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $branchName when calling postV5ReposOwnerRepoBranches' + 'Missing the required parameter $body when calling postV5ReposOwnerRepoCommitsShaComments' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/branches'; + $resourcePath = '/v5/repos/{owner}/{repo}/commits/{sha}/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15129,18 +18397,30 @@ protected function postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $br $resourcePath ); } + // path params + if ($sha !== null) { + $resourcePath = str_replace( + '{' . 'sha' . '}', + ObjectSerializer::toPathValue($sha), + $resourcePath + ); + } // form params if ($accessToken !== null) { $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } // form params - if ($refs !== null) { - $formParams['refs'] = ObjectSerializer::toFormValue($refs); + if ($body !== null) { + $formParams['body'] = ObjectSerializer::toFormValue($body); } // form params - if ($branchName !== null) { - $formParams['branch_name'] = ObjectSerializer::toFormValue($branchName); + if ($path !== null) { + $formParams['path'] = ObjectSerializer::toFormValue($path); + } + // form params + if ($position !== null) { + $formParams['position'] = ObjectSerializer::toFormValue($position); } // body params $_tempBody = null; @@ -15214,49 +18494,57 @@ protected function postV5ReposOwnerRepoBranchesRequest($owner, $repo, $refs, $br } /** - * Operation postV5ReposOwnerRepoCommitsShaComments + * Operation postV5ReposOwnerRepoContentsPath * - * 创建Commit评论 + * 新建文件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 评论的sha值 (required) - * @param string $body 评论的内容 (required) + * @param string $path 文件的路径 (required) + * @param string $content 文件内容, 要用 base64 编码 (required) + * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $path 文件的相对路径 (optional) - * @param int $position Diff的相对行数 (optional) + * @param string $branch 分支名称。默认为仓库对默认分支 (optional) + * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) + * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) + * @param string $authorName Author的名字,默认为当前用户的名字 (optional) + * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Note + * @return \Gitee\Model\CommitContent */ - public function postV5ReposOwnerRepoCommitsShaComments($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) + public function postV5ReposOwnerRepoContentsPath($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) { - list($response) = $this->postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo($owner, $repo, $sha, $body, $accessToken, $path, $position); + list($response) = $this->postV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail); return $response; } /** - * Operation postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo + * Operation postV5ReposOwnerRepoContentsPathWithHttpInfo * - * 创建Commit评论 + * 新建文件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 评论的sha值 (required) - * @param string $body 评论的内容 (required) + * @param string $path 文件的路径 (required) + * @param string $content 文件内容, 要用 base64 编码 (required) + * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $path 文件的相对路径 (optional) - * @param int $position Diff的相对行数 (optional) + * @param string $branch 分支名称。默认为仓库对默认分支 (optional) + * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) + * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) + * @param string $authorName Author的名字,默认为当前用户的名字 (optional) + * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Note, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\CommitContent, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) + public function postV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, $sha, $body, $accessToken, $path, $position); + $returnType = '\Gitee\Model\CommitContent'; + $request = $this->postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail); try { $options = $this->createHttpClientOption(); @@ -15307,7 +18595,7 @@ public function postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo($owner, $repo case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Note', + '\Gitee\Model\CommitContent', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15318,24 +18606,28 @@ public function postV5ReposOwnerRepoCommitsShaCommentsWithHttpInfo($owner, $repo } /** - * Operation postV5ReposOwnerRepoCommitsShaCommentsAsync + * Operation postV5ReposOwnerRepoContentsPathAsync * - * 创建Commit评论 + * 新建文件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 评论的sha值 (required) - * @param string $body 评论的内容 (required) + * @param string $path 文件的路径 (required) + * @param string $content 文件内容, 要用 base64 编码 (required) + * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $path 文件的相对路径 (optional) - * @param int $position Diff的相对行数 (optional) + * @param string $branch 分支名称。默认为仓库对默认分支 (optional) + * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) + * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) + * @param string $authorName Author的名字,默认为当前用户的名字 (optional) + * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoCommitsShaCommentsAsync($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) + public function postV5ReposOwnerRepoContentsPathAsync($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) { - return $this->postV5ReposOwnerRepoCommitsShaCommentsAsyncWithHttpInfo($owner, $repo, $sha, $body, $accessToken, $path, $position) + return $this->postV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail) ->then( function ($response) { return $response[0]; @@ -15344,25 +18636,29 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoCommitsShaCommentsAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoContentsPathAsyncWithHttpInfo * - * 创建Commit评论 + * 新建文件 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $sha 评论的sha值 (required) - * @param string $body 评论的内容 (required) + * @param string $path 文件的路径 (required) + * @param string $content 文件内容, 要用 base64 编码 (required) + * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $path 文件的相对路径 (optional) - * @param int $position Diff的相对行数 (optional) + * @param string $branch 分支名称。默认为仓库对默认分支 (optional) + * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) + * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) + * @param string $authorName Author的名字,默认为当前用户的名字 (optional) + * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoCommitsShaCommentsAsyncWithHttpInfo($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) + public function postV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) { - $returnType = '\Gitee\Model\Note'; - $request = $this->postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, $sha, $body, $accessToken, $path, $position); + $returnType = '\Gitee\Model\CommitContent'; + $request = $this->postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15402,47 +18698,57 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoCommitsShaComments' + * Create request for operation 'postV5ReposOwnerRepoContentsPath' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) - * @param string $sha 评论的sha值 (required) - * @param string $body 评论的内容 (required) + * @param string $repo 仓库路径(path) (required) + * @param string $path 文件的路径 (required) + * @param string $content 文件内容, 要用 base64 编码 (required) + * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $path 文件的相对路径 (optional) - * @param int $position Diff的相对行数 (optional) + * @param string $branch 分支名称。默认为仓库对默认分支 (optional) + * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) + * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) + * @param string $authorName Author的名字,默认为当前用户的名字 (optional) + * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, $sha, $body, $accessToken = null, $path = null, $position = null) + protected function postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoCommitsShaComments' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoContentsPath' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoCommitsShaComments' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoContentsPath' ); } - // verify the required parameter 'sha' is set - if ($sha === null || (is_array($sha) && count($sha) === 0)) { + // verify the required parameter 'path' is set + if ($path === null || (is_array($path) && count($path) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $sha when calling postV5ReposOwnerRepoCommitsShaComments' + 'Missing the required parameter $path when calling postV5ReposOwnerRepoContentsPath' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'content' is set + if ($content === null || (is_array($content) && count($content) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling postV5ReposOwnerRepoCommitsShaComments' + 'Missing the required parameter $content when calling postV5ReposOwnerRepoContentsPath' + ); + } + // verify the required parameter 'message' is set + if ($message === null || (is_array($message) && count($message) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $message when calling postV5ReposOwnerRepoContentsPath' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/commits/{sha}/comments'; + $resourcePath = '/v5/repos/{owner}/{repo}/contents/{path}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15467,10 +18773,10 @@ protected function postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, ); } // path params - if ($sha !== null) { + if ($path !== null) { $resourcePath = str_replace( - '{' . 'sha' . '}', - ObjectSerializer::toPathValue($sha), + '{' . 'path' . '}', + ObjectSerializer::toPathValue($path), $resourcePath ); } @@ -15480,16 +18786,32 @@ protected function postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } // form params - if ($body !== null) { - $formParams['body'] = ObjectSerializer::toFormValue($body); + if ($content !== null) { + $formParams['content'] = ObjectSerializer::toFormValue($content); } // form params - if ($path !== null) { - $formParams['path'] = ObjectSerializer::toFormValue($path); + if ($message !== null) { + $formParams['message'] = ObjectSerializer::toFormValue($message); } // form params - if ($position !== null) { - $formParams['position'] = ObjectSerializer::toFormValue($position); + if ($branch !== null) { + $formParams['branch'] = ObjectSerializer::toFormValue($branch); + } + // form params + if ($committerName !== null) { + $formParams['committer[name]'] = ObjectSerializer::toFormValue($committerName); + } + // form params + if ($committerEmail !== null) { + $formParams['committer[email]'] = ObjectSerializer::toFormValue($committerEmail); + } + // form params + if ($authorName !== null) { + $formParams['author[name]'] = ObjectSerializer::toFormValue($authorName); + } + // form params + if ($authorEmail !== null) { + $formParams['author[email]'] = ObjectSerializer::toFormValue($authorEmail); } // body params $_tempBody = null; @@ -15563,57 +18885,47 @@ protected function postV5ReposOwnerRepoCommitsShaCommentsRequest($owner, $repo, } /** - * Operation postV5ReposOwnerRepoContentsPath + * Operation postV5ReposOwnerRepoForks * - * 新建文件 + * Fork一个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) - * @param string $content 文件内容, 要用 base64 编码 (required) - * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $branch 分支名称。默认为仓库对默认分支 (optional) - * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) - * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) - * @param string $authorName Author的名字,默认为当前用户的名字 (optional) - * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) + * @param string $organization 组织空间完整地址,不填写默认Fork到用户个人空间地址 (optional) + * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) + * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\CommitContent + * @return \Gitee\Model\Project */ - public function postV5ReposOwnerRepoContentsPath($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) + public function postV5ReposOwnerRepoForks($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) { - list($response) = $this->postV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail); + list($response) = $this->postV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken, $organization, $name, $path); return $response; } /** - * Operation postV5ReposOwnerRepoContentsPathWithHttpInfo + * Operation postV5ReposOwnerRepoForksWithHttpInfo * - * 新建文件 + * Fork一个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) - * @param string $content 文件内容, 要用 base64 编码 (required) - * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $branch 分支名称。默认为仓库对默认分支 (optional) - * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) - * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) - * @param string $authorName Author的名字,默认为当前用户的名字 (optional) - * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) + * @param string $organization 组织空间完整地址,不填写默认Fork到用户个人空间地址 (optional) + * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) + * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\CommitContent, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) + public function postV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) { - $returnType = '\Gitee\Model\CommitContent'; - $request = $this->postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail); + $returnType = '\Gitee\Model\Project'; + $request = $this->postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $organization, $name, $path); try { $options = $this->createHttpClientOption(); @@ -15664,7 +18976,7 @@ public function postV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $pat case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\CommitContent', + '\Gitee\Model\Project', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15675,28 +18987,23 @@ public function postV5ReposOwnerRepoContentsPathWithHttpInfo($owner, $repo, $pat } /** - * Operation postV5ReposOwnerRepoContentsPathAsync + * Operation postV5ReposOwnerRepoForksAsync * - * 新建文件 + * Fork一个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) - * @param string $content 文件内容, 要用 base64 编码 (required) - * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $branch 分支名称。默认为仓库对默认分支 (optional) - * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) - * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) - * @param string $authorName Author的名字,默认为当前用户的名字 (optional) - * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) + * @param string $organization 组织空间完整地址,不填写默认Fork到用户个人空间地址 (optional) + * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) + * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoContentsPathAsync($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) + public function postV5ReposOwnerRepoForksAsync($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) { - return $this->postV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail) + return $this->postV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken, $organization, $name, $path) ->then( function ($response) { return $response[0]; @@ -15705,29 +19012,24 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoContentsPathAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoForksAsyncWithHttpInfo * - * 新建文件 + * Fork一个仓库 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) - * @param string $content 文件内容, 要用 base64 编码 (required) - * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $branch 分支名称。默认为仓库对默认分支 (optional) - * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) - * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) - * @param string $authorName Author的名字,默认为当前用户的名字 (optional) - * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) + * @param string $organization 组织空间完整地址,不填写默认Fork到用户个人空间地址 (optional) + * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) + * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoContentsPathAsyncWithHttpInfo($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) + public function postV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) { - $returnType = '\Gitee\Model\CommitContent'; - $request = $this->postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $content, $message, $accessToken, $branch, $committerName, $committerEmail, $authorName, $authorEmail); + $returnType = '\Gitee\Model\Project'; + $request = $this->postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $organization, $name, $path); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15767,57 +19069,34 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoContentsPath' + * Create request for operation 'postV5ReposOwnerRepoForks' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $path 文件的路径 (required) - * @param string $content 文件内容, 要用 base64 编码 (required) - * @param string $message 提交信息 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $branch 分支名称。默认为仓库对默认分支 (optional) - * @param string $committerName Committer的名字,默认为当前用户的名字 (optional) - * @param string $committerEmail Committer的邮箱,默认为当前用户的邮箱 (optional) - * @param string $authorName Author的名字,默认为当前用户的名字 (optional) - * @param string $authorEmail Author的邮箱,默认为当前用户的邮箱 (optional) + * @param string $organization 组织空间完整地址,不填写默认Fork到用户个人空间地址 (optional) + * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) + * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $content, $message, $accessToken = null, $branch = null, $committerName = null, $committerEmail = null, $authorName = null, $authorEmail = null) + protected function postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoContentsPath' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoForks' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoContentsPath' - ); - } - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling postV5ReposOwnerRepoContentsPath' - ); - } - // verify the required parameter 'content' is set - if ($content === null || (is_array($content) && count($content) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $content when calling postV5ReposOwnerRepoContentsPath' - ); - } - // verify the required parameter 'message' is set - if ($message === null || (is_array($message) && count($message) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $message when calling postV5ReposOwnerRepoContentsPath' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoForks' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/contents/{path}'; + $resourcePath = '/v5/repos/{owner}/{repo}/forks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15841,46 +19120,22 @@ protected function postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, $resourcePath ); } - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), - $resourcePath - ); - } // form params if ($accessToken !== null) { $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } // form params - if ($content !== null) { - $formParams['content'] = ObjectSerializer::toFormValue($content); - } - // form params - if ($message !== null) { - $formParams['message'] = ObjectSerializer::toFormValue($message); - } - // form params - if ($branch !== null) { - $formParams['branch'] = ObjectSerializer::toFormValue($branch); - } - // form params - if ($committerName !== null) { - $formParams['committer[name]'] = ObjectSerializer::toFormValue($committerName); - } - // form params - if ($committerEmail !== null) { - $formParams['committer[email]'] = ObjectSerializer::toFormValue($committerEmail); + if ($organization !== null) { + $formParams['organization'] = ObjectSerializer::toFormValue($organization); } // form params - if ($authorName !== null) { - $formParams['author[name]'] = ObjectSerializer::toFormValue($authorName); + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); } // form params - if ($authorEmail !== null) { - $formParams['author[email]'] = ObjectSerializer::toFormValue($authorEmail); + if ($path !== null) { + $formParams['path'] = ObjectSerializer::toFormValue($path); } // body params $_tempBody = null; @@ -15954,47 +19209,45 @@ protected function postV5ReposOwnerRepoContentsPathRequest($owner, $repo, $path, } /** - * Operation postV5ReposOwnerRepoForks + * Operation postV5ReposOwnerRepoKeys * - * Fork一个仓库 + * 为仓库添加公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $key 公钥内容 (required) + * @param string $title 公钥名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $organization 组织空间地址,不填写默认Fork到用户个人空间地址 (optional) - * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) - * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Project + * @return \Gitee\Model\SSHKey */ - public function postV5ReposOwnerRepoForks($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) + public function postV5ReposOwnerRepoKeys($owner, $repo, $key, $title, $accessToken = null) { - list($response) = $this->postV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken, $organization, $name, $path); + list($response) = $this->postV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $key, $title, $accessToken); return $response; } /** - * Operation postV5ReposOwnerRepoForksWithHttpInfo + * Operation postV5ReposOwnerRepoKeysWithHttpInfo * - * Fork一个仓库 + * 为仓库添加公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $key 公钥内容 (required) + * @param string $title 公钥名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $organization 组织空间地址,不填写默认Fork到用户个人空间地址 (optional) - * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) - * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\SSHKey, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) + public function postV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $key, $title, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $organization, $name, $path); + $returnType = '\Gitee\Model\SSHKey'; + $request = $this->postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, $accessToken); try { $options = $this->createHttpClientOption(); @@ -16045,7 +19298,7 @@ public function postV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToke case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Project', + '\Gitee\Model\SSHKey', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16056,23 +19309,22 @@ public function postV5ReposOwnerRepoForksWithHttpInfo($owner, $repo, $accessToke } /** - * Operation postV5ReposOwnerRepoForksAsync + * Operation postV5ReposOwnerRepoKeysAsync * - * Fork一个仓库 + * 为仓库添加公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $key 公钥内容 (required) + * @param string $title 公钥名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $organization 组织空间地址,不填写默认Fork到用户个人空间地址 (optional) - * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) - * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoForksAsync($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) + public function postV5ReposOwnerRepoKeysAsync($owner, $repo, $key, $title, $accessToken = null) { - return $this->postV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken, $organization, $name, $path) + return $this->postV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $key, $title, $accessToken) ->then( function ($response) { return $response[0]; @@ -16081,24 +19333,23 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoForksAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoKeysAsyncWithHttpInfo * - * Fork一个仓库 + * 为仓库添加公钥 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $key 公钥内容 (required) + * @param string $title 公钥名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $organization 组织空间地址,不填写默认Fork到用户个人空间地址 (optional) - * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) - * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoForksAsyncWithHttpInfo($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) + public function postV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $key, $title, $accessToken = null) { - $returnType = '\Gitee\Model\Project'; - $request = $this->postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken, $organization, $name, $path); + $returnType = '\Gitee\Model\SSHKey'; + $request = $this->postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16138,34 +19389,45 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoForks' + * Create request for operation 'postV5ReposOwnerRepoKeys' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $key 公钥内容 (required) + * @param string $title 公钥名称 (required) * @param string $accessToken 用户授权码 (optional) - * @param string $organization 组织空间地址,不填写默认Fork到用户个人空间地址 (optional) - * @param string $name fork 后仓库名称。默认: 源仓库名称 (optional) - * @param string $path fork 后仓库地址。默认: 源仓库地址 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken = null, $organization = null, $name = null, $path = null) + protected function postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoForks' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoKeys' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoForks' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoKeys' + ); + } + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling postV5ReposOwnerRepoKeys' + ); + } + // verify the required parameter 'title' is set + if ($title === null || (is_array($title) && count($title) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $title when calling postV5ReposOwnerRepoKeys' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/forks'; + $resourcePath = '/v5/repos/{owner}/{repo}/keys'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16195,16 +19457,12 @@ protected function postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } // form params - if ($organization !== null) { - $formParams['organization'] = ObjectSerializer::toFormValue($organization); - } - // form params - if ($name !== null) { - $formParams['name'] = ObjectSerializer::toFormValue($name); + if ($key !== null) { + $formParams['key'] = ObjectSerializer::toFormValue($key); } // form params - if ($path !== null) { - $formParams['path'] = ObjectSerializer::toFormValue($path); + if ($title !== null) { + $formParams['title'] = ObjectSerializer::toFormValue($title); } // body params $_tempBody = null; @@ -16278,45 +19536,40 @@ protected function postV5ReposOwnerRepoForksRequest($owner, $repo, $accessToken } /** - * Operation postV5ReposOwnerRepoKeys + * Operation postV5ReposOwnerRepoOpen * - * 为仓库添加公钥 + * 开通Gitee Go * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) - * @param string $key 公钥内容 (required) - * @param string $title 公钥名称 (required) + * @param string $repo 仓库path (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\SSHKey + * @return void */ - public function postV5ReposOwnerRepoKeys($owner, $repo, $key, $title, $accessToken = null) + public function postV5ReposOwnerRepoOpen($owner, $repo, $accessToken = null) { - list($response) = $this->postV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $key, $title, $accessToken); - return $response; + $this->postV5ReposOwnerRepoOpenWithHttpInfo($owner, $repo, $accessToken); } /** - * Operation postV5ReposOwnerRepoKeysWithHttpInfo + * Operation postV5ReposOwnerRepoOpenWithHttpInfo * - * 为仓库添加公钥 + * 开通Gitee Go * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) - * @param string $key 公钥内容 (required) - * @param string $title 公钥名称 (required) + * @param string $repo 仓库path (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\SSHKey, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $key, $title, $accessToken = null) + public function postV5ReposOwnerRepoOpenWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\SSHKey'; - $request = $this->postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, $accessToken); + $returnType = ''; + $request = $this->postV5ReposOwnerRepoOpenRequest($owner, $repo, $accessToken); try { $options = $this->createHttpClientOption(); @@ -16346,54 +19599,30 @@ public function postV5ReposOwnerRepoKeysWithHttpInfo($owner, $repo, $key, $title ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Gitee\Model\SSHKey', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation postV5ReposOwnerRepoKeysAsync + * Operation postV5ReposOwnerRepoOpenAsync * - * 为仓库添加公钥 + * 开通Gitee Go * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) - * @param string $key 公钥内容 (required) - * @param string $title 公钥名称 (required) + * @param string $repo 仓库path (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoKeysAsync($owner, $repo, $key, $title, $accessToken = null) + public function postV5ReposOwnerRepoOpenAsync($owner, $repo, $accessToken = null) { - return $this->postV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $key, $title, $accessToken) + return $this->postV5ReposOwnerRepoOpenAsyncWithHttpInfo($owner, $repo, $accessToken) ->then( function ($response) { return $response[0]; @@ -16402,43 +19631,27 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoKeysAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoOpenAsyncWithHttpInfo * - * 为仓库添加公钥 + * 开通Gitee Go * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) - * @param string $key 公钥内容 (required) - * @param string $title 公钥名称 (required) + * @param string $repo 仓库path (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoKeysAsyncWithHttpInfo($owner, $repo, $key, $title, $accessToken = null) + public function postV5ReposOwnerRepoOpenAsyncWithHttpInfo($owner, $repo, $accessToken = null) { - $returnType = '\Gitee\Model\SSHKey'; - $request = $this->postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, $accessToken); + $returnType = ''; + $request = $this->postV5ReposOwnerRepoOpenRequest($owner, $repo, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -16458,45 +19671,31 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoKeys' + * Create request for operation 'postV5ReposOwnerRepoOpen' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库路径(path) (required) - * @param string $key 公钥内容 (required) - * @param string $title 公钥名称 (required) + * @param string $repo 仓库path (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, $accessToken = null) + protected function postV5ReposOwnerRepoOpenRequest($owner, $repo, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoKeys' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoOpen' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoKeys' - ); - } - // verify the required parameter 'key' is set - if ($key === null || (is_array($key) && count($key) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $key when calling postV5ReposOwnerRepoKeys' - ); - } - // verify the required parameter 'title' is set - if ($title === null || (is_array($title) && count($title) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $title when calling postV5ReposOwnerRepoKeys' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoOpen' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/keys'; + $resourcePath = '/v5/repos/{owner}/{repo}/open'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16525,14 +19724,6 @@ protected function postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, if ($accessToken !== null) { $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } - // form params - if ($key !== null) { - $formParams['key'] = ObjectSerializer::toFormValue($key); - } - // form params - if ($title !== null) { - $formParams['title'] = ObjectSerializer::toFormValue($title); - } // body params $_tempBody = null; @@ -16605,40 +19796,40 @@ protected function postV5ReposOwnerRepoKeysRequest($owner, $repo, $key, $title, } /** - * Operation postV5ReposOwnerRepoOpen + * Operation postV5ReposOwnerRepoPagesBuilds * - * 开通Gitee Go + * 请求建立Pages * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库path (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function postV5ReposOwnerRepoOpen($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoPagesBuilds($owner, $repo, $accessToken = null) { - $this->postV5ReposOwnerRepoOpenWithHttpInfo($owner, $repo, $accessToken); + $this->postV5ReposOwnerRepoPagesBuildsWithHttpInfo($owner, $repo, $accessToken); } /** - * Operation postV5ReposOwnerRepoOpenWithHttpInfo + * Operation postV5ReposOwnerRepoPagesBuildsWithHttpInfo * - * 开通Gitee Go + * 请求建立Pages * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库path (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoOpenWithHttpInfo($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoPagesBuildsWithHttpInfo($owner, $repo, $accessToken = null) { $returnType = ''; - $request = $this->postV5ReposOwnerRepoOpenRequest($owner, $repo, $accessToken); + $request = $this->postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $accessToken); try { $options = $this->createHttpClientOption(); @@ -16678,20 +19869,20 @@ public function postV5ReposOwnerRepoOpenWithHttpInfo($owner, $repo, $accessToken } /** - * Operation postV5ReposOwnerRepoOpenAsync + * Operation postV5ReposOwnerRepoPagesBuildsAsync * - * 开通Gitee Go + * 请求建立Pages * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库path (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoOpenAsync($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoPagesBuildsAsync($owner, $repo, $accessToken = null) { - return $this->postV5ReposOwnerRepoOpenAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->postV5ReposOwnerRepoPagesBuildsAsyncWithHttpInfo($owner, $repo, $accessToken) ->then( function ($response) { return $response[0]; @@ -16700,21 +19891,21 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoOpenAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoPagesBuildsAsyncWithHttpInfo * - * 开通Gitee Go + * 请求建立Pages * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库path (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoOpenAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoPagesBuildsAsyncWithHttpInfo($owner, $repo, $accessToken = null) { $returnType = ''; - $request = $this->postV5ReposOwnerRepoOpenRequest($owner, $repo, $accessToken); + $request = $this->postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16740,31 +19931,31 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoOpen' + * Create request for operation 'postV5ReposOwnerRepoPagesBuilds' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) - * @param string $repo 仓库path (required) + * @param string $repo 仓库路径(path) (required) * @param string $accessToken 用户授权码 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoOpenRequest($owner, $repo, $accessToken = null) + protected function postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoOpen' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoPagesBuilds' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoOpen' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoPagesBuilds' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/open'; + $resourcePath = '/v5/repos/{owner}/{repo}/pages/builds'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16865,40 +20056,51 @@ protected function postV5ReposOwnerRepoOpenRequest($owner, $repo, $accessToken = } /** - * Operation postV5ReposOwnerRepoPagesBuilds + * Operation postV5ReposOwnerRepoReleases * - * 请求建立Pages + * 创建仓库Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Gitee\Model\Release */ - public function postV5ReposOwnerRepoPagesBuilds($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoReleases($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) { - $this->postV5ReposOwnerRepoPagesBuildsWithHttpInfo($owner, $repo, $accessToken); + list($response) = $this->postV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease); + return $response; } /** - * Operation postV5ReposOwnerRepoPagesBuildsWithHttpInfo + * Operation postV5ReposOwnerRepoReleasesWithHttpInfo * - * 请求建立Pages + * 创建仓库Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoPagesBuildsWithHttpInfo($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) { - $returnType = ''; - $request = $this->postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Release'; + $request = $this->postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease); try { $options = $this->createHttpClientOption(); @@ -16928,30 +20130,57 @@ public function postV5ReposOwnerRepoPagesBuildsWithHttpInfo($owner, $repo, $acce ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gitee\Model\Release', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation postV5ReposOwnerRepoPagesBuildsAsync + * Operation postV5ReposOwnerRepoReleasesAsync * - * 请求建立Pages + * 创建仓库Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoPagesBuildsAsync($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoReleasesAsync($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) { - return $this->postV5ReposOwnerRepoPagesBuildsAsyncWithHttpInfo($owner, $repo, $accessToken) + return $this->postV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease) ->then( function ($response) { return $response[0]; @@ -16960,27 +20189,46 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoPagesBuildsAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoReleasesAsyncWithHttpInfo * - * 请求建立Pages + * 创建仓库Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoPagesBuildsAsyncWithHttpInfo($owner, $repo, $accessToken = null) + public function postV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) { - $returnType = ''; - $request = $this->postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $accessToken); + $returnType = '\Gitee\Model\Release'; + $request = $this->postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -17000,31 +20248,60 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoPagesBuilds' + * Create request for operation 'postV5ReposOwnerRepoReleases' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) + * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) + * @param string $name Release 名称 (required) + * @param string $body Release 描述 (required) + * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) * @param string $accessToken 用户授权码 (optional) + * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $accessToken = null) + protected function postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoPagesBuilds' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoReleases' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoPagesBuilds' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoReleases' + ); + } + // verify the required parameter 'tagName' is set + if ($tagName === null || (is_array($tagName) && count($tagName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tagName when calling postV5ReposOwnerRepoReleases' + ); + } + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling postV5ReposOwnerRepoReleases' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling postV5ReposOwnerRepoReleases' + ); + } + // verify the required parameter 'targetCommitish' is set + if ($targetCommitish === null || (is_array($targetCommitish) && count($targetCommitish) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $targetCommitish when calling postV5ReposOwnerRepoReleases' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/pages/builds'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17053,6 +20330,26 @@ protected function postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $access if ($accessToken !== null) { $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } + // form params + if ($tagName !== null) { + $formParams['tag_name'] = ObjectSerializer::toFormValue($tagName); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($body !== null) { + $formParams['body'] = ObjectSerializer::toFormValue($body); + } + // form params + if ($prerelease !== null) { + $formParams['prerelease'] = ObjectSerializer::toFormValue($prerelease); + } + // form params + if ($targetCommitish !== null) { + $formParams['target_commitish'] = ObjectSerializer::toFormValue($targetCommitish); + } // body params $_tempBody = null; @@ -17125,51 +20422,45 @@ protected function postV5ReposOwnerRepoPagesBuildsRequest($owner, $repo, $access } /** - * Operation postV5ReposOwnerRepoReleases + * Operation postV5ReposOwnerRepoReleasesReleaseIdAttachFiles * - * 创建仓库Release + * 上传附件到仓库指定 Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) + * @param int $releaseId 发行版本的ID (required) + * @param \SplFileObject $file 上传的文件 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Release + * @return \Gitee\Model\AttachFile */ - public function postV5ReposOwnerRepoReleases($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) + public function postV5ReposOwnerRepoReleasesReleaseIdAttachFiles($owner, $repo, $releaseId, $file, $accessToken = null) { - list($response) = $this->postV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease); + list($response) = $this->postV5ReposOwnerRepoReleasesReleaseIdAttachFilesWithHttpInfo($owner, $repo, $releaseId, $file, $accessToken); return $response; } /** - * Operation postV5ReposOwnerRepoReleasesWithHttpInfo + * Operation postV5ReposOwnerRepoReleasesReleaseIdAttachFilesWithHttpInfo * - * 创建仓库Release + * 上传附件到仓库指定 Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) + * @param int $releaseId 发行版本的ID (required) + * @param \SplFileObject $file 上传的文件 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Release, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\AttachFile, HTTP status code, HTTP response headers (array of strings) */ - public function postV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) + public function postV5ReposOwnerRepoReleasesReleaseIdAttachFilesWithHttpInfo($owner, $repo, $releaseId, $file, $accessToken = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease); + $returnType = '\Gitee\Model\AttachFile'; + $request = $this->postV5ReposOwnerRepoReleasesReleaseIdAttachFilesRequest($owner, $repo, $releaseId, $file, $accessToken); try { $options = $this->createHttpClientOption(); @@ -17220,7 +20511,7 @@ public function postV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $tagName case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Release', + '\Gitee\Model\AttachFile', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17231,25 +20522,22 @@ public function postV5ReposOwnerRepoReleasesWithHttpInfo($owner, $repo, $tagName } /** - * Operation postV5ReposOwnerRepoReleasesAsync + * Operation postV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsync * - * 创建仓库Release + * 上传附件到仓库指定 Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) + * @param int $releaseId 发行版本的ID (required) + * @param \SplFileObject $file 上传的文件 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoReleasesAsync($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) + public function postV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsync($owner, $repo, $releaseId, $file, $accessToken = null) { - return $this->postV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease) + return $this->postV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsyncWithHttpInfo($owner, $repo, $releaseId, $file, $accessToken) ->then( function ($response) { return $response[0]; @@ -17258,26 +20546,23 @@ function ($response) { } /** - * Operation postV5ReposOwnerRepoReleasesAsyncWithHttpInfo + * Operation postV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsyncWithHttpInfo * - * 创建仓库Release + * 上传附件到仓库指定 Release * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) + * @param int $releaseId 发行版本的ID (required) + * @param \SplFileObject $file 上传的文件 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postV5ReposOwnerRepoReleasesAsyncWithHttpInfo($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) + public function postV5ReposOwnerRepoReleasesReleaseIdAttachFilesAsyncWithHttpInfo($owner, $repo, $releaseId, $file, $accessToken = null) { - $returnType = '\Gitee\Model\Release'; - $request = $this->postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken, $prerelease); + $returnType = '\Gitee\Model\AttachFile'; + $request = $this->postV5ReposOwnerRepoReleasesReleaseIdAttachFilesRequest($owner, $repo, $releaseId, $file, $accessToken); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17317,60 +20602,45 @@ function ($exception) { } /** - * Create request for operation 'postV5ReposOwnerRepoReleases' + * Create request for operation 'postV5ReposOwnerRepoReleasesReleaseIdAttachFiles' * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) - * @param string $tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 (required) - * @param string $name Release 名称 (required) - * @param string $body Release 描述 (required) - * @param string $targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 (required) + * @param int $releaseId 发行版本的ID (required) + * @param \SplFileObject $file 上传的文件 (required) * @param string $accessToken 用户授权码 (optional) - * @param bool $prerelease 是否为预览版本。默认: false(非预览版本) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, $name, $body, $targetCommitish, $accessToken = null, $prerelease = null) + protected function postV5ReposOwnerRepoReleasesReleaseIdAttachFilesRequest($owner, $repo, $releaseId, $file, $accessToken = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $owner when calling postV5ReposOwnerRepoReleases' + 'Missing the required parameter $owner when calling postV5ReposOwnerRepoReleasesReleaseIdAttachFiles' ); } // verify the required parameter 'repo' is set if ($repo === null || (is_array($repo) && count($repo) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $repo when calling postV5ReposOwnerRepoReleases' - ); - } - // verify the required parameter 'tagName' is set - if ($tagName === null || (is_array($tagName) && count($tagName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tagName when calling postV5ReposOwnerRepoReleases' - ); - } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling postV5ReposOwnerRepoReleases' + 'Missing the required parameter $repo when calling postV5ReposOwnerRepoReleasesReleaseIdAttachFiles' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'releaseId' is set + if ($releaseId === null || (is_array($releaseId) && count($releaseId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling postV5ReposOwnerRepoReleases' + 'Missing the required parameter $releaseId when calling postV5ReposOwnerRepoReleasesReleaseIdAttachFiles' ); } - // verify the required parameter 'targetCommitish' is set - if ($targetCommitish === null || (is_array($targetCommitish) && count($targetCommitish) === 0)) { + // verify the required parameter 'file' is set + if ($file === null || (is_array($file) && count($file) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $targetCommitish when calling postV5ReposOwnerRepoReleases' + 'Missing the required parameter $file when calling postV5ReposOwnerRepoReleasesReleaseIdAttachFiles' ); } - $resourcePath = '/v5/repos/{owner}/{repo}/releases'; + $resourcePath = '/v5/repos/{owner}/{repo}/releases/{release_id}/attach_files'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17394,30 +20664,23 @@ protected function postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, $resourcePath ); } + // path params + if ($releaseId !== null) { + $resourcePath = str_replace( + '{' . 'release_id' . '}', + ObjectSerializer::toPathValue($releaseId), + $resourcePath + ); + } // form params if ($accessToken !== null) { $formParams['access_token'] = ObjectSerializer::toFormValue($accessToken); } // form params - if ($tagName !== null) { - $formParams['tag_name'] = ObjectSerializer::toFormValue($tagName); - } - // form params - if ($name !== null) { - $formParams['name'] = ObjectSerializer::toFormValue($name); - } - // form params - if ($body !== null) { - $formParams['body'] = ObjectSerializer::toFormValue($body); - } - // form params - if ($prerelease !== null) { - $formParams['prerelease'] = ObjectSerializer::toFormValue($prerelease); - } - // form params - if ($targetCommitish !== null) { - $formParams['target_commitish'] = ObjectSerializer::toFormValue($targetCommitish); + if ($file !== null) { + $multipart = true; + $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); } // body params $_tempBody = null; @@ -17429,7 +20692,7 @@ protected function postV5ReposOwnerRepoReleasesRequest($owner, $repo, $tagName, } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + ['multipart/form-data'] ); } @@ -18824,47 +22087,49 @@ protected function putV5ReposOwnerRepoBranchesBranchProtectionRequest($owner, $r /** * Operation putV5ReposOwnerRepoBranchesSettingNew * - * 新建仓库保护分支策略 + * 新建保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Gitee\Model\ProtectionRule */ - public function putV5ReposOwnerRepoBranchesSettingNew($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null) + public function putV5ReposOwnerRepoBranchesSettingNew($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $escapseProtectBranchList = null) { - list($response) = $this->putV5ReposOwnerRepoBranchesSettingNewWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken); + list($response) = $this->putV5ReposOwnerRepoBranchesSettingNewWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $escapseProtectBranchList); return $response; } /** * Operation putV5ReposOwnerRepoBranchesSettingNewWithHttpInfo * - * 新建仓库保护分支策略 + * 新建保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Gitee\Model\ProtectionRule, HTTP status code, HTTP response headers (array of strings) */ - public function putV5ReposOwnerRepoBranchesSettingNewWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null) + public function putV5ReposOwnerRepoBranchesSettingNewWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $escapseProtectBranchList = null) { $returnType = '\Gitee\Model\ProtectionRule'; - $request = $this->putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken); + $request = $this->putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $escapseProtectBranchList); try { $options = $this->createHttpClientOption(); @@ -18928,22 +22193,23 @@ public function putV5ReposOwnerRepoBranchesSettingNewWithHttpInfo($owner, $repo, /** * Operation putV5ReposOwnerRepoBranchesSettingNewAsync * - * 新建仓库保护分支策略 + * 新建保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putV5ReposOwnerRepoBranchesSettingNewAsync($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null) + public function putV5ReposOwnerRepoBranchesSettingNewAsync($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $escapseProtectBranchList = null) { - return $this->putV5ReposOwnerRepoBranchesSettingNewAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken) + return $this->putV5ReposOwnerRepoBranchesSettingNewAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $escapseProtectBranchList) ->then( function ($response) { return $response[0]; @@ -18954,23 +22220,24 @@ function ($response) { /** * Operation putV5ReposOwnerRepoBranchesSettingNewAsyncWithHttpInfo * - * 新建仓库保护分支策略 + * 新建保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putV5ReposOwnerRepoBranchesSettingNewAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null) + public function putV5ReposOwnerRepoBranchesSettingNewAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $escapseProtectBranchList = null) { $returnType = '\Gitee\Model\ProtectionRule'; - $request = $this->putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken); + $request = $this->putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $escapseProtectBranchList); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19015,15 +22282,16 @@ function ($exception) { * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null) + protected function putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $escapseProtectBranchList = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { @@ -19107,6 +22375,10 @@ protected function putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $ if ($mode !== null) { $formParams['mode'] = ObjectSerializer::toFormValue($mode); } + // form params + if ($escapseProtectBranchList !== null) { + $formParams['escapse_protect_branch_list'] = ObjectSerializer::toFormValue($escapseProtectBranchList); + } // body params $_tempBody = null; @@ -19181,49 +22453,51 @@ protected function putV5ReposOwnerRepoBranchesSettingNewRequest($owner, $repo, $ /** * Operation putV5ReposOwnerRepoBranchesWildcardSetting * - * 分支保护策略设置 + * 更新保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) * @param string $newWildcard 新分支/通配符(为空不修改) (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Gitee\Model\ProtectionRule */ - public function putV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null) + public function putV5ReposOwnerRepoBranchesWildcardSetting($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null, $escapseProtectBranchList = null) { - list($response) = $this->putV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard); + list($response) = $this->putV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard, $escapseProtectBranchList); return $response; } /** * Operation putV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo * - * 分支保护策略设置 + * 更新保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) * @param string $newWildcard 新分支/通配符(为空不修改) (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Gitee\Model\ProtectionRule, HTTP status code, HTTP response headers (array of strings) */ - public function putV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null) + public function putV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null, $escapseProtectBranchList = null) { $returnType = '\Gitee\Model\ProtectionRule'; - $request = $this->putV5ReposOwnerRepoBranchesWildcardSettingRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard); + $request = $this->putV5ReposOwnerRepoBranchesWildcardSettingRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard, $escapseProtectBranchList); try { $options = $this->createHttpClientOption(); @@ -19287,23 +22561,24 @@ public function putV5ReposOwnerRepoBranchesWildcardSettingWithHttpInfo($owner, $ /** * Operation putV5ReposOwnerRepoBranchesWildcardSettingAsync * - * 分支保护策略设置 + * 更新保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) * @param string $newWildcard 新分支/通配符(为空不修改) (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putV5ReposOwnerRepoBranchesWildcardSettingAsync($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null) + public function putV5ReposOwnerRepoBranchesWildcardSettingAsync($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null, $escapseProtectBranchList = null) { - return $this->putV5ReposOwnerRepoBranchesWildcardSettingAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard) + return $this->putV5ReposOwnerRepoBranchesWildcardSettingAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard, $escapseProtectBranchList) ->then( function ($response) { return $response[0]; @@ -19314,24 +22589,25 @@ function ($response) { /** * Operation putV5ReposOwnerRepoBranchesWildcardSettingAsyncWithHttpInfo * - * 分支保护策略设置 + * 更新保护分支规则 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) * @param string $newWildcard 新分支/通配符(为空不修改) (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putV5ReposOwnerRepoBranchesWildcardSettingAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null) + public function putV5ReposOwnerRepoBranchesWildcardSettingAsyncWithHttpInfo($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null, $escapseProtectBranchList = null) { $returnType = '\Gitee\Model\ProtectionRule'; - $request = $this->putV5ReposOwnerRepoBranchesWildcardSettingRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard); + $request = $this->putV5ReposOwnerRepoBranchesWildcardSettingRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken, $newWildcard, $escapseProtectBranchList); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19376,16 +22652,17 @@ function ($exception) { * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) * @param string $wildcard 分支/通配符 (required) - * @param string $pusher admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $merger admin: 仓库管理员, none: 禁止任何人合并; 用户: 个人的地址path(多个用户用 ';' 隔开) (required) - * @param string $mode 模式 standard: 标准模式, review: 评审模式 (required) + * @param string $pusher 可推送代码成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $merger 可合并 Pull Request 成员。developer:仓库管理员和开发者;admin:仓库管理员;none:禁止任何人合并; 用户:个人的地址 path(多个用户用 ';' 隔开) (required) + * @param string $mode 模式。standard: 标准模式, review: 评审模式 (required) * @param string $accessToken 用户授权码 (optional) * @param string $newWildcard 新分支/通配符(为空不修改) (optional) + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function putV5ReposOwnerRepoBranchesWildcardSettingRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null) + protected function putV5ReposOwnerRepoBranchesWildcardSettingRequest($owner, $repo, $wildcard, $pusher, $merger, $mode, $accessToken = null, $newWildcard = null, $escapseProtectBranchList = null) { // verify the required parameter 'owner' is set if ($owner === null || (is_array($owner) && count($owner) === 0)) { @@ -19477,6 +22754,10 @@ protected function putV5ReposOwnerRepoBranchesWildcardSettingRequest($owner, $re if ($mode !== null) { $formParams['mode'] = ObjectSerializer::toFormValue($mode); } + // form params + if ($escapseProtectBranchList !== null) { + $formParams['escapse_protect_branch_list'] = ObjectSerializer::toFormValue($escapseProtectBranchList); + } // body params $_tempBody = null; @@ -19811,7 +23092,7 @@ protected function putV5ReposOwnerRepoClearRequest($owner, $repo, $accessToken = /** * Operation putV5ReposOwnerRepoCollaboratorsUsername * - * 添加仓库成员 + * 添加仓库成员或更新仓库成员权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -19832,7 +23113,7 @@ public function putV5ReposOwnerRepoCollaboratorsUsername($owner, $repo, $usernam /** * Operation putV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo * - * 添加仓库成员 + * 添加仓库成员或更新仓库成员权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -19911,7 +23192,7 @@ public function putV5ReposOwnerRepoCollaboratorsUsernameWithHttpInfo($owner, $re /** * Operation putV5ReposOwnerRepoCollaboratorsUsernameAsync * - * 添加仓库成员 + * 添加仓库成员或更新仓库成员权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -19935,7 +23216,7 @@ function ($response) { /** * Operation putV5ReposOwnerRepoCollaboratorsUsernameAsyncWithHttpInfo * - * 添加仓库成员 + * 添加仓库成员或更新仓库成员权限 * * @param string $owner 仓库所属空间地址(企业、组织或个人的地址path) (required) * @param string $repo 仓库路径(path) (required) @@ -21501,7 +24782,7 @@ protected function putV5ReposOwnerRepoPushConfigRequest($owner, $repo, $accessTo * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\Contributor + * @return \Gitee\Model\Project */ public function putV5ReposOwnerRepoReviewer($owner, $repo, $assignees, $testers, $assigneesNumber, $testersNumber, $accessToken = null) { @@ -21524,11 +24805,11 @@ public function putV5ReposOwnerRepoReviewer($owner, $repo, $assignees, $testers, * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\Contributor, HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\Project, HTTP status code, HTTP response headers (array of strings) */ public function putV5ReposOwnerRepoReviewerWithHttpInfo($owner, $repo, $assignees, $testers, $assigneesNumber, $testersNumber, $accessToken = null) { - $returnType = '\Gitee\Model\Contributor'; + $returnType = '\Gitee\Model\Project'; $request = $this->putV5ReposOwnerRepoReviewerRequest($owner, $repo, $assignees, $testers, $assigneesNumber, $testersNumber, $accessToken); try { @@ -21580,7 +24861,7 @@ public function putV5ReposOwnerRepoReviewerWithHttpInfo($owner, $repo, $assignee case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\Contributor', + '\Gitee\Model\Project', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21634,7 +24915,7 @@ function ($response) { */ public function putV5ReposOwnerRepoReviewerAsyncWithHttpInfo($owner, $repo, $assignees, $testers, $assigneesNumber, $testersNumber, $accessToken = null) { - $returnType = '\Gitee\Model\Contributor'; + $returnType = '\Gitee\Model\Project'; $request = $this->putV5ReposOwnerRepoReviewerRequest($owner, $repo, $assignees, $testers, $assigneesNumber, $testersNumber, $accessToken); return $this->client diff --git a/src/Api/SearchApi.php b/src/Api/SearchApi.php index 7c7bb6a..1b40cd3 100644 --- a/src/Api/SearchApi.php +++ b/src/Api/SearchApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -322,6 +322,13 @@ protected function getV5SearchIssuesRequest($q, $accessToken = null, $page = '1' 'Missing the required parameter $q when calling getV5SearchIssues' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling SearchApi.getV5SearchIssues, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling SearchApi.getV5SearchIssues, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/search/issues'; $formParams = []; @@ -671,6 +678,13 @@ protected function getV5SearchRepositoriesRequest($q, $accessToken = null, $page 'Missing the required parameter $q when calling getV5SearchRepositories' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling SearchApi.getV5SearchRepositories, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling SearchApi.getV5SearchRepositories, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/search/repositories'; $formParams = []; @@ -993,6 +1007,13 @@ protected function getV5SearchUsersRequest($q, $accessToken = null, $page = '1', 'Missing the required parameter $q when calling getV5SearchUsers' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling SearchApi.getV5SearchUsers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling SearchApi.getV5SearchUsers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/search/users'; $formParams = []; diff --git a/src/Api/UsersApi.php b/src/Api/UsersApi.php index e5a5419..479bc1a 100644 --- a/src/Api/UsersApi.php +++ b/src/Api/UsersApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -1012,6 +1012,13 @@ function ($exception) { */ protected function getV5UserFollowersRequest($accessToken = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UserFollowers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UserFollowers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/followers'; $formParams = []; @@ -1289,6 +1296,13 @@ function ($exception) { */ protected function getV5UserFollowingRequest($accessToken = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UserFollowing, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UserFollowing, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/following'; $formParams = []; @@ -1807,6 +1821,13 @@ function ($exception) { */ protected function getV5UserKeysRequest($accessToken = null, $page = '1', $perPage = '20') { + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UserKeys, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UserKeys, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/user/keys'; $formParams = []; @@ -2188,7 +2209,7 @@ protected function getV5UserKeysIdRequest($id, $accessToken = null) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Gitee\Model\ModelNamespace[] + * @return \Gitee\Model\ModelNamespace */ public function getV5UserNamespace($path, $accessToken = null) { @@ -2206,11 +2227,11 @@ public function getV5UserNamespace($path, $accessToken = null) * * @throws \Gitee\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Gitee\Model\ModelNamespace[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Gitee\Model\ModelNamespace, HTTP status code, HTTP response headers (array of strings) */ public function getV5UserNamespaceWithHttpInfo($path, $accessToken = null) { - $returnType = '\Gitee\Model\ModelNamespace[]'; + $returnType = '\Gitee\Model\ModelNamespace'; $request = $this->getV5UserNamespaceRequest($path, $accessToken); try { @@ -2262,7 +2283,7 @@ public function getV5UserNamespaceWithHttpInfo($path, $accessToken = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Gitee\Model\ModelNamespace[]', + '\Gitee\Model\ModelNamespace', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2306,7 +2327,7 @@ function ($response) { */ public function getV5UserNamespaceAsyncWithHttpInfo($path, $accessToken = null) { - $returnType = '\Gitee\Model\ModelNamespace[]'; + $returnType = '\Gitee\Model\ModelNamespace'; $request = $this->getV5UserNamespaceRequest($path, $accessToken); return $this->client @@ -3193,6 +3214,13 @@ protected function getV5UsersUsernameFollowersRequest($username, $accessToken = 'Missing the required parameter $username when calling getV5UsersUsernameFollowers' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UsersUsernameFollowers, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UsersUsernameFollowers, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/users/{username}/followers'; $formParams = []; @@ -3489,6 +3517,13 @@ protected function getV5UsersUsernameFollowingRequest($username, $accessToken = 'Missing the required parameter $username when calling getV5UsersUsernameFollowing' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UsersUsernameFollowing, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UsersUsernameFollowing, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/users/{username}/following'; $formParams = []; @@ -4045,6 +4080,13 @@ protected function getV5UsersUsernameKeysRequest($username, $accessToken = null, 'Missing the required parameter $username when calling getV5UsersUsernameKeys' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UsersUsernameKeys, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling UsersApi.getV5UsersUsernameKeys, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/users/{username}/keys'; $formParams = []; diff --git a/src/Api/WebhooksApi.php b/src/Api/WebhooksApi.php index 3d3b909..25dce29 100644 --- a/src/Api/WebhooksApi.php +++ b/src/Api/WebhooksApi.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -572,6 +572,13 @@ protected function getV5ReposOwnerRepoHooksRequest($owner, $repo, $accessToken = 'Missing the required parameter $repo when calling getV5ReposOwnerRepoHooks' ); } + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling WebhooksApi.getV5ReposOwnerRepoHooks, must be smaller than or equal to 100.'); + } + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling WebhooksApi.getV5ReposOwnerRepoHooks, must be bigger than or equal to 1.'); + } + $resourcePath = '/v5/repos/{owner}/{repo}/hooks'; $formParams = []; diff --git a/src/ApiException.php b/src/ApiException.php index ca7f308..d24f869 100644 --- a/src/ApiException.php +++ b/src/ApiException.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Configuration.php b/src/Configuration.php index ec4853f..e3ab56d 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/5.4.73/php'; + protected $userAgent = 'Swagger-Codegen/5.4.85/php'; /** * Debug switch (default set to false) @@ -396,8 +396,8 @@ public static function toDebugReport() $report = 'PHP SDK (Gitee) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 5.4.73' . PHP_EOL; - $report .= ' SDK Package Version: 5.4.73' . PHP_EOL; + $report .= ' OpenAPI Spec Version: 5.4.85' . PHP_EOL; + $report .= ' SDK Package Version: 5.4.85' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php index 2249123..35ea8db 100644 --- a/src/HeaderSelector.php +++ b/src/HeaderSelector.php @@ -14,10 +14,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/AttachFile.php b/src/Model/AttachFile.php new file mode 100644 index 0000000..09f2ad0 --- /dev/null +++ b/src/Model/AttachFile.php @@ -0,0 +1,426 @@ + 'int', + 'name' => 'string', + 'size' => 'int', + 'uploader' => '\Gitee\Model\UserMini', + 'browserDownloadUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int32', + 'name' => null, + 'size' => 'int32', + 'uploader' => null, + 'browserDownloadUrl' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'size' => 'size', + 'uploader' => 'uploader', + 'browserDownloadUrl' => 'browser_download_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'size' => 'setSize', + 'uploader' => 'setUploader', + 'browserDownloadUrl' => 'setBrowserDownloadUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'size' => 'getSize', + 'uploader' => 'getUploader', + 'browserDownloadUrl' => 'getBrowserDownloadUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['size'] = isset($data['size']) ? $data['size'] : null; + $this->container['uploader'] = isset($data['uploader']) ? $data['uploader'] : null; + $this->container['browserDownloadUrl'] = isset($data['browserDownloadUrl']) ? $data['browserDownloadUrl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets size + * + * @return int + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int $size size + * + * @return $this + */ + public function setSize($size) + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets uploader + * + * @return \Gitee\Model\UserMini + */ + public function getUploader() + { + return $this->container['uploader']; + } + + /** + * Sets uploader + * + * @param \Gitee\Model\UserMini $uploader uploader + * + * @return $this + */ + public function setUploader($uploader) + { + $this->container['uploader'] = $uploader; + + return $this; + } + + /** + * Gets browserDownloadUrl + * + * @return string + */ + public function getBrowserDownloadUrl() + { + return $this->container['browserDownloadUrl']; + } + + /** + * Sets browserDownloadUrl + * + * @param string $browserDownloadUrl browserDownloadUrl + * + * @return $this + */ + public function setBrowserDownloadUrl($browserDownloadUrl) + { + $this->container['browserDownloadUrl'] = $browserDownloadUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Blame.php b/src/Model/Blame.php new file mode 100644 index 0000000..790255f --- /dev/null +++ b/src/Model/Blame.php @@ -0,0 +1,336 @@ + '\Gitee\Model\Commit', + 'lines' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'commit' => null, + 'lines' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'commit' => 'commit', + 'lines' => 'lines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'commit' => 'setCommit', + 'lines' => 'setLines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'commit' => 'getCommit', + 'lines' => 'getLines' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['commit'] = isset($data['commit']) ? $data['commit'] : null; + $this->container['lines'] = isset($data['lines']) ? $data['lines'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets commit + * + * @return \Gitee\Model\Commit + */ + public function getCommit() + { + return $this->container['commit']; + } + + /** + * Sets commit + * + * @param \Gitee\Model\Commit $commit commit + * + * @return $this + */ + public function setCommit($commit) + { + $this->container['commit'] = $commit; + + return $this; + } + + /** + * Gets lines + * + * @return string[] + */ + public function getLines() + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param string[] $lines 代码行 + * + * @return $this + */ + public function setLines($lines) + { + $this->container['lines'] = $lines; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Blob.php b/src/Model/Blob.php index f286c34..d234a27 100644 --- a/src/Model/Blob.php +++ b/src/Model/Blob.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -59,7 +59,7 @@ class Blob implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'sha' => 'string', - 'size' => 'string', + 'size' => 'int', 'url' => 'string', 'content' => 'string', 'encoding' => 'string' @@ -72,7 +72,7 @@ class Blob implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'sha' => null, - 'size' => null, + 'size' => 'int32', 'url' => null, 'content' => null, 'encoding' => null @@ -256,7 +256,7 @@ public function setSha($sha) /** * Gets size * - * @return string + * @return int */ public function getSize() { @@ -266,7 +266,7 @@ public function getSize() /** * Sets size * - * @param string $size size + * @param int $size size * * @return $this */ diff --git a/src/Model/Branch.php b/src/Model/Branch.php index 0f6bec1..774ef44 100644 --- a/src/Model/Branch.php +++ b/src/Model/Branch.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -60,7 +60,7 @@ class Branch implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'name' => 'string', 'commit' => 'string', - 'protected' => 'string', + 'protected' => 'bool', 'protectionUrl' => 'string' ]; @@ -274,7 +274,7 @@ public function setCommit($commit) /** * Gets protected * - * @return string + * @return bool */ public function getProtected() { @@ -284,7 +284,7 @@ public function getProtected() /** * Sets protected * - * @param string $protected protected + * @param bool $protected protected * * @return $this */ diff --git a/src/Model/CheckAnnotation.php b/src/Model/CheckAnnotation.php new file mode 100644 index 0000000..878e0ab --- /dev/null +++ b/src/Model/CheckAnnotation.php @@ -0,0 +1,576 @@ + 'string', + 'startLine' => 'int', + 'endLine' => 'int', + 'startColumn' => 'int', + 'endColumn' => 'int', + 'annotationLevel' => 'string', + 'title' => 'string', + 'message' => 'string', + 'rawDetails' => 'string', + 'blobHref' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'path' => null, + 'startLine' => 'int32', + 'endLine' => 'int32', + 'startColumn' => 'int32', + 'endColumn' => 'int32', + 'annotationLevel' => null, + 'title' => null, + 'message' => null, + 'rawDetails' => null, + 'blobHref' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'path' => 'path', + 'startLine' => 'start_line', + 'endLine' => 'end_line', + 'startColumn' => 'start_column', + 'endColumn' => 'end_column', + 'annotationLevel' => 'annotation_level', + 'title' => 'title', + 'message' => 'message', + 'rawDetails' => 'raw_details', + 'blobHref' => 'blob_href' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'path' => 'setPath', + 'startLine' => 'setStartLine', + 'endLine' => 'setEndLine', + 'startColumn' => 'setStartColumn', + 'endColumn' => 'setEndColumn', + 'annotationLevel' => 'setAnnotationLevel', + 'title' => 'setTitle', + 'message' => 'setMessage', + 'rawDetails' => 'setRawDetails', + 'blobHref' => 'setBlobHref' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'path' => 'getPath', + 'startLine' => 'getStartLine', + 'endLine' => 'getEndLine', + 'startColumn' => 'getStartColumn', + 'endColumn' => 'getEndColumn', + 'annotationLevel' => 'getAnnotationLevel', + 'title' => 'getTitle', + 'message' => 'getMessage', + 'rawDetails' => 'getRawDetails', + 'blobHref' => 'getBlobHref' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['path'] = isset($data['path']) ? $data['path'] : null; + $this->container['startLine'] = isset($data['startLine']) ? $data['startLine'] : null; + $this->container['endLine'] = isset($data['endLine']) ? $data['endLine'] : null; + $this->container['startColumn'] = isset($data['startColumn']) ? $data['startColumn'] : null; + $this->container['endColumn'] = isset($data['endColumn']) ? $data['endColumn'] : null; + $this->container['annotationLevel'] = isset($data['annotationLevel']) ? $data['annotationLevel'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['rawDetails'] = isset($data['rawDetails']) ? $data['rawDetails'] : null; + $this->container['blobHref'] = isset($data['blobHref']) ? $data['blobHref'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets path + * + * @return string + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string $path 文件路径 + * + * @return $this + */ + public function setPath($path) + { + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets startLine + * + * @return int + */ + public function getStartLine() + { + return $this->container['startLine']; + } + + /** + * Sets startLine + * + * @param int $startLine 开始行 + * + * @return $this + */ + public function setStartLine($startLine) + { + $this->container['startLine'] = $startLine; + + return $this; + } + + /** + * Gets endLine + * + * @return int + */ + public function getEndLine() + { + return $this->container['endLine']; + } + + /** + * Sets endLine + * + * @param int $endLine 结束行 + * + * @return $this + */ + public function setEndLine($endLine) + { + $this->container['endLine'] = $endLine; + + return $this; + } + + /** + * Gets startColumn + * + * @return int + */ + public function getStartColumn() + { + return $this->container['startColumn']; + } + + /** + * Sets startColumn + * + * @param int $startColumn 开始列 + * + * @return $this + */ + public function setStartColumn($startColumn) + { + $this->container['startColumn'] = $startColumn; + + return $this; + } + + /** + * Gets endColumn + * + * @return int + */ + public function getEndColumn() + { + return $this->container['endColumn']; + } + + /** + * Sets endColumn + * + * @param int $endColumn 结束列 + * + * @return $this + */ + public function setEndColumn($endColumn) + { + $this->container['endColumn'] = $endColumn; + + return $this; + } + + /** + * Gets annotationLevel + * + * @return string + */ + public function getAnnotationLevel() + { + return $this->container['annotationLevel']; + } + + /** + * Sets annotationLevel + * + * @param string $annotationLevel 注释级别 + * + * @return $this + */ + public function setAnnotationLevel($annotationLevel) + { + $this->container['annotationLevel'] = $annotationLevel; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title 标题 + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message 信息 + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets rawDetails + * + * @return string + */ + public function getRawDetails() + { + return $this->container['rawDetails']; + } + + /** + * Sets rawDetails + * + * @param string $rawDetails 详情 + * + * @return $this + */ + public function setRawDetails($rawDetails) + { + $this->container['rawDetails'] = $rawDetails; + + return $this; + } + + /** + * Gets blobHref + * + * @return string + */ + public function getBlobHref() + { + return $this->container['blobHref']; + } + + /** + * Sets blobHref + * + * @param string $blobHref 文件路由 + * + * @return $this + */ + public function setBlobHref($blobHref) + { + $this->container['blobHref'] = $blobHref; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CheckRun.php b/src/Model/CheckRun.php new file mode 100644 index 0000000..dd1e4d2 --- /dev/null +++ b/src/Model/CheckRun.php @@ -0,0 +1,606 @@ + 'int', + 'headSha' => 'string', + 'url' => 'string', + 'htmlUrl' => 'string', + 'detailsUrl' => 'string', + 'status' => 'string', + 'conclusion' => 'string', + 'startedAt' => 'string', + 'completedAt' => 'string', + 'output' => 'object', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int32', + 'headSha' => null, + 'url' => null, + 'htmlUrl' => null, + 'detailsUrl' => null, + 'status' => null, + 'conclusion' => null, + 'startedAt' => null, + 'completedAt' => null, + 'output' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'headSha' => 'head_sha', + 'url' => 'url', + 'htmlUrl' => 'html_url', + 'detailsUrl' => 'details_url', + 'status' => 'status', + 'conclusion' => 'conclusion', + 'startedAt' => 'started_at', + 'completedAt' => 'completed_at', + 'output' => 'output', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'headSha' => 'setHeadSha', + 'url' => 'setUrl', + 'htmlUrl' => 'setHtmlUrl', + 'detailsUrl' => 'setDetailsUrl', + 'status' => 'setStatus', + 'conclusion' => 'setConclusion', + 'startedAt' => 'setStartedAt', + 'completedAt' => 'setCompletedAt', + 'output' => 'setOutput', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'headSha' => 'getHeadSha', + 'url' => 'getUrl', + 'htmlUrl' => 'getHtmlUrl', + 'detailsUrl' => 'getDetailsUrl', + 'status' => 'getStatus', + 'conclusion' => 'getConclusion', + 'startedAt' => 'getStartedAt', + 'completedAt' => 'getCompletedAt', + 'output' => 'getOutput', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['headSha'] = isset($data['headSha']) ? $data['headSha'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null; + $this->container['detailsUrl'] = isset($data['detailsUrl']) ? $data['detailsUrl'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['conclusion'] = isset($data['conclusion']) ? $data['conclusion'] : null; + $this->container['startedAt'] = isset($data['startedAt']) ? $data['startedAt'] : null; + $this->container['completedAt'] = isset($data['completedAt']) ? $data['completedAt'] : null; + $this->container['output'] = isset($data['output']) ? $data['output'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets headSha + * + * @return string + */ + public function getHeadSha() + { + return $this->container['headSha']; + } + + /** + * Sets headSha + * + * @param string $headSha 提交 sha 值 + * + * @return $this + */ + public function setHeadSha($headSha) + { + $this->container['headSha'] = $headSha; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url api 路由 + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets htmlUrl + * + * @return string + */ + public function getHtmlUrl() + { + return $this->container['htmlUrl']; + } + + /** + * Sets htmlUrl + * + * @param string $htmlUrl 页面路由 + * + * @return $this + */ + public function setHtmlUrl($htmlUrl) + { + $this->container['htmlUrl'] = $htmlUrl; + + return $this; + } + + /** + * Gets detailsUrl + * + * @return string + */ + public function getDetailsUrl() + { + return $this->container['detailsUrl']; + } + + /** + * Sets detailsUrl + * + * @param string $detailsUrl 外部详情路由 + * + * @return $this + */ + public function setDetailsUrl($detailsUrl) + { + $this->container['detailsUrl'] = $detailsUrl; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status 状态 + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets conclusion + * + * @return string + */ + public function getConclusion() + { + return $this->container['conclusion']; + } + + /** + * Sets conclusion + * + * @param string $conclusion 结论 + * + * @return $this + */ + public function setConclusion($conclusion) + { + $this->container['conclusion'] = $conclusion; + + return $this; + } + + /** + * Gets startedAt + * + * @return string + */ + public function getStartedAt() + { + return $this->container['startedAt']; + } + + /** + * Sets startedAt + * + * @param string $startedAt 开始时间 + * + * @return $this + */ + public function setStartedAt($startedAt) + { + $this->container['startedAt'] = $startedAt; + + return $this; + } + + /** + * Gets completedAt + * + * @return string + */ + public function getCompletedAt() + { + return $this->container['completedAt']; + } + + /** + * Sets completedAt + * + * @param string $completedAt 完成事件 + * + * @return $this + */ + public function setCompletedAt($completedAt) + { + $this->container['completedAt'] = $completedAt; + + return $this; + } + + /** + * Gets output + * + * @return object + */ + public function getOutput() + { + return $this->container['output']; + } + + /** + * Sets output + * + * @param object $output 详情 + * + * @return $this + */ + public function setOutput($output) + { + $this->container['output'] = $output; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name 检查名 + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Code.php b/src/Model/Code.php index 347060a..813b6a4 100644 --- a/src/Model/Code.php +++ b/src/Model/Code.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -63,18 +63,18 @@ class Code implements ModelInterface, ArrayAccess 'commitsUrl' => 'string', 'id' => 'string', 'description' => 'string', - 'public' => 'string', - 'owner' => 'string', - 'user' => 'string', + 'public' => 'bool', + 'owner' => '\Gitee\Model\UserBasic', + 'user' => '\Gitee\Model\UserBasic', 'files' => 'string', - 'truncated' => 'string', + 'truncated' => 'bool', 'htmlUrl' => 'string', - 'comments' => 'string', + 'comments' => 'int', 'commentsUrl' => 'string', 'gitPullUrl' => 'string', 'gitPushUrl' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string' + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime' ]; /** @@ -94,12 +94,12 @@ class Code implements ModelInterface, ArrayAccess 'files' => null, 'truncated' => null, 'htmlUrl' => null, - 'comments' => null, + 'comments' => 'int32', 'commentsUrl' => null, 'gitPullUrl' => null, 'gitPushUrl' => null, - 'createdAt' => null, - 'updatedAt' => null + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time' ]; /** @@ -424,7 +424,7 @@ public function setDescription($description) /** * Gets public * - * @return string + * @return bool */ public function getPublic() { @@ -434,7 +434,7 @@ public function getPublic() /** * Sets public * - * @param string $public public + * @param bool $public public * * @return $this */ @@ -448,7 +448,7 @@ public function setPublic($public) /** * Gets owner * - * @return string + * @return \Gitee\Model\UserBasic */ public function getOwner() { @@ -458,7 +458,7 @@ public function getOwner() /** * Sets owner * - * @param string $owner owner + * @param \Gitee\Model\UserBasic $owner owner * * @return $this */ @@ -472,7 +472,7 @@ public function setOwner($owner) /** * Gets user * - * @return string + * @return \Gitee\Model\UserBasic */ public function getUser() { @@ -482,7 +482,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserBasic $user user * * @return $this */ @@ -520,7 +520,7 @@ public function setFiles($files) /** * Gets truncated * - * @return string + * @return bool */ public function getTruncated() { @@ -530,7 +530,7 @@ public function getTruncated() /** * Sets truncated * - * @param string $truncated truncated + * @param bool $truncated truncated * * @return $this */ @@ -568,7 +568,7 @@ public function setHtmlUrl($htmlUrl) /** * Gets comments * - * @return string + * @return int */ public function getComments() { @@ -578,7 +578,7 @@ public function getComments() /** * Sets comments * - * @param string $comments comments + * @param int $comments comments * * @return $this */ @@ -664,7 +664,7 @@ public function setGitPushUrl($gitPushUrl) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -674,7 +674,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -688,7 +688,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -698,7 +698,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/CodeComment.php b/src/Model/CodeComment.php index 592657c..c48cce6 100644 --- a/src/Model/CodeComment.php +++ b/src/Model/CodeComment.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,10 +58,10 @@ class CodeComment implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', + 'id' => 'int', 'body' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string' + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime' ]; /** @@ -70,10 +70,10 @@ class CodeComment implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, + 'id' => 'int32', 'body' => null, - 'createdAt' => null, - 'updatedAt' => null + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time' ]; /** @@ -226,7 +226,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -236,7 +236,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -274,7 +274,7 @@ public function setBody($body) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -284,7 +284,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -298,7 +298,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -308,7 +308,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/CodeForks.php b/src/Model/CodeForks.php index 1b1214a..9f9014a 100644 --- a/src/Model/CodeForks.php +++ b/src/Model/CodeForks.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,11 +58,11 @@ class CodeForks implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'user' => 'string', + 'user' => '\Gitee\Model\UserBasic', 'url' => 'string', 'id' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string' + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime' ]; /** @@ -74,8 +74,8 @@ class CodeForks implements ModelInterface, ArrayAccess 'user' => null, 'url' => null, 'id' => null, - 'createdAt' => null, - 'updatedAt' => null + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time' ]; /** @@ -232,7 +232,7 @@ public function valid() /** * Gets user * - * @return string + * @return \Gitee\Model\UserBasic */ public function getUser() { @@ -242,7 +242,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserBasic $user user * * @return $this */ @@ -304,7 +304,7 @@ public function setId($id) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -314,7 +314,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -328,7 +328,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -338,7 +338,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/CodeForksHistory.php b/src/Model/CodeForksHistory.php index ae37799..4499a91 100644 --- a/src/Model/CodeForksHistory.php +++ b/src/Model/CodeForksHistory.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -63,18 +63,18 @@ class CodeForksHistory implements ModelInterface, ArrayAccess 'commitsUrl' => 'string', 'id' => 'string', 'description' => 'string', - 'public' => 'string', - 'owner' => 'string', - 'user' => 'string', + 'public' => 'bool', + 'owner' => '\Gitee\Model\UserBasic', + 'user' => '\Gitee\Model\UserBasic', 'files' => 'string', - 'truncated' => 'string', + 'truncated' => 'bool', 'htmlUrl' => 'string', - 'comments' => 'string', + 'comments' => 'int', 'commentsUrl' => 'string', 'gitPullUrl' => 'string', 'gitPushUrl' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', 'forks' => 'string', 'history' => 'string' ]; @@ -96,12 +96,12 @@ class CodeForksHistory implements ModelInterface, ArrayAccess 'files' => null, 'truncated' => null, 'htmlUrl' => null, - 'comments' => null, + 'comments' => 'int32', 'commentsUrl' => null, 'gitPullUrl' => null, 'gitPushUrl' => null, - 'createdAt' => null, - 'updatedAt' => null, + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', 'forks' => null, 'history' => null ]; @@ -436,7 +436,7 @@ public function setDescription($description) /** * Gets public * - * @return string + * @return bool */ public function getPublic() { @@ -446,7 +446,7 @@ public function getPublic() /** * Sets public * - * @param string $public public + * @param bool $public public * * @return $this */ @@ -460,7 +460,7 @@ public function setPublic($public) /** * Gets owner * - * @return string + * @return \Gitee\Model\UserBasic */ public function getOwner() { @@ -470,7 +470,7 @@ public function getOwner() /** * Sets owner * - * @param string $owner owner + * @param \Gitee\Model\UserBasic $owner owner * * @return $this */ @@ -484,7 +484,7 @@ public function setOwner($owner) /** * Gets user * - * @return string + * @return \Gitee\Model\UserBasic */ public function getUser() { @@ -494,7 +494,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserBasic $user user * * @return $this */ @@ -532,7 +532,7 @@ public function setFiles($files) /** * Gets truncated * - * @return string + * @return bool */ public function getTruncated() { @@ -542,7 +542,7 @@ public function getTruncated() /** * Sets truncated * - * @param string $truncated truncated + * @param bool $truncated truncated * * @return $this */ @@ -580,7 +580,7 @@ public function setHtmlUrl($htmlUrl) /** * Gets comments * - * @return string + * @return int */ public function getComments() { @@ -590,7 +590,7 @@ public function getComments() /** * Sets comments * - * @param string $comments comments + * @param int $comments comments * * @return $this */ @@ -676,7 +676,7 @@ public function setGitPushUrl($gitPushUrl) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -686,7 +686,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -700,7 +700,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -710,7 +710,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/Commit.php b/src/Model/Commit.php index dcd2a48..a449215 100644 --- a/src/Model/Commit.php +++ b/src/Model/Commit.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,11 +58,11 @@ class Commit implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'sha' => 'string', - 'author' => 'string', - 'committer' => 'string', + 'author' => '\Gitee\Model\GitUser', + 'committer' => '\Gitee\Model\GitUser', 'message' => 'string', 'tree' => 'string', - 'parents' => 'string' + 'parents' => 'string[]' ]; /** @@ -261,7 +261,7 @@ public function setSha($sha) /** * Gets author * - * @return string + * @return \Gitee\Model\GitUser */ public function getAuthor() { @@ -271,7 +271,7 @@ public function getAuthor() /** * Sets author * - * @param string $author author + * @param \Gitee\Model\GitUser $author author * * @return $this */ @@ -285,7 +285,7 @@ public function setAuthor($author) /** * Gets committer * - * @return string + * @return \Gitee\Model\GitUser */ public function getCommitter() { @@ -295,7 +295,7 @@ public function getCommitter() /** * Sets committer * - * @param string $committer committer + * @param \Gitee\Model\GitUser $committer committer * * @return $this */ @@ -357,7 +357,7 @@ public function setTree($tree) /** * Gets parents * - * @return string + * @return string[] */ public function getParents() { @@ -367,7 +367,7 @@ public function getParents() /** * Sets parents * - * @param string $parents parents + * @param string[] $parents parents * * @return $this */ diff --git a/src/Model/CommitContent.php b/src/Model/CommitContent.php index b60ee98..303918b 100644 --- a/src/Model/CommitContent.php +++ b/src/Model/CommitContent.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/CommitParentsBasic.php b/src/Model/CommitParentsBasic.php index f50a6bb..2c5c1d5 100644 --- a/src/Model/CommitParentsBasic.php +++ b/src/Model/CommitParentsBasic.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,7 +58,8 @@ class CommitParentsBasic implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'url' => 'string', - 'sha' => 'string' + 'sha' => 'string', + 'shas' => 'string[]' ]; /** @@ -68,7 +69,8 @@ class CommitParentsBasic implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'url' => null, - 'sha' => null + 'sha' => null, + 'shas' => null ]; /** @@ -99,7 +101,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'url' => 'url', - 'sha' => 'sha' + 'sha' => 'sha', + 'shas' => 'shas' ]; /** @@ -109,7 +112,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'url' => 'setUrl', - 'sha' => 'setSha' + 'sha' => 'setSha', + 'shas' => 'setShas' ]; /** @@ -119,7 +123,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'url' => 'getUrl', - 'sha' => 'getSha' + 'sha' => 'getSha', + 'shas' => 'getShas' ]; /** @@ -184,6 +189,7 @@ public function __construct(array $data = null) { $this->container['url'] = isset($data['url']) ? $data['url'] : null; $this->container['sha'] = isset($data['sha']) ? $data['sha'] : null; + $this->container['shas'] = isset($data['shas']) ? $data['shas'] : null; } /** @@ -257,6 +263,30 @@ public function setSha($sha) return $this; } + + /** + * Gets shas + * + * @return string[] + */ + public function getShas() + { + return $this->container['shas']; + } + + /** + * Sets shas + * + * @param string[] $shas 全部父级 commit 的 sha 值 + * + * @return $this + */ + public function setShas($shas) + { + $this->container['shas'] = $shas; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/Compare.php b/src/Model/Compare.php index cbd97e1..3ec3fd4 100644 --- a/src/Model/Compare.php +++ b/src/Model/Compare.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -36,7 +36,7 @@ * Compare Class Doc Comment * * @category Class - * @description 两个Commits之间对比的版本差异 + * @description Commits 对比 返回的 commits 数量限制在 100 以内 * @package Gitee * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -58,10 +58,11 @@ class Compare implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'baseCommit' => 'string', - 'mergeBaseCommit' => 'string', - 'commits' => 'string', - 'files' => 'string' + 'baseCommit' => '\Gitee\Model\RepoCommit', + 'mergeBaseCommit' => '\Gitee\Model\RepoCommit', + 'commits' => '\Gitee\Model\RepoCommit[]', + 'files' => '\Gitee\Model\DiffFile[]', + 'truncated' => 'bool' ]; /** @@ -73,7 +74,8 @@ class Compare implements ModelInterface, ArrayAccess 'baseCommit' => null, 'mergeBaseCommit' => null, 'commits' => null, - 'files' => null + 'files' => null, + 'truncated' => null ]; /** @@ -106,7 +108,8 @@ public static function swaggerFormats() 'baseCommit' => 'base_commit', 'mergeBaseCommit' => 'merge_base_commit', 'commits' => 'commits', - 'files' => 'files' + 'files' => 'files', + 'truncated' => 'truncated' ]; /** @@ -118,7 +121,8 @@ public static function swaggerFormats() 'baseCommit' => 'setBaseCommit', 'mergeBaseCommit' => 'setMergeBaseCommit', 'commits' => 'setCommits', - 'files' => 'setFiles' + 'files' => 'setFiles', + 'truncated' => 'setTruncated' ]; /** @@ -130,7 +134,8 @@ public static function swaggerFormats() 'baseCommit' => 'getBaseCommit', 'mergeBaseCommit' => 'getMergeBaseCommit', 'commits' => 'getCommits', - 'files' => 'getFiles' + 'files' => 'getFiles', + 'truncated' => 'getTruncated' ]; /** @@ -197,6 +202,7 @@ public function __construct(array $data = null) $this->container['mergeBaseCommit'] = isset($data['mergeBaseCommit']) ? $data['mergeBaseCommit'] : null; $this->container['commits'] = isset($data['commits']) ? $data['commits'] : null; $this->container['files'] = isset($data['files']) ? $data['files'] : null; + $this->container['truncated'] = isset($data['truncated']) ? $data['truncated'] : null; } /** @@ -226,7 +232,7 @@ public function valid() /** * Gets baseCommit * - * @return string + * @return \Gitee\Model\RepoCommit */ public function getBaseCommit() { @@ -236,7 +242,7 @@ public function getBaseCommit() /** * Sets baseCommit * - * @param string $baseCommit baseCommit + * @param \Gitee\Model\RepoCommit $baseCommit baseCommit * * @return $this */ @@ -250,7 +256,7 @@ public function setBaseCommit($baseCommit) /** * Gets mergeBaseCommit * - * @return string + * @return \Gitee\Model\RepoCommit */ public function getMergeBaseCommit() { @@ -260,7 +266,7 @@ public function getMergeBaseCommit() /** * Sets mergeBaseCommit * - * @param string $mergeBaseCommit mergeBaseCommit + * @param \Gitee\Model\RepoCommit $mergeBaseCommit mergeBaseCommit * * @return $this */ @@ -274,7 +280,7 @@ public function setMergeBaseCommit($mergeBaseCommit) /** * Gets commits * - * @return string + * @return \Gitee\Model\RepoCommit[] */ public function getCommits() { @@ -284,7 +290,7 @@ public function getCommits() /** * Sets commits * - * @param string $commits commits + * @param \Gitee\Model\RepoCommit[] $commits commits 数量限制在 100 以内 * * @return $this */ @@ -298,7 +304,7 @@ public function setCommits($commits) /** * Gets files * - * @return string + * @return \Gitee\Model\DiffFile[] */ public function getFiles() { @@ -308,7 +314,7 @@ public function getFiles() /** * Sets files * - * @param string $files files + * @param \Gitee\Model\DiffFile[] $files 文件列表 * * @return $this */ @@ -318,6 +324,30 @@ public function setFiles($files) return $this; } + + /** + * Gets truncated + * + * @return bool + */ + public function getTruncated() + { + return $this->container['truncated']; + } + + /** + * Sets truncated + * + * @param bool $truncated 文件列表是否被截断 + * + * @return $this + */ + public function setTruncated($truncated) + { + $this->container['truncated'] = $truncated; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CompleteBranch.php b/src/Model/CompleteBranch.php index e1ed704..44e2809 100644 --- a/src/Model/CompleteBranch.php +++ b/src/Model/CompleteBranch.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -61,7 +61,7 @@ class CompleteBranch implements ModelInterface, ArrayAccess 'name' => 'string', 'commit' => 'string', 'links' => 'string', - 'protected' => 'string', + 'protected' => 'bool', 'protectionUrl' => 'string' ]; @@ -304,7 +304,7 @@ public function setLinks($links) /** * Gets protected * - * @return string + * @return bool */ public function getProtected() { @@ -314,7 +314,7 @@ public function getProtected() /** * Sets protected * - * @param string $protected protected + * @param bool $protected protected * * @return $this */ diff --git a/src/Model/Content.php b/src/Model/Content.php index 09fa7f3..dcfed8e 100644 --- a/src/Model/Content.php +++ b/src/Model/Content.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -60,7 +60,7 @@ class Content implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'type' => 'string', 'encoding' => 'string', - 'size' => 'string', + 'size' => 'int', 'name' => 'string', 'path' => 'string', 'content' => 'string', @@ -79,7 +79,7 @@ class Content implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'type' => null, 'encoding' => null, - 'size' => null, + 'size' => 'int32', 'name' => null, 'path' => null, 'content' => null, @@ -316,7 +316,7 @@ public function setEncoding($encoding) /** * Gets size * - * @return string + * @return int */ public function getSize() { @@ -326,7 +326,7 @@ public function getSize() /** * Sets size * - * @param string $size size + * @param int $size size * * @return $this */ diff --git a/src/Model/ContentBasic.php b/src/Model/ContentBasic.php index 2583be3..81d722c 100644 --- a/src/Model/ContentBasic.php +++ b/src/Model/ContentBasic.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -59,7 +59,7 @@ class ContentBasic implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'name' => 'string', 'path' => 'string', - 'size' => 'string', + 'size' => 'int', 'sha' => 'string', 'type' => 'string', 'url' => 'string', @@ -76,7 +76,7 @@ class ContentBasic implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'name' => null, 'path' => null, - 'size' => null, + 'size' => 'int32', 'sha' => null, 'type' => null, 'url' => null, @@ -303,7 +303,7 @@ public function setPath($path) /** * Gets size * - * @return string + * @return int */ public function getSize() { @@ -313,7 +313,7 @@ public function getSize() /** * Sets size * - * @param string $size size + * @param int $size size * * @return $this */ diff --git a/src/Model/Contributor.php b/src/Model/Contributor.php index 11fb3af..4b84524 100644 --- a/src/Model/Contributor.php +++ b/src/Model/Contributor.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -60,7 +60,7 @@ class Contributor implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'email' => 'string', 'name' => 'string', - 'contributions' => 'string' + 'contributions' => 'int' ]; /** @@ -71,7 +71,7 @@ class Contributor implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'email' => null, 'name' => null, - 'contributions' => null + 'contributions' => 'int32' ]; /** @@ -268,7 +268,7 @@ public function setName($name) /** * Gets contributions * - * @return string + * @return int */ public function getContributions() { @@ -278,7 +278,7 @@ public function getContributions() /** * Sets contributions * - * @param string $contributions contributions + * @param int $contributions contributions * * @return $this */ diff --git a/src/Model/DiffFile.php b/src/Model/DiffFile.php new file mode 100644 index 0000000..5c154d7 --- /dev/null +++ b/src/Model/DiffFile.php @@ -0,0 +1,605 @@ + 'string', + 'filename' => 'string', + 'status' => 'string', + 'additions' => 'int', + 'deletions' => 'int', + 'changes' => 'int', + 'blobUrl' => 'string', + 'rawUrl' => 'string', + 'contentUrl' => 'string', + 'patch' => 'string', + 'truncated' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sha' => null, + 'filename' => null, + 'status' => null, + 'additions' => 'int32', + 'deletions' => 'int32', + 'changes' => 'int32', + 'blobUrl' => null, + 'rawUrl' => null, + 'contentUrl' => null, + 'patch' => null, + 'truncated' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sha' => 'sha', + 'filename' => 'filename', + 'status' => 'status', + 'additions' => 'additions', + 'deletions' => 'deletions', + 'changes' => 'changes', + 'blobUrl' => 'blob_url', + 'rawUrl' => 'raw_url', + 'contentUrl' => 'content_url', + 'patch' => 'patch', + 'truncated' => 'truncated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sha' => 'setSha', + 'filename' => 'setFilename', + 'status' => 'setStatus', + 'additions' => 'setAdditions', + 'deletions' => 'setDeletions', + 'changes' => 'setChanges', + 'blobUrl' => 'setBlobUrl', + 'rawUrl' => 'setRawUrl', + 'contentUrl' => 'setContentUrl', + 'patch' => 'setPatch', + 'truncated' => 'setTruncated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sha' => 'getSha', + 'filename' => 'getFilename', + 'status' => 'getStatus', + 'additions' => 'getAdditions', + 'deletions' => 'getDeletions', + 'changes' => 'getChanges', + 'blobUrl' => 'getBlobUrl', + 'rawUrl' => 'getRawUrl', + 'contentUrl' => 'getContentUrl', + 'patch' => 'getPatch', + 'truncated' => 'getTruncated' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sha'] = isset($data['sha']) ? $data['sha'] : null; + $this->container['filename'] = isset($data['filename']) ? $data['filename'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['additions'] = isset($data['additions']) ? $data['additions'] : null; + $this->container['deletions'] = isset($data['deletions']) ? $data['deletions'] : null; + $this->container['changes'] = isset($data['changes']) ? $data['changes'] : null; + $this->container['blobUrl'] = isset($data['blobUrl']) ? $data['blobUrl'] : null; + $this->container['rawUrl'] = isset($data['rawUrl']) ? $data['rawUrl'] : null; + $this->container['contentUrl'] = isset($data['contentUrl']) ? $data['contentUrl'] : null; + $this->container['patch'] = isset($data['patch']) ? $data['patch'] : null; + $this->container['truncated'] = isset($data['truncated']) ? $data['truncated'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sha + * + * @return string + */ + public function getSha() + { + return $this->container['sha']; + } + + /** + * Sets sha + * + * @param string $sha sha + * + * @return $this + */ + public function setSha($sha) + { + $this->container['sha'] = $sha; + + return $this; + } + + /** + * Gets filename + * + * @return string + */ + public function getFilename() + { + return $this->container['filename']; + } + + /** + * Sets filename + * + * @param string $filename 文件路径 + * + * @return $this + */ + public function setFilename($filename) + { + $this->container['filename'] = $filename; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status 文件状态 + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets additions + * + * @return int + */ + public function getAdditions() + { + return $this->container['additions']; + } + + /** + * Sets additions + * + * @param int $additions 新增行数 + * + * @return $this + */ + public function setAdditions($additions) + { + $this->container['additions'] = $additions; + + return $this; + } + + /** + * Gets deletions + * + * @return int + */ + public function getDeletions() + { + return $this->container['deletions']; + } + + /** + * Sets deletions + * + * @param int $deletions 删除行数 + * + * @return $this + */ + public function setDeletions($deletions) + { + $this->container['deletions'] = $deletions; + + return $this; + } + + /** + * Gets changes + * + * @return int + */ + public function getChanges() + { + return $this->container['changes']; + } + + /** + * Sets changes + * + * @param int $changes 变更行数 + * + * @return $this + */ + public function setChanges($changes) + { + $this->container['changes'] = $changes; + + return $this; + } + + /** + * Gets blobUrl + * + * @return string + */ + public function getBlobUrl() + { + return $this->container['blobUrl']; + } + + /** + * Sets blobUrl + * + * @param string $blobUrl blob 链接 + * + * @return $this + */ + public function setBlobUrl($blobUrl) + { + $this->container['blobUrl'] = $blobUrl; + + return $this; + } + + /** + * Gets rawUrl + * + * @return string + */ + public function getRawUrl() + { + return $this->container['rawUrl']; + } + + /** + * Sets rawUrl + * + * @param string $rawUrl raw 链接 + * + * @return $this + */ + public function setRawUrl($rawUrl) + { + $this->container['rawUrl'] = $rawUrl; + + return $this; + } + + /** + * Gets contentUrl + * + * @return string + */ + public function getContentUrl() + { + return $this->container['contentUrl']; + } + + /** + * Sets contentUrl + * + * @param string $contentUrl content 链接 + * + * @return $this + */ + public function setContentUrl($contentUrl) + { + $this->container['contentUrl'] = $contentUrl; + + return $this; + } + + /** + * Gets patch + * + * @return string + */ + public function getPatch() + { + return $this->container['patch']; + } + + /** + * Sets patch + * + * @param string $patch patch + * + * @return $this + */ + public function setPatch($patch) + { + $this->container['patch'] = $patch; + + return $this; + } + + /** + * Gets truncated + * + * @return bool + */ + public function getTruncated() + { + return $this->container['truncated']; + } + + /** + * Sets truncated + * + * @param bool $truncated patch 内容是否被截断 + * + * @return $this + */ + public function setTruncated($truncated) + { + $this->container['truncated'] = $truncated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EnterpriseBasic.php b/src/Model/EnterpriseBasic.php index fc2cdd1..4b1ee23 100644 --- a/src/Model/EnterpriseBasic.php +++ b/src/Model/EnterpriseBasic.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/EnterpriseMember.php b/src/Model/EnterpriseMember.php index 3ad7710..35f7e96 100644 --- a/src/Model/EnterpriseMember.php +++ b/src/Model/EnterpriseMember.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -59,12 +59,12 @@ class EnterpriseMember implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'url' => 'string', - 'active' => 'string', + 'active' => 'bool', 'remark' => 'string', 'role' => 'string', - 'outsourced' => 'string', + 'outsourced' => 'bool', 'enterprise' => '\Gitee\Model\EnterpriseBasic', - 'user' => 'string' + 'user' => '\Gitee\Model\UserMini' ]; /** @@ -268,7 +268,7 @@ public function setUrl($url) /** * Gets active * - * @return string + * @return bool */ public function getActive() { @@ -278,7 +278,7 @@ public function getActive() /** * Sets active * - * @param string $active active + * @param bool $active active * * @return $this */ @@ -340,7 +340,7 @@ public function setRole($role) /** * Gets outsourced * - * @return string + * @return bool */ public function getOutsourced() { @@ -350,7 +350,7 @@ public function getOutsourced() /** * Sets outsourced * - * @param string $outsourced outsourced + * @param bool $outsourced outsourced * * @return $this */ @@ -388,7 +388,7 @@ public function setEnterprise($enterprise) /** * Gets user * - * @return string + * @return \Gitee\Model\UserMini */ public function getUser() { @@ -398,7 +398,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserMini $user user * * @return $this */ diff --git a/src/Model/Event.php b/src/Model/Event.php index 5b41d0e..1b3e574 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -60,11 +60,11 @@ class Event implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'id' => 'int', 'type' => 'string', - 'actor' => 'string', - 'repo' => 'string', - 'org' => 'string', - 'public' => 'string', - 'createdAt' => 'string', + 'actor' => '\Gitee\Model\UserMini', + 'repo' => '\Gitee\Model\ProjectMini', + 'org' => '\Gitee\Model\GroupBasic', + 'public' => 'bool', + 'createdAt' => '\DateTime', 'payload' => 'object' ]; @@ -80,7 +80,7 @@ class Event implements ModelInterface, ArrayAccess 'repo' => null, 'org' => null, 'public' => null, - 'createdAt' => null, + 'createdAt' => 'date-time', 'payload' => null ]; @@ -298,7 +298,7 @@ public function setType($type) /** * Gets actor * - * @return string + * @return \Gitee\Model\UserMini */ public function getActor() { @@ -308,7 +308,7 @@ public function getActor() /** * Sets actor * - * @param string $actor actor + * @param \Gitee\Model\UserMini $actor actor * * @return $this */ @@ -322,7 +322,7 @@ public function setActor($actor) /** * Gets repo * - * @return string + * @return \Gitee\Model\ProjectMini */ public function getRepo() { @@ -332,7 +332,7 @@ public function getRepo() /** * Sets repo * - * @param string $repo repo + * @param \Gitee\Model\ProjectMini $repo repo * * @return $this */ @@ -346,7 +346,7 @@ public function setRepo($repo) /** * Gets org * - * @return string + * @return \Gitee\Model\GroupBasic */ public function getOrg() { @@ -356,7 +356,7 @@ public function getOrg() /** * Sets org * - * @param string $org org + * @param \Gitee\Model\GroupBasic $org org * * @return $this */ @@ -370,7 +370,7 @@ public function setOrg($org) /** * Gets public * - * @return string + * @return bool */ public function getPublic() { @@ -380,7 +380,7 @@ public function getPublic() /** * Sets public * - * @param string $public public + * @param bool $public public * * @return $this */ @@ -394,7 +394,7 @@ public function setPublic($public) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -404,7 +404,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ diff --git a/src/Model/GitUser.php b/src/Model/GitUser.php new file mode 100644 index 0000000..35fad2a --- /dev/null +++ b/src/Model/GitUser.php @@ -0,0 +1,365 @@ + 'string', + 'email' => 'string', + 'date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => null, + 'date' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email', + 'date' => 'date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail', + 'date' => 'setDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail', + 'date' => 'getDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['date'] = isset($data['date']) ? $data['date'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date date + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GiteeMetrics.php b/src/Model/GiteeMetrics.php index b429522..8057468 100644 --- a/src/Model/GiteeMetrics.php +++ b/src/Model/GiteeMetrics.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -68,8 +68,8 @@ class GiteeMetrics implements ModelInterface, ArrayAccess 'trendPercent' => 'float', 'influence' => 'int', 'influencePercent' => 'float', - 'totalScore' => 'string', - 'createdAt' => 'string', + 'totalScore' => 'int', + 'createdAt' => '\DateTime', 'repo' => '\Gitee\Model\ProjectBasic' ]; @@ -89,8 +89,8 @@ class GiteeMetrics implements ModelInterface, ArrayAccess 'trendPercent' => 'float', 'influence' => 'int32', 'influencePercent' => 'float', - 'totalScore' => null, - 'createdAt' => null, + 'totalScore' => 'int32', + 'createdAt' => 'date-time', 'repo' => null ]; @@ -520,7 +520,7 @@ public function setInfluencePercent($influencePercent) /** * Gets totalScore * - * @return string + * @return int */ public function getTotalScore() { @@ -530,7 +530,7 @@ public function getTotalScore() /** * Sets totalScore * - * @param string $totalScore totalScore + * @param int $totalScore totalScore * * @return $this */ @@ -544,7 +544,7 @@ public function setTotalScore($totalScore) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -554,7 +554,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ diff --git a/src/Model/Group.php b/src/Model/Group.php index ae83451..ccde214 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -36,7 +36,7 @@ * Group Class Doc Comment * * @category Class - * @description 获取一个组织 + * @description 创建组织 * @package Gitee * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -67,7 +67,7 @@ class Group implements ModelInterface, ArrayAccess 'eventsUrl' => 'string', 'membersUrl' => 'string', 'description' => 'string', - 'followCount' => 'string' + 'followCount' => 'int' ]; /** @@ -85,7 +85,7 @@ class Group implements ModelInterface, ArrayAccess 'eventsUrl' => null, 'membersUrl' => null, 'description' => null, - 'followCount' => null + 'followCount' => 'int32' ]; /** @@ -478,7 +478,7 @@ public function setDescription($description) /** * Gets followCount * - * @return string + * @return int */ public function getFollowCount() { @@ -488,7 +488,7 @@ public function getFollowCount() /** * Sets followCount * - * @param string $followCount followCount + * @param int $followCount followCount * * @return $this */ diff --git a/src/Model/GroupBasic.php b/src/Model/GroupBasic.php new file mode 100644 index 0000000..c2db7e0 --- /dev/null +++ b/src/Model/GroupBasic.php @@ -0,0 +1,425 @@ + 'int', + 'login' => 'string', + 'name' => 'string', + 'url' => 'string', + 'avatarUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int32', + 'login' => null, + 'name' => null, + 'url' => null, + 'avatarUrl' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'login' => 'login', + 'name' => 'name', + 'url' => 'url', + 'avatarUrl' => 'avatar_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'login' => 'setLogin', + 'name' => 'setName', + 'url' => 'setUrl', + 'avatarUrl' => 'setAvatarUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'login' => 'getLogin', + 'name' => 'getName', + 'url' => 'getUrl', + 'avatarUrl' => 'getAvatarUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['login'] = isset($data['login']) ? $data['login'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['avatarUrl'] = isset($data['avatarUrl']) ? $data['avatarUrl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets login + * + * @return string + */ + public function getLogin() + { + return $this->container['login']; + } + + /** + * Sets login + * + * @param string $login login + * + * @return $this + */ + public function setLogin($login) + { + $this->container['login'] = $login; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets avatarUrl + * + * @return string + */ + public function getAvatarUrl() + { + return $this->container['avatarUrl']; + } + + /** + * Sets avatarUrl + * + * @param string $avatarUrl avatarUrl + * + * @return $this + */ + public function setAvatarUrl($avatarUrl) + { + $this->container['avatarUrl'] = $avatarUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GroupDetail.php b/src/Model/GroupDetail.php index 9762207..7073b35 100644 --- a/src/Model/GroupDetail.php +++ b/src/Model/GroupDetail.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -67,18 +67,18 @@ class GroupDetail implements ModelInterface, ArrayAccess 'eventsUrl' => 'string', 'membersUrl' => 'string', 'description' => 'string', - 'followCount' => 'string', - 'createdAt' => 'string', + 'followCount' => 'int', 'type' => 'string', 'location' => 'string', 'email' => 'string', + 'createdAt' => '\DateTime', 'htmlUrl' => 'string', - 'public' => 'string', + 'public' => 'bool', 'enterprise' => 'string', - 'members' => 'string', - 'publicRepos' => 'string', - 'privateRepos' => 'string', - 'owner' => 'string' + 'members' => 'int', + 'publicRepos' => 'int', + 'privateRepos' => 'int', + 'owner' => '\Gitee\Model\UserMini' ]; /** @@ -96,17 +96,17 @@ class GroupDetail implements ModelInterface, ArrayAccess 'eventsUrl' => null, 'membersUrl' => null, 'description' => null, - 'followCount' => null, - 'createdAt' => null, + 'followCount' => 'int32', 'type' => null, 'location' => null, 'email' => null, + 'createdAt' => 'date-time', 'htmlUrl' => null, 'public' => null, 'enterprise' => null, - 'members' => null, - 'publicRepos' => null, - 'privateRepos' => null, + 'members' => 'int32', + 'publicRepos' => 'int32', + 'privateRepos' => 'int32', 'owner' => null ]; @@ -147,10 +147,10 @@ public static function swaggerFormats() 'membersUrl' => 'members_url', 'description' => 'description', 'followCount' => 'follow_count', - 'createdAt' => 'created_at', 'type' => 'type', 'location' => 'location', 'email' => 'email', + 'createdAt' => 'created_at', 'htmlUrl' => 'html_url', 'public' => 'public', 'enterprise' => 'enterprise', @@ -176,10 +176,10 @@ public static function swaggerFormats() 'membersUrl' => 'setMembersUrl', 'description' => 'setDescription', 'followCount' => 'setFollowCount', - 'createdAt' => 'setCreatedAt', 'type' => 'setType', 'location' => 'setLocation', 'email' => 'setEmail', + 'createdAt' => 'setCreatedAt', 'htmlUrl' => 'setHtmlUrl', 'public' => 'setPublic', 'enterprise' => 'setEnterprise', @@ -205,10 +205,10 @@ public static function swaggerFormats() 'membersUrl' => 'getMembersUrl', 'description' => 'getDescription', 'followCount' => 'getFollowCount', - 'createdAt' => 'getCreatedAt', 'type' => 'getType', 'location' => 'getLocation', 'email' => 'getEmail', + 'createdAt' => 'getCreatedAt', 'htmlUrl' => 'getHtmlUrl', 'public' => 'getPublic', 'enterprise' => 'getEnterprise', @@ -288,10 +288,10 @@ public function __construct(array $data = null) $this->container['membersUrl'] = isset($data['membersUrl']) ? $data['membersUrl'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['followCount'] = isset($data['followCount']) ? $data['followCount'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; $this->container['type'] = isset($data['type']) ? $data['type'] : null; $this->container['location'] = isset($data['location']) ? $data['location'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null; $this->container['public'] = isset($data['public']) ? $data['public'] : null; $this->container['enterprise'] = isset($data['enterprise']) ? $data['enterprise'] : null; @@ -544,7 +544,7 @@ public function setDescription($description) /** * Gets followCount * - * @return string + * @return int */ public function getFollowCount() { @@ -554,7 +554,7 @@ public function getFollowCount() /** * Sets followCount * - * @param string $followCount followCount + * @param int $followCount followCount * * @return $this */ @@ -565,30 +565,6 @@ public function setFollowCount($followCount) return $this; } - /** - * Gets createdAt - * - * @return string - */ - public function getCreatedAt() - { - return $this->container['createdAt']; - } - - /** - * Sets createdAt - * - * @param string $createdAt createdAt - * - * @return $this - */ - public function setCreatedAt($createdAt) - { - $this->container['createdAt'] = $createdAt; - - return $this; - } - /** * Gets type * @@ -661,6 +637,30 @@ public function setEmail($email) return $this; } + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt createdAt + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** * Gets htmlUrl * @@ -688,7 +688,7 @@ public function setHtmlUrl($htmlUrl) /** * Gets public * - * @return string + * @return bool */ public function getPublic() { @@ -698,7 +698,7 @@ public function getPublic() /** * Sets public * - * @param string $public public + * @param bool $public public * * @return $this */ @@ -736,7 +736,7 @@ public function setEnterprise($enterprise) /** * Gets members * - * @return string + * @return int */ public function getMembers() { @@ -746,7 +746,7 @@ public function getMembers() /** * Sets members * - * @param string $members members + * @param int $members members * * @return $this */ @@ -760,7 +760,7 @@ public function setMembers($members) /** * Gets publicRepos * - * @return string + * @return int */ public function getPublicRepos() { @@ -770,7 +770,7 @@ public function getPublicRepos() /** * Sets publicRepos * - * @param string $publicRepos publicRepos + * @param int $publicRepos publicRepos * * @return $this */ @@ -784,7 +784,7 @@ public function setPublicRepos($publicRepos) /** * Gets privateRepos * - * @return string + * @return int */ public function getPrivateRepos() { @@ -794,7 +794,7 @@ public function getPrivateRepos() /** * Sets privateRepos * - * @param string $privateRepos privateRepos + * @param int $privateRepos privateRepos * * @return $this */ @@ -808,7 +808,7 @@ public function setPrivateRepos($privateRepos) /** * Gets owner * - * @return string + * @return \Gitee\Model\UserMini */ public function getOwner() { @@ -818,7 +818,7 @@ public function getOwner() /** * Sets owner * - * @param string $owner owner + * @param \Gitee\Model\UserMini $owner owner * * @return $this */ diff --git a/src/Model/GroupFollowers.php b/src/Model/GroupFollowers.php index da145c4..6187922 100644 --- a/src/Model/GroupFollowers.php +++ b/src/Model/GroupFollowers.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -59,7 +59,7 @@ class GroupFollowers implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'self' => '\Gitee\Model\UserBasic', - 'followedAt' => 'string' + 'followedAt' => '\DateTime' ]; /** @@ -69,7 +69,7 @@ class GroupFollowers implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'self' => null, - 'followedAt' => null + 'followedAt' => 'date-time' ]; /** @@ -238,7 +238,7 @@ public function setSelf($self) /** * Gets followedAt * - * @return string + * @return \DateTime */ public function getFollowedAt() { @@ -248,7 +248,7 @@ public function getFollowedAt() /** * Sets followedAt * - * @param string $followedAt followedAt + * @param \DateTime $followedAt followedAt * * @return $this */ diff --git a/src/Model/GroupMember.php b/src/Model/GroupMember.php index 5e66286..fe79a50 100644 --- a/src/Model/GroupMember.php +++ b/src/Model/GroupMember.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -59,12 +59,12 @@ class GroupMember implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'url' => 'string', - 'active' => 'string', + 'active' => 'bool', 'remark' => 'string', 'role' => 'string', 'organizationUrl' => 'string', 'organization' => '\Gitee\Model\Group', - 'user' => 'string' + 'user' => '\Gitee\Model\UserMini' ]; /** @@ -268,7 +268,7 @@ public function setUrl($url) /** * Gets active * - * @return string + * @return bool */ public function getActive() { @@ -278,7 +278,7 @@ public function getActive() /** * Sets active * - * @param string $active active + * @param bool $active active * * @return $this */ @@ -388,7 +388,7 @@ public function setOrganization($organization) /** * Gets user * - * @return string + * @return \Gitee\Model\UserMini */ public function getUser() { @@ -398,7 +398,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserMini $user user * * @return $this */ diff --git a/src/Model/Hook.php b/src/Model/Hook.php index f97ea2f..242f387 100644 --- a/src/Model/Hook.php +++ b/src/Model/Hook.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,18 +58,18 @@ class Hook implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', + 'id' => 'int', 'url' => 'string', - 'createdAt' => 'string', 'password' => 'string', - 'projectId' => 'string', 'result' => 'string', - 'resultCode' => 'string', - 'pushEvents' => 'string', - 'tagPushEvents' => 'string', - 'issuesEvents' => 'string', - 'noteEvents' => 'string', - 'mergeRequestsEvents' => 'string' + 'projectId' => 'int', + 'resultCode' => 'int', + 'createdAt' => '\DateTime', + 'pushEvents' => 'bool', + 'tagPushEvents' => 'bool', + 'issuesEvents' => 'bool', + 'noteEvents' => 'bool', + 'mergeRequestsEvents' => 'bool' ]; /** @@ -78,13 +78,13 @@ class Hook implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, + 'id' => 'int32', 'url' => null, - 'createdAt' => null, 'password' => null, - 'projectId' => null, 'result' => null, - 'resultCode' => null, + 'projectId' => 'int32', + 'resultCode' => 'int32', + 'createdAt' => 'date-time', 'pushEvents' => null, 'tagPushEvents' => null, 'issuesEvents' => null, @@ -121,11 +121,11 @@ public static function swaggerFormats() protected static $attributeMap = [ 'id' => 'id', 'url' => 'url', - 'createdAt' => 'created_at', 'password' => 'password', - 'projectId' => 'project_id', 'result' => 'result', + 'projectId' => 'project_id', 'resultCode' => 'result_code', + 'createdAt' => 'created_at', 'pushEvents' => 'push_events', 'tagPushEvents' => 'tag_push_events', 'issuesEvents' => 'issues_events', @@ -141,11 +141,11 @@ public static function swaggerFormats() protected static $setters = [ 'id' => 'setId', 'url' => 'setUrl', - 'createdAt' => 'setCreatedAt', 'password' => 'setPassword', - 'projectId' => 'setProjectId', 'result' => 'setResult', + 'projectId' => 'setProjectId', 'resultCode' => 'setResultCode', + 'createdAt' => 'setCreatedAt', 'pushEvents' => 'setPushEvents', 'tagPushEvents' => 'setTagPushEvents', 'issuesEvents' => 'setIssuesEvents', @@ -161,11 +161,11 @@ public static function swaggerFormats() protected static $getters = [ 'id' => 'getId', 'url' => 'getUrl', - 'createdAt' => 'getCreatedAt', 'password' => 'getPassword', - 'projectId' => 'getProjectId', 'result' => 'getResult', + 'projectId' => 'getProjectId', 'resultCode' => 'getResultCode', + 'createdAt' => 'getCreatedAt', 'pushEvents' => 'getPushEvents', 'tagPushEvents' => 'getTagPushEvents', 'issuesEvents' => 'getIssuesEvents', @@ -235,11 +235,11 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['projectId'] = isset($data['projectId']) ? $data['projectId'] : null; $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['projectId'] = isset($data['projectId']) ? $data['projectId'] : null; $this->container['resultCode'] = isset($data['resultCode']) ? $data['resultCode'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; $this->container['pushEvents'] = isset($data['pushEvents']) ? $data['pushEvents'] : null; $this->container['tagPushEvents'] = isset($data['tagPushEvents']) ? $data['tagPushEvents'] : null; $this->container['issuesEvents'] = isset($data['issuesEvents']) ? $data['issuesEvents'] : null; @@ -274,7 +274,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -284,7 +284,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -320,49 +320,49 @@ public function setUrl($url) } /** - * Gets createdAt + * Gets password * * @return string */ - public function getCreatedAt() + public function getPassword() { - return $this->container['createdAt']; + return $this->container['password']; } /** - * Sets createdAt + * Sets password * - * @param string $createdAt createdAt + * @param string $password password * * @return $this */ - public function setCreatedAt($createdAt) + public function setPassword($password) { - $this->container['createdAt'] = $createdAt; + $this->container['password'] = $password; return $this; } /** - * Gets password + * Gets result * * @return string */ - public function getPassword() + public function getResult() { - return $this->container['password']; + return $this->container['result']; } /** - * Sets password + * Sets result * - * @param string $password password + * @param string $result result * * @return $this */ - public function setPassword($password) + public function setResult($result) { - $this->container['password'] = $password; + $this->container['result'] = $result; return $this; } @@ -370,7 +370,7 @@ public function setPassword($password) /** * Gets projectId * - * @return string + * @return int */ public function getProjectId() { @@ -380,7 +380,7 @@ public function getProjectId() /** * Sets projectId * - * @param string $projectId projectId + * @param int $projectId projectId * * @return $this */ @@ -392,49 +392,49 @@ public function setProjectId($projectId) } /** - * Gets result + * Gets resultCode * - * @return string + * @return int */ - public function getResult() + public function getResultCode() { - return $this->container['result']; + return $this->container['resultCode']; } /** - * Sets result + * Sets resultCode * - * @param string $result result + * @param int $resultCode resultCode * * @return $this */ - public function setResult($result) + public function setResultCode($resultCode) { - $this->container['result'] = $result; + $this->container['resultCode'] = $resultCode; return $this; } /** - * Gets resultCode + * Gets createdAt * - * @return string + * @return \DateTime */ - public function getResultCode() + public function getCreatedAt() { - return $this->container['resultCode']; + return $this->container['createdAt']; } /** - * Sets resultCode + * Sets createdAt * - * @param string $resultCode resultCode + * @param \DateTime $createdAt createdAt * * @return $this */ - public function setResultCode($resultCode) + public function setCreatedAt($createdAt) { - $this->container['resultCode'] = $resultCode; + $this->container['createdAt'] = $createdAt; return $this; } @@ -442,7 +442,7 @@ public function setResultCode($resultCode) /** * Gets pushEvents * - * @return string + * @return bool */ public function getPushEvents() { @@ -452,7 +452,7 @@ public function getPushEvents() /** * Sets pushEvents * - * @param string $pushEvents pushEvents + * @param bool $pushEvents pushEvents * * @return $this */ @@ -466,7 +466,7 @@ public function setPushEvents($pushEvents) /** * Gets tagPushEvents * - * @return string + * @return bool */ public function getTagPushEvents() { @@ -476,7 +476,7 @@ public function getTagPushEvents() /** * Sets tagPushEvents * - * @param string $tagPushEvents tagPushEvents + * @param bool $tagPushEvents tagPushEvents * * @return $this */ @@ -490,7 +490,7 @@ public function setTagPushEvents($tagPushEvents) /** * Gets issuesEvents * - * @return string + * @return bool */ public function getIssuesEvents() { @@ -500,7 +500,7 @@ public function getIssuesEvents() /** * Sets issuesEvents * - * @param string $issuesEvents issuesEvents + * @param bool $issuesEvents issuesEvents * * @return $this */ @@ -514,7 +514,7 @@ public function setIssuesEvents($issuesEvents) /** * Gets noteEvents * - * @return string + * @return bool */ public function getNoteEvents() { @@ -524,7 +524,7 @@ public function getNoteEvents() /** * Sets noteEvents * - * @param string $noteEvents noteEvents + * @param bool $noteEvents noteEvents * * @return $this */ @@ -538,7 +538,7 @@ public function setNoteEvents($noteEvents) /** * Gets mergeRequestsEvents * - * @return string + * @return bool */ public function getMergeRequestsEvents() { @@ -548,7 +548,7 @@ public function getMergeRequestsEvents() /** * Sets mergeRequestsEvents * - * @param string $mergeRequestsEvents mergeRequestsEvents + * @param bool $mergeRequestsEvents mergeRequestsEvents * * @return $this */ diff --git a/src/Model/Issue.php b/src/Model/Issue.php index 64e0bd2..f906044 100644 --- a/src/Model/Issue.php +++ b/src/Model/Issue.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -73,9 +73,9 @@ class Issue implements ModelInterface, ArrayAccess 'body' => 'string', 'bodyHtml' => 'string', 'user' => '\Gitee\Model\UserBasic', - 'labels' => '\Gitee\Model\Label', + 'labels' => '\Gitee\Model\Label[]', 'assignee' => '\Gitee\Model\UserBasic', - 'collaborators' => '\Gitee\Model\UserBasic', + 'collaborators' => '\Gitee\Model\UserBasic[]', 'repository' => '\Gitee\Model\Project', 'milestone' => '\Gitee\Model\Milestone', 'createdAt' => '\DateTime', @@ -760,7 +760,7 @@ public function setUser($user) /** * Gets labels * - * @return \Gitee\Model\Label + * @return \Gitee\Model\Label[] */ public function getLabels() { @@ -770,7 +770,7 @@ public function getLabels() /** * Sets labels * - * @param \Gitee\Model\Label $labels 标签 + * @param \Gitee\Model\Label[] $labels 标签 * * @return $this */ @@ -808,7 +808,7 @@ public function setAssignee($assignee) /** * Gets collaborators * - * @return \Gitee\Model\UserBasic + * @return \Gitee\Model\UserBasic[] */ public function getCollaborators() { @@ -818,7 +818,7 @@ public function getCollaborators() /** * Sets collaborators * - * @param \Gitee\Model\UserBasic $collaborators 协作者 + * @param \Gitee\Model\UserBasic[] $collaborators 协作者 * * @return $this */ diff --git a/src/Model/IssueState.php b/src/Model/IssueState.php index 03eb266..0fbf371 100644 --- a/src/Model/IssueState.php +++ b/src/Model/IssueState.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -62,7 +62,9 @@ class IssueState implements ModelInterface, ArrayAccess 'color' => 'string', 'icon' => 'string', 'command' => 'string', - 'serial' => 'string' + 'serial' => 'int', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime' ]; /** @@ -76,7 +78,9 @@ class IssueState implements ModelInterface, ArrayAccess 'color' => null, 'icon' => null, 'command' => null, - 'serial' => null + 'serial' => 'int32', + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time' ]; /** @@ -111,7 +115,9 @@ public static function swaggerFormats() 'color' => 'color', 'icon' => 'icon', 'command' => 'command', - 'serial' => 'serial' + 'serial' => 'serial', + 'createdAt' => 'created_at', + 'updatedAt' => 'updated_at' ]; /** @@ -125,7 +131,9 @@ public static function swaggerFormats() 'color' => 'setColor', 'icon' => 'setIcon', 'command' => 'setCommand', - 'serial' => 'setSerial' + 'serial' => 'setSerial', + 'createdAt' => 'setCreatedAt', + 'updatedAt' => 'setUpdatedAt' ]; /** @@ -139,7 +147,9 @@ public static function swaggerFormats() 'color' => 'getColor', 'icon' => 'getIcon', 'command' => 'getCommand', - 'serial' => 'getSerial' + 'serial' => 'getSerial', + 'createdAt' => 'getCreatedAt', + 'updatedAt' => 'getUpdatedAt' ]; /** @@ -208,6 +218,8 @@ public function __construct(array $data = null) $this->container['icon'] = isset($data['icon']) ? $data['icon'] : null; $this->container['command'] = isset($data['command']) ? $data['command'] : null; $this->container['serial'] = isset($data['serial']) ? $data['serial'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null; } /** @@ -357,7 +369,7 @@ public function setCommand($command) /** * Gets serial * - * @return string + * @return int */ public function getSerial() { @@ -367,7 +379,7 @@ public function getSerial() /** * Sets serial * - * @param string $serial 任务状态的 排序 + * @param int $serial 任务状态的 排序 * * @return $this */ @@ -377,6 +389,54 @@ public function setSerial($serial) return $this; } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt 任务状态创建时间 + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt 任务状态更新时间 + * + * @return $this + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/IssueType.php b/src/Model/IssueType.php index 371d472..46a9a2b 100644 --- a/src/Model/IssueType.php +++ b/src/Model/IssueType.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -62,7 +62,9 @@ class IssueType implements ModelInterface, ArrayAccess 'template' => 'string', 'ident' => 'string', 'color' => 'string', - 'isSystem' => 'bool' + 'isSystem' => 'bool', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime' ]; /** @@ -76,7 +78,9 @@ class IssueType implements ModelInterface, ArrayAccess 'template' => null, 'ident' => null, 'color' => null, - 'isSystem' => null + 'isSystem' => null, + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time' ]; /** @@ -111,7 +115,9 @@ public static function swaggerFormats() 'template' => 'template', 'ident' => 'ident', 'color' => 'color', - 'isSystem' => 'is_system' + 'isSystem' => 'is_system', + 'createdAt' => 'created_at', + 'updatedAt' => 'updated_at' ]; /** @@ -125,7 +131,9 @@ public static function swaggerFormats() 'template' => 'setTemplate', 'ident' => 'setIdent', 'color' => 'setColor', - 'isSystem' => 'setIsSystem' + 'isSystem' => 'setIsSystem', + 'createdAt' => 'setCreatedAt', + 'updatedAt' => 'setUpdatedAt' ]; /** @@ -139,7 +147,9 @@ public static function swaggerFormats() 'template' => 'getTemplate', 'ident' => 'getIdent', 'color' => 'getColor', - 'isSystem' => 'getIsSystem' + 'isSystem' => 'getIsSystem', + 'createdAt' => 'getCreatedAt', + 'updatedAt' => 'getUpdatedAt' ]; /** @@ -208,6 +218,8 @@ public function __construct(array $data = null) $this->container['ident'] = isset($data['ident']) ? $data['ident'] : null; $this->container['color'] = isset($data['color']) ? $data['color'] : null; $this->container['isSystem'] = isset($data['isSystem']) ? $data['isSystem'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null; } /** @@ -377,6 +389,54 @@ public function setIsSystem($isSystem) return $this; } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt 任务类型创建时间 + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt 任务类型更新时间 + * + * @return $this + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/Label.php b/src/Model/Label.php index a0a2a57..dc59b49 100644 --- a/src/Model/Label.php +++ b/src/Model/Label.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/Milestone.php b/src/Model/Milestone.php index 56a0b68..fae64f6 100644 --- a/src/Model/Milestone.php +++ b/src/Model/Milestone.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -89,7 +89,7 @@ class Milestone implements ModelInterface, ArrayAccess 'createdAt' => 'date-time', 'openIssues' => 'int32', 'closedIssues' => 'int32', - 'dueOn' => 'date-time' + 'dueOn' => 'date' ]; /** diff --git a/src/Model/ModelInterface.php b/src/Model/ModelInterface.php index f9c073a..f4cd671 100644 --- a/src/Model/ModelInterface.php +++ b/src/Model/ModelInterface.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/ModelNamespace.php b/src/Model/ModelNamespace.php index a853365..812ef67 100644 --- a/src/Model/ModelNamespace.php +++ b/src/Model/ModelNamespace.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/NamespaceMini.php b/src/Model/NamespaceMini.php index 1e12fd7..f045bec 100644 --- a/src/Model/NamespaceMini.php +++ b/src/Model/NamespaceMini.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/Note.php b/src/Model/Note.php index aa00de3..68a82ac 100644 --- a/src/Model/Note.php +++ b/src/Model/Note.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,15 +58,16 @@ class Note implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', + 'id' => 'int', 'body' => 'string', 'bodyHtml' => 'string', - 'user' => 'string', + 'user' => '\Gitee\Model\UserBasic', 'source' => 'string', - 'target' => 'string', + 'target' => 'object', 'createdAt' => '\DateTime', 'updatedAt' => '\DateTime', - 'inReplyToId' => 'string' + 'inReplyToId' => 'int', + 'inReplyToUser' => '\Gitee\Model\UserBasic' ]; /** @@ -75,7 +76,7 @@ class Note implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, + 'id' => 'int32', 'body' => null, 'bodyHtml' => null, 'user' => null, @@ -83,7 +84,8 @@ class Note implements ModelInterface, ArrayAccess 'target' => null, 'createdAt' => 'date-time', 'updatedAt' => 'date-time', - 'inReplyToId' => null + 'inReplyToId' => 'int32', + 'inReplyToUser' => null ]; /** @@ -121,7 +123,8 @@ public static function swaggerFormats() 'target' => 'target', 'createdAt' => 'created_at', 'updatedAt' => 'updated_at', - 'inReplyToId' => 'in_reply_to_id' + 'inReplyToId' => 'in_reply_to_id', + 'inReplyToUser' => 'in_reply_to_user' ]; /** @@ -138,7 +141,8 @@ public static function swaggerFormats() 'target' => 'setTarget', 'createdAt' => 'setCreatedAt', 'updatedAt' => 'setUpdatedAt', - 'inReplyToId' => 'setInReplyToId' + 'inReplyToId' => 'setInReplyToId', + 'inReplyToUser' => 'setInReplyToUser' ]; /** @@ -155,7 +159,8 @@ public static function swaggerFormats() 'target' => 'getTarget', 'createdAt' => 'getCreatedAt', 'updatedAt' => 'getUpdatedAt', - 'inReplyToId' => 'getInReplyToId' + 'inReplyToId' => 'getInReplyToId', + 'inReplyToUser' => 'getInReplyToUser' ]; /** @@ -227,6 +232,7 @@ public function __construct(array $data = null) $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null; $this->container['inReplyToId'] = isset($data['inReplyToId']) ? $data['inReplyToId'] : null; + $this->container['inReplyToUser'] = isset($data['inReplyToUser']) ? $data['inReplyToUser'] : null; } /** @@ -256,7 +262,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -266,7 +272,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -328,7 +334,7 @@ public function setBodyHtml($bodyHtml) /** * Gets user * - * @return string + * @return \Gitee\Model\UserBasic */ public function getUser() { @@ -338,7 +344,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserBasic $user user * * @return $this */ @@ -376,7 +382,7 @@ public function setSource($source) /** * Gets target * - * @return string + * @return object */ public function getTarget() { @@ -386,7 +392,7 @@ public function getTarget() /** * Sets target * - * @param string $target target + * @param object $target target * * @return $this */ @@ -448,7 +454,7 @@ public function setUpdatedAt($updatedAt) /** * Gets inReplyToId * - * @return string + * @return int */ public function getInReplyToId() { @@ -458,7 +464,7 @@ public function getInReplyToId() /** * Sets inReplyToId * - * @param string $inReplyToId inReplyToId + * @param int $inReplyToId inReplyToId * * @return $this */ @@ -468,6 +474,30 @@ public function setInReplyToId($inReplyToId) return $this; } + + /** + * Gets inReplyToUser + * + * @return \Gitee\Model\UserBasic + */ + public function getInReplyToUser() + { + return $this->container['inReplyToUser']; + } + + /** + * Sets inReplyToUser + * + * @param \Gitee\Model\UserBasic $inReplyToUser inReplyToUser + * + * @return $this + */ + public function setInReplyToUser($inReplyToUser) + { + $this->container['inReplyToUser'] = $inReplyToUser; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/OperateLog.php b/src/Model/OperateLog.php index 76b9898..443e83d 100644 --- a/src/Model/OperateLog.php +++ b/src/Model/OperateLog.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,12 +58,13 @@ class OperateLog implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', + 'id' => 'int', 'icon' => 'string', - 'user' => 'string', + 'user' => '\Gitee\Model\UserBasic', + 'target' => 'string', 'content' => 'string', - 'linkTarget' => 'string', - 'createdAt' => 'string', + 'linkTarget' => 'object', + 'createdAt' => '\DateTime', 'actionType' => 'string' ]; @@ -73,12 +74,13 @@ class OperateLog implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, + 'id' => 'int32', 'icon' => null, 'user' => null, + 'target' => null, 'content' => null, 'linkTarget' => null, - 'createdAt' => null, + 'createdAt' => 'date-time', 'actionType' => null ]; @@ -112,6 +114,7 @@ public static function swaggerFormats() 'id' => 'id', 'icon' => 'icon', 'user' => 'user', + 'target' => 'target', 'content' => 'content', 'linkTarget' => 'link_target', 'createdAt' => 'created_at', @@ -127,6 +130,7 @@ public static function swaggerFormats() 'id' => 'setId', 'icon' => 'setIcon', 'user' => 'setUser', + 'target' => 'setTarget', 'content' => 'setContent', 'linkTarget' => 'setLinkTarget', 'createdAt' => 'setCreatedAt', @@ -142,6 +146,7 @@ public static function swaggerFormats() 'id' => 'getId', 'icon' => 'getIcon', 'user' => 'getUser', + 'target' => 'getTarget', 'content' => 'getContent', 'linkTarget' => 'getLinkTarget', 'createdAt' => 'getCreatedAt', @@ -211,6 +216,7 @@ public function __construct(array $data = null) $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['icon'] = isset($data['icon']) ? $data['icon'] : null; $this->container['user'] = isset($data['user']) ? $data['user'] : null; + $this->container['target'] = isset($data['target']) ? $data['target'] : null; $this->container['content'] = isset($data['content']) ? $data['content'] : null; $this->container['linkTarget'] = isset($data['linkTarget']) ? $data['linkTarget'] : null; $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; @@ -244,7 +250,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -254,7 +260,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -292,7 +298,7 @@ public function setIcon($icon) /** * Gets user * - * @return string + * @return \Gitee\Model\UserBasic */ public function getUser() { @@ -302,7 +308,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserBasic $user user * * @return $this */ @@ -313,6 +319,30 @@ public function setUser($user) return $this; } + /** + * Gets target + * + * @return string + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param string $target target + * + * @return $this + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + /** * Gets content * @@ -340,7 +370,7 @@ public function setContent($content) /** * Gets linkTarget * - * @return string + * @return object */ public function getLinkTarget() { @@ -350,7 +380,7 @@ public function getLinkTarget() /** * Sets linkTarget * - * @param string $linkTarget linkTarget + * @param object $linkTarget linkTarget * * @return $this */ @@ -364,7 +394,7 @@ public function setLinkTarget($linkTarget) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -374,7 +404,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ diff --git a/src/Model/PostV5ReposOwnerRepoCommits.php b/src/Model/PostV5ReposOwnerRepoCommits.php new file mode 100644 index 0000000..e9c2d77 --- /dev/null +++ b/src/Model/PostV5ReposOwnerRepoCommits.php @@ -0,0 +1,465 @@ + 'string', + 'branch' => 'string', + 'message' => 'string', + 'actions' => '\Gitee\Model\PostV5ReposOwnerRepoCommitsActions[]', + 'startBranch' => 'string', + 'author' => '\Gitee\Model\PostV5ReposOwnerRepoCommitsAuthor' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'accessToken' => null, + 'branch' => null, + 'message' => null, + 'actions' => null, + 'startBranch' => null, + 'author' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accessToken' => 'access_token', + 'branch' => 'branch', + 'message' => 'message', + 'actions' => 'actions', + 'startBranch' => 'start_branch', + 'author' => 'author' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accessToken' => 'setAccessToken', + 'branch' => 'setBranch', + 'message' => 'setMessage', + 'actions' => 'setActions', + 'startBranch' => 'setStartBranch', + 'author' => 'setAuthor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accessToken' => 'getAccessToken', + 'branch' => 'getBranch', + 'message' => 'getMessage', + 'actions' => 'getActions', + 'startBranch' => 'getStartBranch', + 'author' => 'getAuthor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['accessToken'] = isset($data['accessToken']) ? $data['accessToken'] : null; + $this->container['branch'] = isset($data['branch']) ? $data['branch'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['actions'] = isset($data['actions']) ? $data['actions'] : null; + $this->container['startBranch'] = isset($data['startBranch']) ? $data['startBranch'] : null; + $this->container['author'] = isset($data['author']) ? $data['author'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['branch'] === null) { + $invalidProperties[] = "'branch' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['actions'] === null) { + $invalidProperties[] = "'actions' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accessToken + * + * @return string + */ + public function getAccessToken() + { + return $this->container['accessToken']; + } + + /** + * Sets accessToken + * + * @param string $accessToken 用户授权码 + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->container['accessToken'] = $accessToken; + + return $this; + } + + /** + * Gets branch + * + * @return string + */ + public function getBranch() + { + return $this->container['branch']; + } + + /** + * Sets branch + * + * @param string $branch 变更的目标分支名。创建新分支时需提供 `start_branch` 参数 + * + * @return $this + */ + public function setBranch($branch) + { + $this->container['branch'] = $branch; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message 提交信息 + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets actions + * + * @return \Gitee\Model\PostV5ReposOwnerRepoCommitsActions[] + */ + public function getActions() + { + return $this->container['actions']; + } + + /** + * Sets actions + * + * @param \Gitee\Model\PostV5ReposOwnerRepoCommitsActions[] $actions actions + * + * @return $this + */ + public function setActions($actions) + { + $this->container['actions'] = $actions; + + return $this; + } + + /** + * Gets startBranch + * + * @return string + */ + public function getStartBranch() + { + return $this->container['startBranch']; + } + + /** + * Sets startBranch + * + * @param string $startBranch 分支起地点。新建分支时使用,更新分支时可选 + * + * @return $this + */ + public function setStartBranch($startBranch) + { + $this->container['startBranch'] = $startBranch; + + return $this; + } + + /** + * Gets author + * + * @return \Gitee\Model\PostV5ReposOwnerRepoCommitsAuthor + */ + public function getAuthor() + { + return $this->container['author']; + } + + /** + * Sets author + * + * @param \Gitee\Model\PostV5ReposOwnerRepoCommitsAuthor $author author + * + * @return $this + */ + public function setAuthor($author) + { + $this->container['author'] = $author; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PostV5ReposOwnerRepoCommitsActions.php b/src/Model/PostV5ReposOwnerRepoCommitsActions.php new file mode 100644 index 0000000..77344a3 --- /dev/null +++ b/src/Model/PostV5ReposOwnerRepoCommitsActions.php @@ -0,0 +1,491 @@ + 'string', + 'path' => 'string', + 'previousPath' => 'string', + 'content' => 'string', + 'encoding' => 'string', + 'lastCommitId' => 'string', + 'executeFilemode' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'action' => null, + 'path' => null, + 'previousPath' => null, + 'content' => null, + 'encoding' => null, + 'lastCommitId' => null, + 'executeFilemode' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'path' => 'path', + 'previousPath' => 'previous_path', + 'content' => 'content', + 'encoding' => 'encoding', + 'lastCommitId' => 'last_commit_id', + 'executeFilemode' => 'execute_filemode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'path' => 'setPath', + 'previousPath' => 'setPreviousPath', + 'content' => 'setContent', + 'encoding' => 'setEncoding', + 'lastCommitId' => 'setLastCommitId', + 'executeFilemode' => 'setExecuteFilemode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'path' => 'getPath', + 'previousPath' => 'getPreviousPath', + 'content' => 'getContent', + 'encoding' => 'getEncoding', + 'lastCommitId' => 'getLastCommitId', + 'executeFilemode' => 'getExecuteFilemode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['path'] = isset($data['path']) ? $data['path'] : null; + $this->container['previousPath'] = isset($data['previousPath']) ? $data['previousPath'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['encoding'] = isset($data['encoding']) ? $data['encoding'] : null; + $this->container['lastCommitId'] = isset($data['lastCommitId']) ? $data['lastCommitId'] : null; + $this->container['executeFilemode'] = isset($data['executeFilemode']) ? $data['executeFilemode'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + if ($this->container['path'] === null) { + $invalidProperties[] = "'path' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action 文件操作:`create`, `delete`, `move`, `update`, `chmod` + * + * @return $this + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets path + * + * @return string + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string $path 文件路径 + * + * @return $this + */ + public function setPath($path) + { + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets previousPath + * + * @return string + */ + public function getPreviousPath() + { + return $this->container['previousPath']; + } + + /** + * Sets previousPath + * + * @param string $previousPath 原文件路径,文件重命名 `move` 时使用 + * + * @return $this + */ + public function setPreviousPath($previousPath) + { + $this->container['previousPath'] = $previousPath; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content 文件内容 + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets encoding + * + * @return string + */ + public function getEncoding() + { + return $this->container['encoding']; + } + + /** + * Sets encoding + * + * @param string $encoding 文件内容编码 `text` 或者 `base64` + * + * @return $this + */ + public function setEncoding($encoding) + { + $this->container['encoding'] = $encoding; + + return $this; + } + + /** + * Gets lastCommitId + * + * @return string + */ + public function getLastCommitId() + { + return $this->container['lastCommitId']; + } + + /** + * Sets lastCommitId + * + * @param string $lastCommitId 文件最近一次提交的 SHA + * + * @return $this + */ + public function setLastCommitId($lastCommitId) + { + $this->container['lastCommitId'] = $lastCommitId; + + return $this; + } + + /** + * Gets executeFilemode + * + * @return bool + */ + public function getExecuteFilemode() + { + return $this->container['executeFilemode']; + } + + /** + * Sets executeFilemode + * + * @param bool $executeFilemode 是否添加文件可执行标志 + * + * @return $this + */ + public function setExecuteFilemode($executeFilemode) + { + $this->container['executeFilemode'] = $executeFilemode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PostV5ReposOwnerRepoCommitsAuthor.php b/src/Model/PostV5ReposOwnerRepoCommitsAuthor.php new file mode 100644 index 0000000..8745665 --- /dev/null +++ b/src/Model/PostV5ReposOwnerRepoCommitsAuthor.php @@ -0,0 +1,335 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Author 的名字,默认为当前用户的名字 + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Author 的邮箱,默认为当前用户的邮箱 + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ProgramBasic.php b/src/Model/ProgramBasic.php index 6b5c2c0..bc59c0f 100644 --- a/src/Model/ProgramBasic.php +++ b/src/Model/ProgramBasic.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/Project.php b/src/Model/Project.php index bbd0766..d24fd18 100644 --- a/src/Model/Project.php +++ b/src/Model/Project.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -70,7 +70,7 @@ class Project implements ModelInterface, ArrayAccess 'description' => 'string', 'private' => 'bool', 'public' => 'bool', - 'internal' => 'string', + 'internal' => 'bool', 'fork' => 'bool', 'htmlUrl' => 'string', 'sshUrl' => 'string', @@ -110,22 +110,24 @@ class Project implements ModelInterface, ArrayAccess 'license' => 'string', 'outsourced' => 'bool', 'projectCreator' => 'string', + 'members' => 'string[]', 'pushedAt' => '\DateTime', - 'createdAt' => 'string', - 'updatedAt' => 'string', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', 'parent' => '\Gitee\Model\Project', 'paas' => 'string', 'stared' => 'bool', 'watched' => 'bool', + 'permission' => 'object', 'relation' => 'string', 'assigneesNumber' => 'int', 'testersNumber' => 'int', 'assignee' => '\Gitee\Model\UserBasic[]', 'testers' => '\Gitee\Model\UserBasic[]', 'status' => 'string', - 'programs' => '\Gitee\Model\ProgramBasic', + 'programs' => '\Gitee\Model\ProgramBasic[]', 'enterprise' => '\Gitee\Model\NamespaceMini', - 'projectLabels' => '\Gitee\Model\ProjectLabel', + 'projectLabels' => '\Gitee\Model\ProjectLabel[]', 'issueTemplateSource' => 'string' ]; @@ -187,13 +189,15 @@ class Project implements ModelInterface, ArrayAccess 'license' => null, 'outsourced' => null, 'projectCreator' => null, + 'members' => null, 'pushedAt' => 'date-time', - 'createdAt' => null, - 'updatedAt' => null, + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', 'parent' => null, 'paas' => null, 'stared' => null, 'watched' => null, + 'permission' => null, 'relation' => null, 'assigneesNumber' => 'int32', 'testersNumber' => 'int32', @@ -285,6 +289,7 @@ public static function swaggerFormats() 'license' => 'license', 'outsourced' => 'outsourced', 'projectCreator' => 'project_creator', + 'members' => 'members', 'pushedAt' => 'pushed_at', 'createdAt' => 'created_at', 'updatedAt' => 'updated_at', @@ -292,6 +297,7 @@ public static function swaggerFormats() 'paas' => 'paas', 'stared' => 'stared', 'watched' => 'watched', + 'permission' => 'permission', 'relation' => 'relation', 'assigneesNumber' => 'assignees_number', 'testersNumber' => 'testers_number', @@ -362,6 +368,7 @@ public static function swaggerFormats() 'license' => 'setLicense', 'outsourced' => 'setOutsourced', 'projectCreator' => 'setProjectCreator', + 'members' => 'setMembers', 'pushedAt' => 'setPushedAt', 'createdAt' => 'setCreatedAt', 'updatedAt' => 'setUpdatedAt', @@ -369,6 +376,7 @@ public static function swaggerFormats() 'paas' => 'setPaas', 'stared' => 'setStared', 'watched' => 'setWatched', + 'permission' => 'setPermission', 'relation' => 'setRelation', 'assigneesNumber' => 'setAssigneesNumber', 'testersNumber' => 'setTestersNumber', @@ -439,6 +447,7 @@ public static function swaggerFormats() 'license' => 'getLicense', 'outsourced' => 'getOutsourced', 'projectCreator' => 'getProjectCreator', + 'members' => 'getMembers', 'pushedAt' => 'getPushedAt', 'createdAt' => 'getCreatedAt', 'updatedAt' => 'getUpdatedAt', @@ -446,6 +455,7 @@ public static function swaggerFormats() 'paas' => 'getPaas', 'stared' => 'getStared', 'watched' => 'getWatched', + 'permission' => 'getPermission', 'relation' => 'getRelation', 'assigneesNumber' => 'getAssigneesNumber', 'testersNumber' => 'getTestersNumber', @@ -570,6 +580,7 @@ public function __construct(array $data = null) $this->container['license'] = isset($data['license']) ? $data['license'] : null; $this->container['outsourced'] = isset($data['outsourced']) ? $data['outsourced'] : null; $this->container['projectCreator'] = isset($data['projectCreator']) ? $data['projectCreator'] : null; + $this->container['members'] = isset($data['members']) ? $data['members'] : null; $this->container['pushedAt'] = isset($data['pushedAt']) ? $data['pushedAt'] : null; $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null; @@ -577,6 +588,7 @@ public function __construct(array $data = null) $this->container['paas'] = isset($data['paas']) ? $data['paas'] : null; $this->container['stared'] = isset($data['stared']) ? $data['stared'] : null; $this->container['watched'] = isset($data['watched']) ? $data['watched'] : null; + $this->container['permission'] = isset($data['permission']) ? $data['permission'] : null; $this->container['relation'] = isset($data['relation']) ? $data['relation'] : null; $this->container['assigneesNumber'] = isset($data['assigneesNumber']) ? $data['assigneesNumber'] : null; $this->container['testersNumber'] = isset($data['testersNumber']) ? $data['testersNumber'] : null; @@ -904,7 +916,7 @@ public function setPublic($public) /** * Gets internal * - * @return string + * @return bool */ public function getInternal() { @@ -914,7 +926,7 @@ public function getInternal() /** * Sets internal * - * @param string $internal 是否内部开源 + * @param bool $internal 是否内部开源 * * @return $this */ @@ -1861,6 +1873,30 @@ public function setProjectCreator($projectCreator) return $this; } + /** + * Gets members + * + * @return string[] + */ + public function getMembers() + { + return $this->container['members']; + } + + /** + * Sets members + * + * @param string[] $members 仓库成员的username + * + * @return $this + */ + public function setMembers($members) + { + $this->container['members'] = $members; + + return $this; + } + /** * Gets pushedAt * @@ -1888,7 +1924,7 @@ public function setPushedAt($pushedAt) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -1898,7 +1934,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -1912,7 +1948,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -1922,7 +1958,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ @@ -2029,6 +2065,30 @@ public function setWatched($watched) return $this; } + /** + * Gets permission + * + * @return object + */ + public function getPermission() + { + return $this->container['permission']; + } + + /** + * Sets permission + * + * @param object $permission 操作权限 + * + * @return $this + */ + public function setPermission($permission) + { + $this->container['permission'] = $permission; + + return $this; + } + /** * Gets relation * @@ -2176,7 +2236,7 @@ public function setStatus($status) /** * Gets programs * - * @return \Gitee\Model\ProgramBasic + * @return \Gitee\Model\ProgramBasic[] */ public function getPrograms() { @@ -2186,7 +2246,7 @@ public function getPrograms() /** * Sets programs * - * @param \Gitee\Model\ProgramBasic $programs 仓库所属的项目 + * @param \Gitee\Model\ProgramBasic[] $programs 仓库所属的项目 * * @return $this */ @@ -2224,7 +2284,7 @@ public function setEnterprise($enterprise) /** * Gets projectLabels * - * @return \Gitee\Model\ProjectLabel + * @return \Gitee\Model\ProjectLabel[] */ public function getProjectLabels() { @@ -2234,7 +2294,7 @@ public function getProjectLabels() /** * Sets projectLabels * - * @param \Gitee\Model\ProjectLabel $projectLabels projectLabels + * @param \Gitee\Model\ProjectLabel[] $projectLabels projectLabels * * @return $this */ diff --git a/src/Model/ProjectBasic.php b/src/Model/ProjectBasic.php index e18e547..371eb6f 100644 --- a/src/Model/ProjectBasic.php +++ b/src/Model/ProjectBasic.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -69,7 +69,7 @@ class ProjectBasic implements ModelInterface, ArrayAccess 'description' => 'string', 'private' => 'bool', 'public' => 'bool', - 'internal' => 'string', + 'internal' => 'bool', 'fork' => 'bool', 'htmlUrl' => 'string', 'sshUrl' => 'string' @@ -585,7 +585,7 @@ public function setPublic($public) /** * Gets internal * - * @return string + * @return bool */ public function getInternal() { @@ -595,7 +595,7 @@ public function getInternal() /** * Sets internal * - * @param string $internal 是否内部开源 + * @param bool $internal 是否内部开源 * * @return $this */ diff --git a/src/Model/ProjectLabel.php b/src/Model/ProjectLabel.php index 984503d..403c805 100644 --- a/src/Model/ProjectLabel.php +++ b/src/Model/ProjectLabel.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/ProjectMember.php b/src/Model/ProjectMember.php index 08d5e0c..b4dd516 100644 --- a/src/Model/ProjectMember.php +++ b/src/Model/ProjectMember.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -36,7 +36,7 @@ * ProjectMember Class Doc Comment * * @category Class - * @description 添加仓库成员 + * @description 添加仓库成员或更新仓库成员权限 * @package Gitee * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen diff --git a/src/Model/ProjectMemberPermission.php b/src/Model/ProjectMemberPermission.php index 16544f1..f4c159b 100644 --- a/src/Model/ProjectMemberPermission.php +++ b/src/Model/ProjectMemberPermission.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/ProjectMini.php b/src/Model/ProjectMini.php new file mode 100644 index 0000000..9d0dbe8 --- /dev/null +++ b/src/Model/ProjectMini.php @@ -0,0 +1,425 @@ + 'int', + 'fullName' => 'string', + 'humanName' => 'string', + 'url' => 'string', + 'namespace' => '\Gitee\Model\NamespaceMini' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int32', + 'fullName' => null, + 'humanName' => null, + 'url' => null, + 'namespace' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'fullName' => 'full_name', + 'humanName' => 'human_name', + 'url' => 'url', + 'namespace' => 'namespace' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'fullName' => 'setFullName', + 'humanName' => 'setHumanName', + 'url' => 'setUrl', + 'namespace' => 'setNamespace' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'fullName' => 'getFullName', + 'humanName' => 'getHumanName', + 'url' => 'getUrl', + 'namespace' => 'getNamespace' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['fullName'] = isset($data['fullName']) ? $data['fullName'] : null; + $this->container['humanName'] = isset($data['humanName']) ? $data['humanName'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['namespace'] = isset($data['namespace']) ? $data['namespace'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets fullName + * + * @return string + */ + public function getFullName() + { + return $this->container['fullName']; + } + + /** + * Sets fullName + * + * @param string $fullName fullName + * + * @return $this + */ + public function setFullName($fullName) + { + $this->container['fullName'] = $fullName; + + return $this; + } + + /** + * Gets humanName + * + * @return string + */ + public function getHumanName() + { + return $this->container['humanName']; + } + + /** + * Sets humanName + * + * @param string $humanName humanName + * + * @return $this + */ + public function setHumanName($humanName) + { + $this->container['humanName'] = $humanName; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets namespace + * + * @return \Gitee\Model\NamespaceMini + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param \Gitee\Model\NamespaceMini $namespace namespace + * + * @return $this + */ + public function setNamespace($namespace) + { + $this->container['namespace'] = $namespace; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ProjectPushConfig.php b/src/Model/ProjectPushConfig.php index 8b15e08..1f1ed8b 100644 --- a/src/Model/ProjectPushConfig.php +++ b/src/Model/ProjectPushConfig.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,14 +58,14 @@ class ProjectPushConfig implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'restrictPushOwnCommit' => 'string', - 'restrictAuthorEmailSuffix' => 'string', + 'restrictPushOwnCommit' => 'bool', + 'restrictAuthorEmailSuffix' => 'bool', 'authorEmailSuffix' => 'string', - 'restrictCommitMessage' => 'string', + 'restrictCommitMessage' => 'bool', 'commitMessageRegex' => 'string', - 'restrictFileSize' => 'string', - 'maxFileSize' => 'string', - 'exceptManager' => 'string' + 'restrictFileSize' => 'bool', + 'maxFileSize' => 'int', + 'exceptManager' => 'bool' ]; /** @@ -80,7 +80,7 @@ class ProjectPushConfig implements ModelInterface, ArrayAccess 'restrictCommitMessage' => null, 'commitMessageRegex' => null, 'restrictFileSize' => null, - 'maxFileSize' => null, + 'maxFileSize' => 'int32', 'exceptManager' => null ]; @@ -250,7 +250,7 @@ public function valid() /** * Gets restrictPushOwnCommit * - * @return string + * @return bool */ public function getRestrictPushOwnCommit() { @@ -260,7 +260,7 @@ public function getRestrictPushOwnCommit() /** * Sets restrictPushOwnCommit * - * @param string $restrictPushOwnCommit restrictPushOwnCommit + * @param bool $restrictPushOwnCommit restrictPushOwnCommit * * @return $this */ @@ -274,7 +274,7 @@ public function setRestrictPushOwnCommit($restrictPushOwnCommit) /** * Gets restrictAuthorEmailSuffix * - * @return string + * @return bool */ public function getRestrictAuthorEmailSuffix() { @@ -284,7 +284,7 @@ public function getRestrictAuthorEmailSuffix() /** * Sets restrictAuthorEmailSuffix * - * @param string $restrictAuthorEmailSuffix restrictAuthorEmailSuffix + * @param bool $restrictAuthorEmailSuffix restrictAuthorEmailSuffix * * @return $this */ @@ -322,7 +322,7 @@ public function setAuthorEmailSuffix($authorEmailSuffix) /** * Gets restrictCommitMessage * - * @return string + * @return bool */ public function getRestrictCommitMessage() { @@ -332,7 +332,7 @@ public function getRestrictCommitMessage() /** * Sets restrictCommitMessage * - * @param string $restrictCommitMessage restrictCommitMessage + * @param bool $restrictCommitMessage restrictCommitMessage * * @return $this */ @@ -370,7 +370,7 @@ public function setCommitMessageRegex($commitMessageRegex) /** * Gets restrictFileSize * - * @return string + * @return bool */ public function getRestrictFileSize() { @@ -380,7 +380,7 @@ public function getRestrictFileSize() /** * Sets restrictFileSize * - * @param string $restrictFileSize restrictFileSize + * @param bool $restrictFileSize restrictFileSize * * @return $this */ @@ -394,7 +394,7 @@ public function setRestrictFileSize($restrictFileSize) /** * Gets maxFileSize * - * @return string + * @return int */ public function getMaxFileSize() { @@ -404,7 +404,7 @@ public function getMaxFileSize() /** * Sets maxFileSize * - * @param string $maxFileSize maxFileSize + * @param int $maxFileSize maxFileSize * * @return $this */ @@ -418,7 +418,7 @@ public function setMaxFileSize($maxFileSize) /** * Gets exceptManager * - * @return string + * @return bool */ public function getExceptManager() { @@ -428,7 +428,7 @@ public function getExceptManager() /** * Sets exceptManager * - * @param string $exceptManager exceptManager + * @param bool $exceptManager exceptManager * * @return $this */ diff --git a/src/Model/ProjectStargazers.php b/src/Model/ProjectStargazers.php index 336a5f9..d4cfabb 100644 --- a/src/Model/ProjectStargazers.php +++ b/src/Model/ProjectStargazers.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -76,7 +76,7 @@ class ProjectStargazers implements ModelInterface, ArrayAccess 'receivedEventsUrl' => 'string', 'type' => 'string', 'memberRole' => 'string', - 'starAt' => 'string' + 'starAt' => '\DateTime' ]; /** @@ -103,7 +103,7 @@ class ProjectStargazers implements ModelInterface, ArrayAccess 'receivedEventsUrl' => null, 'type' => null, 'memberRole' => null, - 'starAt' => null + 'starAt' => 'date-time' ]; /** @@ -748,7 +748,7 @@ public function setMemberRole($memberRole) /** * Gets starAt * - * @return string + * @return \DateTime */ public function getStarAt() { @@ -758,7 +758,7 @@ public function getStarAt() /** * Sets starAt * - * @param string $starAt starAt + * @param \DateTime $starAt starAt * * @return $this */ diff --git a/src/Model/ProjectTrafficData.php b/src/Model/ProjectTrafficData.php index 51338a6..7323454 100644 --- a/src/Model/ProjectTrafficData.php +++ b/src/Model/ProjectTrafficData.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/ProjectTrafficDataDesc.php b/src/Model/ProjectTrafficDataDesc.php index 542a55c..c82c96f 100644 --- a/src/Model/ProjectTrafficDataDesc.php +++ b/src/Model/ProjectTrafficDataDesc.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/ProjectTrafficDataSummary.php b/src/Model/ProjectTrafficDataSummary.php index 9451b78..a21ca0d 100644 --- a/src/Model/ProjectTrafficDataSummary.php +++ b/src/Model/ProjectTrafficDataSummary.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/ProjectWatchers.php b/src/Model/ProjectWatchers.php index efef0aa..335edc1 100644 --- a/src/Model/ProjectWatchers.php +++ b/src/Model/ProjectWatchers.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -76,7 +76,7 @@ class ProjectWatchers implements ModelInterface, ArrayAccess 'receivedEventsUrl' => 'string', 'type' => 'string', 'memberRole' => 'string', - 'watchAt' => 'string' + 'watchAt' => '\DateTime' ]; /** @@ -103,7 +103,7 @@ class ProjectWatchers implements ModelInterface, ArrayAccess 'receivedEventsUrl' => null, 'type' => null, 'memberRole' => null, - 'watchAt' => null + 'watchAt' => 'date-time' ]; /** @@ -748,7 +748,7 @@ public function setMemberRole($memberRole) /** * Gets watchAt * - * @return string + * @return \DateTime */ public function getWatchAt() { @@ -758,7 +758,7 @@ public function getWatchAt() /** * Sets watchAt * - * @param string $watchAt watchAt + * @param \DateTime $watchAt watchAt * * @return $this */ diff --git a/src/Model/ProtectionRule.php b/src/Model/ProtectionRule.php index a55d586..7924abe 100644 --- a/src/Model/ProtectionRule.php +++ b/src/Model/ProtectionRule.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -36,7 +36,7 @@ * ProtectionRule Class Doc Comment * * @category Class - * @description 删除仓库保护分支策略 + * @description 删除保护分支规则 * @package Gitee * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -58,14 +58,15 @@ class ProtectionRule implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', - 'projectId' => 'string', + 'id' => 'int', + 'projectId' => 'int', 'wildcard' => 'string', - 'pushers' => 'string[]', - 'mergers' => 'string[]', + 'pushers' => 'object', + 'mergers' => 'object', 'contexts' => 'string[]', 'strict' => 'bool', - 'mode' => 'string' + 'mode' => 'string', + 'escapseProtectBranchList' => 'string[]' ]; /** @@ -74,14 +75,15 @@ class ProtectionRule implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, - 'projectId' => null, + 'id' => 'int32', + 'projectId' => 'int32', 'wildcard' => null, 'pushers' => null, 'mergers' => null, 'contexts' => null, 'strict' => null, - 'mode' => null + 'mode' => null, + 'escapseProtectBranchList' => null ]; /** @@ -118,7 +120,8 @@ public static function swaggerFormats() 'mergers' => 'mergers', 'contexts' => 'contexts', 'strict' => 'strict', - 'mode' => 'mode' + 'mode' => 'mode', + 'escapseProtectBranchList' => 'escapse_protect_branch_list' ]; /** @@ -134,7 +137,8 @@ public static function swaggerFormats() 'mergers' => 'setMergers', 'contexts' => 'setContexts', 'strict' => 'setStrict', - 'mode' => 'setMode' + 'mode' => 'setMode', + 'escapseProtectBranchList' => 'setEscapseProtectBranchList' ]; /** @@ -150,7 +154,8 @@ public static function swaggerFormats() 'mergers' => 'getMergers', 'contexts' => 'getContexts', 'strict' => 'getStrict', - 'mode' => 'getMode' + 'mode' => 'getMode', + 'escapseProtectBranchList' => 'getEscapseProtectBranchList' ]; /** @@ -221,6 +226,7 @@ public function __construct(array $data = null) $this->container['contexts'] = isset($data['contexts']) ? $data['contexts'] : null; $this->container['strict'] = isset($data['strict']) ? $data['strict'] : null; $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; + $this->container['escapseProtectBranchList'] = isset($data['escapseProtectBranchList']) ? $data['escapseProtectBranchList'] : null; } /** @@ -250,7 +256,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -260,7 +266,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -274,7 +280,7 @@ public function setId($id) /** * Gets projectId * - * @return string + * @return int */ public function getProjectId() { @@ -284,7 +290,7 @@ public function getProjectId() /** * Sets projectId * - * @param string $projectId projectId + * @param int $projectId projectId * * @return $this */ @@ -322,7 +328,7 @@ public function setWildcard($wildcard) /** * Gets pushers * - * @return string[] + * @return object */ public function getPushers() { @@ -332,7 +338,7 @@ public function getPushers() /** * Sets pushers * - * @param string[] $pushers pushers + * @param object $pushers pushers * * @return $this */ @@ -346,7 +352,7 @@ public function setPushers($pushers) /** * Gets mergers * - * @return string[] + * @return object */ public function getMergers() { @@ -356,7 +362,7 @@ public function getMergers() /** * Sets mergers * - * @param string[] $mergers mergers + * @param object $mergers mergers * * @return $this */ @@ -438,6 +444,30 @@ public function setMode($mode) return $this; } + + /** + * Gets escapseProtectBranchList + * + * @return string[] + */ + public function getEscapseProtectBranchList() + { + return $this->container['escapseProtectBranchList']; + } + + /** + * Sets escapseProtectBranchList + * + * @param string[] $escapseProtectBranchList 不受规则影响的分支列表,以英文逗号分隔,形如:['a', 'b'] + * + * @return $this + */ + public function setEscapseProtectBranchList($escapseProtectBranchList) + { + $this->container['escapseProtectBranchList'] = $escapseProtectBranchList; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/PullRequest.php b/src/Model/PullRequest.php index d4c2d84..698bd5b 100644 --- a/src/Model/PullRequest.php +++ b/src/Model/PullRequest.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,7 +58,7 @@ class PullRequest implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', + 'id' => 'int', 'url' => 'string', 'htmlUrl' => 'string', 'diffUrl' => 'string', @@ -68,26 +68,28 @@ class PullRequest implements ModelInterface, ArrayAccess 'reviewCommentsUrl' => 'string', 'reviewCommentUrl' => 'string', 'commentsUrl' => 'string', - 'number' => 'string', + 'number' => 'int', + 'closeRelatedIssue' => 'int', + 'pruneBranch' => 'bool', 'state' => 'string', - 'assigneesNumber' => 'string', - 'testersNumber' => 'string', - 'assignees' => 'string[]', - 'testers' => 'string[]', - 'apiReviewersNumber' => 'string', - 'apiReviewers' => 'string[]', + 'assigneesNumber' => 'int', + 'testersNumber' => 'int', + 'assignees' => '\Gitee\Model\UserAssignee[]', + 'testers' => '\Gitee\Model\UserAssignee[]', + 'apiReviewersNumber' => 'int', + 'apiReviewers' => '\Gitee\Model\UserAssignee[]', 'milestone' => '\Gitee\Model\Milestone', - 'labels' => '\Gitee\Model\Label', - 'locked' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string', - 'closedAt' => 'string', - 'draft' => 'string', - 'mergedAt' => 'string', - 'mergeable' => 'string', - 'canMergeCheck' => 'string', + 'labels' => '\Gitee\Model\Label[]', + 'locked' => 'bool', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', + 'closedAt' => '\DateTime', + 'draft' => 'bool', + 'mergedAt' => '\DateTime', + 'mergeable' => 'bool', + 'canMergeCheck' => 'bool', 'links' => 'string', - 'user' => 'string', + 'user' => '\Gitee\Model\UserBasic', 'refPullRequests' => '\Gitee\Model\RefPullRequest[]', 'title' => 'string', 'body' => 'string', @@ -102,7 +104,7 @@ class PullRequest implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, + 'id' => 'int32', 'url' => null, 'htmlUrl' => null, 'diffUrl' => null, @@ -112,22 +114,24 @@ class PullRequest implements ModelInterface, ArrayAccess 'reviewCommentsUrl' => null, 'reviewCommentUrl' => null, 'commentsUrl' => null, - 'number' => null, + 'number' => 'int32', + 'closeRelatedIssue' => 'int32', + 'pruneBranch' => null, 'state' => null, - 'assigneesNumber' => null, - 'testersNumber' => null, + 'assigneesNumber' => 'int32', + 'testersNumber' => 'int32', 'assignees' => null, 'testers' => null, - 'apiReviewersNumber' => null, + 'apiReviewersNumber' => 'int32', 'apiReviewers' => null, 'milestone' => null, 'labels' => null, 'locked' => null, - 'createdAt' => null, - 'updatedAt' => null, - 'closedAt' => null, + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', + 'closedAt' => 'date-time', 'draft' => null, - 'mergedAt' => null, + 'mergedAt' => 'date-time', 'mergeable' => null, 'canMergeCheck' => null, 'links' => null, @@ -178,6 +182,8 @@ public static function swaggerFormats() 'reviewCommentUrl' => 'review_comment_url', 'commentsUrl' => 'comments_url', 'number' => 'number', + 'closeRelatedIssue' => 'close_related_issue', + 'pruneBranch' => 'prune_branch', 'state' => 'state', 'assigneesNumber' => 'assignees_number', 'testersNumber' => 'testers_number', @@ -222,6 +228,8 @@ public static function swaggerFormats() 'reviewCommentUrl' => 'setReviewCommentUrl', 'commentsUrl' => 'setCommentsUrl', 'number' => 'setNumber', + 'closeRelatedIssue' => 'setCloseRelatedIssue', + 'pruneBranch' => 'setPruneBranch', 'state' => 'setState', 'assigneesNumber' => 'setAssigneesNumber', 'testersNumber' => 'setTestersNumber', @@ -266,6 +274,8 @@ public static function swaggerFormats() 'reviewCommentUrl' => 'getReviewCommentUrl', 'commentsUrl' => 'getCommentsUrl', 'number' => 'getNumber', + 'closeRelatedIssue' => 'getCloseRelatedIssue', + 'pruneBranch' => 'getPruneBranch', 'state' => 'getState', 'assigneesNumber' => 'getAssigneesNumber', 'testersNumber' => 'getTestersNumber', @@ -364,6 +374,8 @@ public function __construct(array $data = null) $this->container['reviewCommentUrl'] = isset($data['reviewCommentUrl']) ? $data['reviewCommentUrl'] : null; $this->container['commentsUrl'] = isset($data['commentsUrl']) ? $data['commentsUrl'] : null; $this->container['number'] = isset($data['number']) ? $data['number'] : null; + $this->container['closeRelatedIssue'] = isset($data['closeRelatedIssue']) ? $data['closeRelatedIssue'] : null; + $this->container['pruneBranch'] = isset($data['pruneBranch']) ? $data['pruneBranch'] : null; $this->container['state'] = isset($data['state']) ? $data['state'] : null; $this->container['assigneesNumber'] = isset($data['assigneesNumber']) ? $data['assigneesNumber'] : null; $this->container['testersNumber'] = isset($data['testersNumber']) ? $data['testersNumber'] : null; @@ -418,7 +430,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -428,7 +440,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -658,7 +670,7 @@ public function setCommentsUrl($commentsUrl) /** * Gets number * - * @return string + * @return int */ public function getNumber() { @@ -668,7 +680,7 @@ public function getNumber() /** * Sets number * - * @param string $number number + * @param int $number number * * @return $this */ @@ -679,6 +691,54 @@ public function setNumber($number) return $this; } + /** + * Gets closeRelatedIssue + * + * @return int + */ + public function getCloseRelatedIssue() + { + return $this->container['closeRelatedIssue']; + } + + /** + * Sets closeRelatedIssue + * + * @param int $closeRelatedIssue closeRelatedIssue + * + * @return $this + */ + public function setCloseRelatedIssue($closeRelatedIssue) + { + $this->container['closeRelatedIssue'] = $closeRelatedIssue; + + return $this; + } + + /** + * Gets pruneBranch + * + * @return bool + */ + public function getPruneBranch() + { + return $this->container['pruneBranch']; + } + + /** + * Sets pruneBranch + * + * @param bool $pruneBranch pruneBranch + * + * @return $this + */ + public function setPruneBranch($pruneBranch) + { + $this->container['pruneBranch'] = $pruneBranch; + + return $this; + } + /** * Gets state * @@ -706,7 +766,7 @@ public function setState($state) /** * Gets assigneesNumber * - * @return string + * @return int */ public function getAssigneesNumber() { @@ -716,7 +776,7 @@ public function getAssigneesNumber() /** * Sets assigneesNumber * - * @param string $assigneesNumber assigneesNumber + * @param int $assigneesNumber assigneesNumber * * @return $this */ @@ -730,7 +790,7 @@ public function setAssigneesNumber($assigneesNumber) /** * Gets testersNumber * - * @return string + * @return int */ public function getTestersNumber() { @@ -740,7 +800,7 @@ public function getTestersNumber() /** * Sets testersNumber * - * @param string $testersNumber testersNumber + * @param int $testersNumber testersNumber * * @return $this */ @@ -754,7 +814,7 @@ public function setTestersNumber($testersNumber) /** * Gets assignees * - * @return string[] + * @return \Gitee\Model\UserAssignee[] */ public function getAssignees() { @@ -764,7 +824,7 @@ public function getAssignees() /** * Sets assignees * - * @param string[] $assignees assignees + * @param \Gitee\Model\UserAssignee[] $assignees assignees * * @return $this */ @@ -778,7 +838,7 @@ public function setAssignees($assignees) /** * Gets testers * - * @return string[] + * @return \Gitee\Model\UserAssignee[] */ public function getTesters() { @@ -788,7 +848,7 @@ public function getTesters() /** * Sets testers * - * @param string[] $testers testers + * @param \Gitee\Model\UserAssignee[] $testers testers * * @return $this */ @@ -802,7 +862,7 @@ public function setTesters($testers) /** * Gets apiReviewersNumber * - * @return string + * @return int */ public function getApiReviewersNumber() { @@ -812,7 +872,7 @@ public function getApiReviewersNumber() /** * Sets apiReviewersNumber * - * @param string $apiReviewersNumber apiReviewersNumber + * @param int $apiReviewersNumber apiReviewersNumber * * @return $this */ @@ -826,7 +886,7 @@ public function setApiReviewersNumber($apiReviewersNumber) /** * Gets apiReviewers * - * @return string[] + * @return \Gitee\Model\UserAssignee[] */ public function getApiReviewers() { @@ -836,7 +896,7 @@ public function getApiReviewers() /** * Sets apiReviewers * - * @param string[] $apiReviewers apiReviewers + * @param \Gitee\Model\UserAssignee[] $apiReviewers apiReviewers * * @return $this */ @@ -874,7 +934,7 @@ public function setMilestone($milestone) /** * Gets labels * - * @return \Gitee\Model\Label + * @return \Gitee\Model\Label[] */ public function getLabels() { @@ -884,7 +944,7 @@ public function getLabels() /** * Sets labels * - * @param \Gitee\Model\Label $labels labels + * @param \Gitee\Model\Label[] $labels labels * * @return $this */ @@ -898,7 +958,7 @@ public function setLabels($labels) /** * Gets locked * - * @return string + * @return bool */ public function getLocked() { @@ -908,7 +968,7 @@ public function getLocked() /** * Sets locked * - * @param string $locked locked + * @param bool $locked locked * * @return $this */ @@ -922,7 +982,7 @@ public function setLocked($locked) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -932,7 +992,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -946,7 +1006,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -956,7 +1016,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ @@ -970,7 +1030,7 @@ public function setUpdatedAt($updatedAt) /** * Gets closedAt * - * @return string + * @return \DateTime */ public function getClosedAt() { @@ -980,7 +1040,7 @@ public function getClosedAt() /** * Sets closedAt * - * @param string $closedAt closedAt + * @param \DateTime $closedAt closedAt * * @return $this */ @@ -994,7 +1054,7 @@ public function setClosedAt($closedAt) /** * Gets draft * - * @return string + * @return bool */ public function getDraft() { @@ -1004,7 +1064,7 @@ public function getDraft() /** * Sets draft * - * @param string $draft draft + * @param bool $draft draft * * @return $this */ @@ -1018,7 +1078,7 @@ public function setDraft($draft) /** * Gets mergedAt * - * @return string + * @return \DateTime */ public function getMergedAt() { @@ -1028,7 +1088,7 @@ public function getMergedAt() /** * Sets mergedAt * - * @param string $mergedAt mergedAt + * @param \DateTime $mergedAt mergedAt * * @return $this */ @@ -1042,7 +1102,7 @@ public function setMergedAt($mergedAt) /** * Gets mergeable * - * @return string + * @return bool */ public function getMergeable() { @@ -1052,7 +1112,7 @@ public function getMergeable() /** * Sets mergeable * - * @param string $mergeable mergeable + * @param bool $mergeable mergeable * * @return $this */ @@ -1066,7 +1126,7 @@ public function setMergeable($mergeable) /** * Gets canMergeCheck * - * @return string + * @return bool */ public function getCanMergeCheck() { @@ -1076,7 +1136,7 @@ public function getCanMergeCheck() /** * Sets canMergeCheck * - * @param string $canMergeCheck canMergeCheck + * @param bool $canMergeCheck canMergeCheck * * @return $this */ @@ -1114,7 +1174,7 @@ public function setLinks($links) /** * Gets user * - * @return string + * @return \Gitee\Model\UserBasic */ public function getUser() { @@ -1124,7 +1184,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserBasic $user user * * @return $this */ diff --git a/src/Model/PullRequestComments.php b/src/Model/PullRequestComments.php index 352e0d4..9ae7f73 100644 --- a/src/Model/PullRequestComments.php +++ b/src/Model/PullRequestComments.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -59,22 +59,22 @@ class PullRequestComments implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'url' => 'string', - 'id' => 'string', + 'id' => 'int', 'path' => 'string', 'position' => 'string', 'originalPosition' => 'string', 'newLine' => 'string', 'commitId' => 'string', 'originalCommitId' => 'string', - 'user' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string', + 'user' => '\Gitee\Model\UserBasic', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', 'body' => 'string', 'htmlUrl' => 'string', 'pullRequestUrl' => 'string', 'links' => 'string', 'commentType' => 'string', - 'inReplyToId' => 'string' + 'inReplyToId' => 'int' ]; /** @@ -84,7 +84,7 @@ class PullRequestComments implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'url' => null, - 'id' => null, + 'id' => 'int32', 'path' => null, 'position' => null, 'originalPosition' => null, @@ -92,14 +92,14 @@ class PullRequestComments implements ModelInterface, ArrayAccess 'commitId' => null, 'originalCommitId' => null, 'user' => null, - 'createdAt' => null, - 'updatedAt' => null, + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', 'body' => null, 'htmlUrl' => null, 'pullRequestUrl' => null, 'links' => null, 'commentType' => null, - 'inReplyToId' => null + 'inReplyToId' => 'int32' ]; /** @@ -328,7 +328,7 @@ public function setUrl($url) /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -338,7 +338,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -496,7 +496,7 @@ public function setOriginalCommitId($originalCommitId) /** * Gets user * - * @return string + * @return \Gitee\Model\UserBasic */ public function getUser() { @@ -506,7 +506,7 @@ public function getUser() /** * Sets user * - * @param string $user user + * @param \Gitee\Model\UserBasic $user user * * @return $this */ @@ -520,7 +520,7 @@ public function setUser($user) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -530,7 +530,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -544,7 +544,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -554,7 +554,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ @@ -688,7 +688,7 @@ public function setCommentType($commentType) /** * Gets inReplyToId * - * @return string + * @return int */ public function getInReplyToId() { @@ -698,7 +698,7 @@ public function getInReplyToId() /** * Sets inReplyToId * - * @param string $inReplyToId inReplyToId + * @param int $inReplyToId inReplyToId * * @return $this */ diff --git a/src/Model/PullRequestCommits.php b/src/Model/PullRequestCommits.php index 5ab486c..e9402a3 100644 --- a/src/Model/PullRequestCommits.php +++ b/src/Model/PullRequestCommits.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -63,7 +63,7 @@ class PullRequestCommits implements ModelInterface, ArrayAccess 'htmlUrl' => 'string', 'commentsUrl' => 'string', 'commit' => 'string', - 'author' => 'string', + 'author' => '\Gitee\Model\UserBasic', 'committer' => 'string', 'parents' => '\Gitee\Model\CommitParentsBasic' ]; @@ -370,7 +370,7 @@ public function setCommit($commit) /** * Gets author * - * @return string + * @return \Gitee\Model\UserBasic */ public function getAuthor() { @@ -380,7 +380,7 @@ public function getAuthor() /** * Sets author * - * @param string $author author + * @param \Gitee\Model\UserBasic $author author * * @return $this */ diff --git a/src/Model/PullRequestFiles.php b/src/Model/PullRequestFiles.php index 2b7320d..4d35413 100644 --- a/src/Model/PullRequestFiles.php +++ b/src/Model/PullRequestFiles.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/RefPullRequest.php b/src/Model/RefPullRequest.php index 2e4902a..ebe32e4 100644 --- a/src/Model/RefPullRequest.php +++ b/src/Model/RefPullRequest.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/Release.php b/src/Model/Release.php index 82a76d8..8e3cf70 100644 --- a/src/Model/Release.php +++ b/src/Model/Release.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -61,12 +61,12 @@ class Release implements ModelInterface, ArrayAccess 'id' => 'int', 'tagName' => 'string', 'targetCommitish' => 'string', - 'prerelease' => 'string', + 'prerelease' => 'bool', 'name' => 'string', 'body' => 'string', - 'author' => 'string', + 'author' => '\Gitee\Model\UserBasic', 'createdAt' => '\DateTime', - 'assets' => 'string' + 'assets' => 'string[]' ]; /** @@ -328,7 +328,7 @@ public function setTargetCommitish($targetCommitish) /** * Gets prerelease * - * @return string + * @return bool */ public function getPrerelease() { @@ -338,7 +338,7 @@ public function getPrerelease() /** * Sets prerelease * - * @param string $prerelease prerelease + * @param bool $prerelease prerelease * * @return $this */ @@ -400,7 +400,7 @@ public function setBody($body) /** * Gets author * - * @return string + * @return \Gitee\Model\UserBasic */ public function getAuthor() { @@ -410,7 +410,7 @@ public function getAuthor() /** * Sets author * - * @param string $author author + * @param \Gitee\Model\UserBasic $author author * * @return $this */ @@ -448,7 +448,7 @@ public function setCreatedAt($createdAt) /** * Gets assets * - * @return string + * @return string[] */ public function getAssets() { @@ -458,7 +458,7 @@ public function getAssets() /** * Sets assets * - * @param string $assets assets + * @param string[] $assets assets * * @return $this */ diff --git a/src/Model/RepoCommit.php b/src/Model/RepoCommit.php index 5f5876c..81371b2 100644 --- a/src/Model/RepoCommit.php +++ b/src/Model/RepoCommit.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -63,9 +63,9 @@ class RepoCommit implements ModelInterface, ArrayAccess 'htmlUrl' => 'string', 'commentsUrl' => 'string', 'commit' => 'string', - 'author' => 'string', - 'committer' => 'string', - 'parents' => 'string' + 'author' => '\Gitee\Model\UserBasic', + 'committer' => '\Gitee\Model\UserBasic', + 'parents' => 'string[]' ]; /** @@ -370,7 +370,7 @@ public function setCommit($commit) /** * Gets author * - * @return string + * @return \Gitee\Model\UserBasic */ public function getAuthor() { @@ -380,7 +380,7 @@ public function getAuthor() /** * Sets author * - * @param string $author author + * @param \Gitee\Model\UserBasic $author author * * @return $this */ @@ -394,7 +394,7 @@ public function setAuthor($author) /** * Gets committer * - * @return string + * @return \Gitee\Model\UserBasic */ public function getCommitter() { @@ -404,7 +404,7 @@ public function getCommitter() /** * Sets committer * - * @param string $committer committer + * @param \Gitee\Model\UserBasic $committer committer * * @return $this */ @@ -418,7 +418,7 @@ public function setCommitter($committer) /** * Gets parents * - * @return string + * @return string[] */ public function getParents() { @@ -428,7 +428,7 @@ public function getParents() /** * Sets parents * - * @param string $parents parents + * @param string[] $parents parents * * @return $this */ diff --git a/src/Model/RepoCommitWithFiles.php b/src/Model/RepoCommitWithFiles.php index 90b1893..535c2b5 100644 --- a/src/Model/RepoCommitWithFiles.php +++ b/src/Model/RepoCommitWithFiles.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -63,11 +63,12 @@ class RepoCommitWithFiles implements ModelInterface, ArrayAccess 'htmlUrl' => 'string', 'commentsUrl' => 'string', 'commit' => 'string', - 'author' => 'string', - 'committer' => 'string', - 'parents' => 'string', + 'author' => '\Gitee\Model\UserBasic', + 'committer' => '\Gitee\Model\UserBasic', + 'parents' => 'string[]', 'stats' => 'string', - 'files' => 'string' + 'files' => '\Gitee\Model\DiffFile[]', + 'truncated' => 'bool' ]; /** @@ -85,7 +86,8 @@ class RepoCommitWithFiles implements ModelInterface, ArrayAccess 'committer' => null, 'parents' => null, 'stats' => null, - 'files' => null + 'files' => null, + 'truncated' => null ]; /** @@ -124,7 +126,8 @@ public static function swaggerFormats() 'committer' => 'committer', 'parents' => 'parents', 'stats' => 'stats', - 'files' => 'files' + 'files' => 'files', + 'truncated' => 'truncated' ]; /** @@ -142,7 +145,8 @@ public static function swaggerFormats() 'committer' => 'setCommitter', 'parents' => 'setParents', 'stats' => 'setStats', - 'files' => 'setFiles' + 'files' => 'setFiles', + 'truncated' => 'setTruncated' ]; /** @@ -160,7 +164,8 @@ public static function swaggerFormats() 'committer' => 'getCommitter', 'parents' => 'getParents', 'stats' => 'getStats', - 'files' => 'getFiles' + 'files' => 'getFiles', + 'truncated' => 'getTruncated' ]; /** @@ -233,6 +238,7 @@ public function __construct(array $data = null) $this->container['parents'] = isset($data['parents']) ? $data['parents'] : null; $this->container['stats'] = isset($data['stats']) ? $data['stats'] : null; $this->container['files'] = isset($data['files']) ? $data['files'] : null; + $this->container['truncated'] = isset($data['truncated']) ? $data['truncated'] : null; } /** @@ -382,7 +388,7 @@ public function setCommit($commit) /** * Gets author * - * @return string + * @return \Gitee\Model\UserBasic */ public function getAuthor() { @@ -392,7 +398,7 @@ public function getAuthor() /** * Sets author * - * @param string $author author + * @param \Gitee\Model\UserBasic $author author * * @return $this */ @@ -406,7 +412,7 @@ public function setAuthor($author) /** * Gets committer * - * @return string + * @return \Gitee\Model\UserBasic */ public function getCommitter() { @@ -416,7 +422,7 @@ public function getCommitter() /** * Sets committer * - * @param string $committer committer + * @param \Gitee\Model\UserBasic $committer committer * * @return $this */ @@ -430,7 +436,7 @@ public function setCommitter($committer) /** * Gets parents * - * @return string + * @return string[] */ public function getParents() { @@ -440,7 +446,7 @@ public function getParents() /** * Sets parents * - * @param string $parents parents + * @param string[] $parents parents * * @return $this */ @@ -478,7 +484,7 @@ public function setStats($stats) /** * Gets files * - * @return string + * @return \Gitee\Model\DiffFile[] */ public function getFiles() { @@ -488,7 +494,7 @@ public function getFiles() /** * Sets files * - * @param string $files files + * @param \Gitee\Model\DiffFile[] $files 文件列表 * * @return $this */ @@ -498,6 +504,30 @@ public function setFiles($files) return $this; } + + /** + * Gets truncated + * + * @return bool + */ + public function getTruncated() + { + return $this->container['truncated']; + } + + /** + * Sets truncated + * + * @param bool $truncated 文件列表是否被截断 + * + * @return $this + */ + public function setTruncated($truncated) + { + $this->container['truncated'] = $truncated; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/SSHKey.php b/src/Model/SSHKey.php index 7db1bc3..296f03a 100644 --- a/src/Model/SSHKey.php +++ b/src/Model/SSHKey.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,11 +58,11 @@ class SSHKey implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', + 'id' => 'int', 'key' => 'string', 'url' => 'string', 'title' => 'string', - 'createdAt' => 'string' + 'createdAt' => '\DateTime' ]; /** @@ -71,11 +71,11 @@ class SSHKey implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, + 'id' => 'int32', 'key' => null, 'url' => null, 'title' => null, - 'createdAt' => null + 'createdAt' => 'date-time' ]; /** @@ -232,7 +232,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -242,7 +242,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ @@ -328,7 +328,7 @@ public function setTitle($title) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -338,7 +338,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ diff --git a/src/Model/SSHKeyBasic.php b/src/Model/SSHKeyBasic.php index 8b5c7a7..93151d6 100644 --- a/src/Model/SSHKeyBasic.php +++ b/src/Model/SSHKeyBasic.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -58,7 +58,7 @@ class SSHKeyBasic implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string', + 'id' => 'int', 'key' => 'string' ]; @@ -68,7 +68,7 @@ class SSHKeyBasic implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, + 'id' => 'int32', 'key' => null ]; @@ -214,7 +214,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -224,7 +224,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param int $id id * * @return $this */ diff --git a/src/Model/Tag.php b/src/Model/Tag.php index 1f2e58c..b5d2e80 100644 --- a/src/Model/Tag.php +++ b/src/Model/Tag.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -60,7 +60,8 @@ class Tag implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'name' => 'string', 'message' => 'string', - 'commit' => 'string' + 'commit' => 'string', + 'tagger' => '\Gitee\Model\GitUser' ]; /** @@ -71,7 +72,8 @@ class Tag implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'name' => null, 'message' => null, - 'commit' => null + 'commit' => null, + 'tagger' => null ]; /** @@ -103,7 +105,8 @@ public static function swaggerFormats() protected static $attributeMap = [ 'name' => 'name', 'message' => 'message', - 'commit' => 'commit' + 'commit' => 'commit', + 'tagger' => 'tagger' ]; /** @@ -114,7 +117,8 @@ public static function swaggerFormats() protected static $setters = [ 'name' => 'setName', 'message' => 'setMessage', - 'commit' => 'setCommit' + 'commit' => 'setCommit', + 'tagger' => 'setTagger' ]; /** @@ -125,7 +129,8 @@ public static function swaggerFormats() protected static $getters = [ 'name' => 'getName', 'message' => 'getMessage', - 'commit' => 'getCommit' + 'commit' => 'getCommit', + 'tagger' => 'getTagger' ]; /** @@ -191,6 +196,7 @@ public function __construct(array $data = null) $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['message'] = isset($data['message']) ? $data['message'] : null; $this->container['commit'] = isset($data['commit']) ? $data['commit'] : null; + $this->container['tagger'] = isset($data['tagger']) ? $data['tagger'] : null; } /** @@ -288,6 +294,30 @@ public function setCommit($commit) return $this; } + + /** + * Gets tagger + * + * @return \Gitee\Model\GitUser + */ + public function getTagger() + { + return $this->container['tagger']; + } + + /** + * Sets tagger + * + * @param \Gitee\Model\GitUser $tagger tagger + * + * @return $this + */ + public function setTagger($tagger) + { + $this->container['tagger'] = $tagger; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/Tree.php b/src/Model/Tree.php index 93c3e8f..b39c887 100644 --- a/src/Model/Tree.php +++ b/src/Model/Tree.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -60,8 +60,8 @@ class Tree implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'sha' => 'string', 'url' => 'string', - 'tree' => 'string', - 'truncated' => 'string' + 'tree' => 'string[]', + 'truncated' => 'bool' ]; /** @@ -274,7 +274,7 @@ public function setUrl($url) /** * Gets tree * - * @return string + * @return string[] */ public function getTree() { @@ -284,7 +284,7 @@ public function getTree() /** * Sets tree * - * @param string $tree tree + * @param string[] $tree tree * * @return $this */ @@ -298,7 +298,7 @@ public function setTree($tree) /** * Gets truncated * - * @return string + * @return bool */ public function getTruncated() { @@ -308,7 +308,7 @@ public function getTruncated() /** * Sets truncated * - * @param string $truncated truncated + * @param bool $truncated truncated * * @return $this */ diff --git a/src/Model/User.php b/src/Model/User.php index 177fb9d..51360dc 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -79,14 +79,14 @@ class User implements ModelInterface, ArrayAccess 'blog' => 'string', 'weibo' => 'string', 'bio' => 'string', - 'publicRepos' => 'string', - 'publicGists' => 'string', - 'followers' => 'string', - 'following' => 'string', - 'stared' => 'string', - 'watched' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string' + 'publicRepos' => 'int', + 'publicGists' => 'int', + 'followers' => 'int', + 'following' => 'int', + 'stared' => 'int', + 'watched' => 'int', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime' ]; /** @@ -116,14 +116,14 @@ class User implements ModelInterface, ArrayAccess 'blog' => null, 'weibo' => null, 'bio' => null, - 'publicRepos' => null, - 'publicGists' => null, - 'followers' => null, - 'following' => null, - 'stared' => null, - 'watched' => null, - 'createdAt' => null, - 'updatedAt' => null + 'publicRepos' => 'int32', + 'publicGists' => 'int32', + 'followers' => 'int32', + 'following' => 'int32', + 'stared' => 'int32', + 'watched' => 'int32', + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time' ]; /** @@ -880,7 +880,7 @@ public function setBio($bio) /** * Gets publicRepos * - * @return string + * @return int */ public function getPublicRepos() { @@ -890,7 +890,7 @@ public function getPublicRepos() /** * Sets publicRepos * - * @param string $publicRepos publicRepos + * @param int $publicRepos publicRepos * * @return $this */ @@ -904,7 +904,7 @@ public function setPublicRepos($publicRepos) /** * Gets publicGists * - * @return string + * @return int */ public function getPublicGists() { @@ -914,7 +914,7 @@ public function getPublicGists() /** * Sets publicGists * - * @param string $publicGists publicGists + * @param int $publicGists publicGists * * @return $this */ @@ -928,7 +928,7 @@ public function setPublicGists($publicGists) /** * Gets followers * - * @return string + * @return int */ public function getFollowers() { @@ -938,7 +938,7 @@ public function getFollowers() /** * Sets followers * - * @param string $followers followers + * @param int $followers followers * * @return $this */ @@ -952,7 +952,7 @@ public function setFollowers($followers) /** * Gets following * - * @return string + * @return int */ public function getFollowing() { @@ -962,7 +962,7 @@ public function getFollowing() /** * Sets following * - * @param string $following following + * @param int $following following * * @return $this */ @@ -976,7 +976,7 @@ public function setFollowing($following) /** * Gets stared * - * @return string + * @return int */ public function getStared() { @@ -986,7 +986,7 @@ public function getStared() /** * Sets stared * - * @param string $stared stared + * @param int $stared stared * * @return $this */ @@ -1000,7 +1000,7 @@ public function setStared($stared) /** * Gets watched * - * @return string + * @return int */ public function getWatched() { @@ -1010,7 +1010,7 @@ public function getWatched() /** * Sets watched * - * @param string $watched watched + * @param int $watched watched * * @return $this */ @@ -1024,7 +1024,7 @@ public function setWatched($watched) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -1034,7 +1034,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -1048,7 +1048,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -1058,7 +1058,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/UserAssignee.php b/src/Model/UserAssignee.php new file mode 100644 index 0000000..e0d472e --- /dev/null +++ b/src/Model/UserAssignee.php @@ -0,0 +1,905 @@ + 'int', + 'login' => 'string', + 'name' => 'string', + 'avatarUrl' => 'string', + 'url' => 'string', + 'htmlUrl' => 'string', + 'remark' => 'string', + 'followersUrl' => 'string', + 'followingUrl' => 'string', + 'gistsUrl' => 'string', + 'starredUrl' => 'string', + 'subscriptionsUrl' => 'string', + 'organizationsUrl' => 'string', + 'reposUrl' => 'string', + 'eventsUrl' => 'string', + 'receivedEventsUrl' => 'string', + 'type' => 'string', + 'memberRole' => 'string', + 'assignee' => 'bool', + 'codeOwner' => 'bool', + 'accept' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int32', + 'login' => null, + 'name' => null, + 'avatarUrl' => null, + 'url' => null, + 'htmlUrl' => null, + 'remark' => null, + 'followersUrl' => null, + 'followingUrl' => null, + 'gistsUrl' => null, + 'starredUrl' => null, + 'subscriptionsUrl' => null, + 'organizationsUrl' => null, + 'reposUrl' => null, + 'eventsUrl' => null, + 'receivedEventsUrl' => null, + 'type' => null, + 'memberRole' => null, + 'assignee' => null, + 'codeOwner' => null, + 'accept' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'login' => 'login', + 'name' => 'name', + 'avatarUrl' => 'avatar_url', + 'url' => 'url', + 'htmlUrl' => 'html_url', + 'remark' => 'remark', + 'followersUrl' => 'followers_url', + 'followingUrl' => 'following_url', + 'gistsUrl' => 'gists_url', + 'starredUrl' => 'starred_url', + 'subscriptionsUrl' => 'subscriptions_url', + 'organizationsUrl' => 'organizations_url', + 'reposUrl' => 'repos_url', + 'eventsUrl' => 'events_url', + 'receivedEventsUrl' => 'received_events_url', + 'type' => 'type', + 'memberRole' => 'member_role', + 'assignee' => 'assignee', + 'codeOwner' => 'code_owner', + 'accept' => 'accept' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'login' => 'setLogin', + 'name' => 'setName', + 'avatarUrl' => 'setAvatarUrl', + 'url' => 'setUrl', + 'htmlUrl' => 'setHtmlUrl', + 'remark' => 'setRemark', + 'followersUrl' => 'setFollowersUrl', + 'followingUrl' => 'setFollowingUrl', + 'gistsUrl' => 'setGistsUrl', + 'starredUrl' => 'setStarredUrl', + 'subscriptionsUrl' => 'setSubscriptionsUrl', + 'organizationsUrl' => 'setOrganizationsUrl', + 'reposUrl' => 'setReposUrl', + 'eventsUrl' => 'setEventsUrl', + 'receivedEventsUrl' => 'setReceivedEventsUrl', + 'type' => 'setType', + 'memberRole' => 'setMemberRole', + 'assignee' => 'setAssignee', + 'codeOwner' => 'setCodeOwner', + 'accept' => 'setAccept' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'login' => 'getLogin', + 'name' => 'getName', + 'avatarUrl' => 'getAvatarUrl', + 'url' => 'getUrl', + 'htmlUrl' => 'getHtmlUrl', + 'remark' => 'getRemark', + 'followersUrl' => 'getFollowersUrl', + 'followingUrl' => 'getFollowingUrl', + 'gistsUrl' => 'getGistsUrl', + 'starredUrl' => 'getStarredUrl', + 'subscriptionsUrl' => 'getSubscriptionsUrl', + 'organizationsUrl' => 'getOrganizationsUrl', + 'reposUrl' => 'getReposUrl', + 'eventsUrl' => 'getEventsUrl', + 'receivedEventsUrl' => 'getReceivedEventsUrl', + 'type' => 'getType', + 'memberRole' => 'getMemberRole', + 'assignee' => 'getAssignee', + 'codeOwner' => 'getCodeOwner', + 'accept' => 'getAccept' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['login'] = isset($data['login']) ? $data['login'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['avatarUrl'] = isset($data['avatarUrl']) ? $data['avatarUrl'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null; + $this->container['remark'] = isset($data['remark']) ? $data['remark'] : null; + $this->container['followersUrl'] = isset($data['followersUrl']) ? $data['followersUrl'] : null; + $this->container['followingUrl'] = isset($data['followingUrl']) ? $data['followingUrl'] : null; + $this->container['gistsUrl'] = isset($data['gistsUrl']) ? $data['gistsUrl'] : null; + $this->container['starredUrl'] = isset($data['starredUrl']) ? $data['starredUrl'] : null; + $this->container['subscriptionsUrl'] = isset($data['subscriptionsUrl']) ? $data['subscriptionsUrl'] : null; + $this->container['organizationsUrl'] = isset($data['organizationsUrl']) ? $data['organizationsUrl'] : null; + $this->container['reposUrl'] = isset($data['reposUrl']) ? $data['reposUrl'] : null; + $this->container['eventsUrl'] = isset($data['eventsUrl']) ? $data['eventsUrl'] : null; + $this->container['receivedEventsUrl'] = isset($data['receivedEventsUrl']) ? $data['receivedEventsUrl'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['memberRole'] = isset($data['memberRole']) ? $data['memberRole'] : null; + $this->container['assignee'] = isset($data['assignee']) ? $data['assignee'] : null; + $this->container['codeOwner'] = isset($data['codeOwner']) ? $data['codeOwner'] : null; + $this->container['accept'] = isset($data['accept']) ? $data['accept'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets login + * + * @return string + */ + public function getLogin() + { + return $this->container['login']; + } + + /** + * Sets login + * + * @param string $login login + * + * @return $this + */ + public function setLogin($login) + { + $this->container['login'] = $login; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets avatarUrl + * + * @return string + */ + public function getAvatarUrl() + { + return $this->container['avatarUrl']; + } + + /** + * Sets avatarUrl + * + * @param string $avatarUrl avatarUrl + * + * @return $this + */ + public function setAvatarUrl($avatarUrl) + { + $this->container['avatarUrl'] = $avatarUrl; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets htmlUrl + * + * @return string + */ + public function getHtmlUrl() + { + return $this->container['htmlUrl']; + } + + /** + * Sets htmlUrl + * + * @param string $htmlUrl htmlUrl + * + * @return $this + */ + public function setHtmlUrl($htmlUrl) + { + $this->container['htmlUrl'] = $htmlUrl; + + return $this; + } + + /** + * Gets remark + * + * @return string + */ + public function getRemark() + { + return $this->container['remark']; + } + + /** + * Sets remark + * + * @param string $remark 企业备注名 + * + * @return $this + */ + public function setRemark($remark) + { + $this->container['remark'] = $remark; + + return $this; + } + + /** + * Gets followersUrl + * + * @return string + */ + public function getFollowersUrl() + { + return $this->container['followersUrl']; + } + + /** + * Sets followersUrl + * + * @param string $followersUrl followersUrl + * + * @return $this + */ + public function setFollowersUrl($followersUrl) + { + $this->container['followersUrl'] = $followersUrl; + + return $this; + } + + /** + * Gets followingUrl + * + * @return string + */ + public function getFollowingUrl() + { + return $this->container['followingUrl']; + } + + /** + * Sets followingUrl + * + * @param string $followingUrl followingUrl + * + * @return $this + */ + public function setFollowingUrl($followingUrl) + { + $this->container['followingUrl'] = $followingUrl; + + return $this; + } + + /** + * Gets gistsUrl + * + * @return string + */ + public function getGistsUrl() + { + return $this->container['gistsUrl']; + } + + /** + * Sets gistsUrl + * + * @param string $gistsUrl gistsUrl + * + * @return $this + */ + public function setGistsUrl($gistsUrl) + { + $this->container['gistsUrl'] = $gistsUrl; + + return $this; + } + + /** + * Gets starredUrl + * + * @return string + */ + public function getStarredUrl() + { + return $this->container['starredUrl']; + } + + /** + * Sets starredUrl + * + * @param string $starredUrl starredUrl + * + * @return $this + */ + public function setStarredUrl($starredUrl) + { + $this->container['starredUrl'] = $starredUrl; + + return $this; + } + + /** + * Gets subscriptionsUrl + * + * @return string + */ + public function getSubscriptionsUrl() + { + return $this->container['subscriptionsUrl']; + } + + /** + * Sets subscriptionsUrl + * + * @param string $subscriptionsUrl subscriptionsUrl + * + * @return $this + */ + public function setSubscriptionsUrl($subscriptionsUrl) + { + $this->container['subscriptionsUrl'] = $subscriptionsUrl; + + return $this; + } + + /** + * Gets organizationsUrl + * + * @return string + */ + public function getOrganizationsUrl() + { + return $this->container['organizationsUrl']; + } + + /** + * Sets organizationsUrl + * + * @param string $organizationsUrl organizationsUrl + * + * @return $this + */ + public function setOrganizationsUrl($organizationsUrl) + { + $this->container['organizationsUrl'] = $organizationsUrl; + + return $this; + } + + /** + * Gets reposUrl + * + * @return string + */ + public function getReposUrl() + { + return $this->container['reposUrl']; + } + + /** + * Sets reposUrl + * + * @param string $reposUrl reposUrl + * + * @return $this + */ + public function setReposUrl($reposUrl) + { + $this->container['reposUrl'] = $reposUrl; + + return $this; + } + + /** + * Gets eventsUrl + * + * @return string + */ + public function getEventsUrl() + { + return $this->container['eventsUrl']; + } + + /** + * Sets eventsUrl + * + * @param string $eventsUrl eventsUrl + * + * @return $this + */ + public function setEventsUrl($eventsUrl) + { + $this->container['eventsUrl'] = $eventsUrl; + + return $this; + } + + /** + * Gets receivedEventsUrl + * + * @return string + */ + public function getReceivedEventsUrl() + { + return $this->container['receivedEventsUrl']; + } + + /** + * Sets receivedEventsUrl + * + * @param string $receivedEventsUrl receivedEventsUrl + * + * @return $this + */ + public function setReceivedEventsUrl($receivedEventsUrl) + { + $this->container['receivedEventsUrl'] = $receivedEventsUrl; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets memberRole + * + * @return string + */ + public function getMemberRole() + { + return $this->container['memberRole']; + } + + /** + * Sets memberRole + * + * @param string $memberRole memberRole + * + * @return $this + */ + public function setMemberRole($memberRole) + { + $this->container['memberRole'] = $memberRole; + + return $this; + } + + /** + * Gets assignee + * + * @return bool + */ + public function getAssignee() + { + return $this->container['assignee']; + } + + /** + * Sets assignee + * + * @param bool $assignee 是否默认指派审查 + * + * @return $this + */ + public function setAssignee($assignee) + { + $this->container['assignee'] = $assignee; + + return $this; + } + + /** + * Gets codeOwner + * + * @return bool + */ + public function getCodeOwner() + { + return $this->container['codeOwner']; + } + + /** + * Sets codeOwner + * + * @param bool $codeOwner 是否CodeOwner指派审查 + * + * @return $this + */ + public function setCodeOwner($codeOwner) + { + $this->container['codeOwner'] = $codeOwner; + + return $this; + } + + /** + * Gets accept + * + * @return bool + */ + public function getAccept() + { + return $this->container['accept']; + } + + /** + * Sets accept + * + * @param bool $accept 是否审查通过 + * + * @return $this + */ + public function setAccept($accept) + { + $this->container['accept'] = $accept; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UserBasic.php b/src/Model/UserBasic.php index a7e913f..a362da2 100644 --- a/src/Model/UserBasic.php +++ b/src/Model/UserBasic.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/UserDetail.php b/src/Model/UserDetail.php index 6dc0365..f27d254 100644 --- a/src/Model/UserDetail.php +++ b/src/Model/UserDetail.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -79,14 +79,14 @@ class UserDetail implements ModelInterface, ArrayAccess 'blog' => 'string', 'weibo' => 'string', 'bio' => 'string', - 'publicRepos' => 'string', - 'publicGists' => 'string', - 'followers' => 'string', - 'following' => 'string', - 'stared' => 'string', - 'watched' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string', + 'publicRepos' => 'int', + 'publicGists' => 'int', + 'followers' => 'int', + 'following' => 'int', + 'stared' => 'int', + 'watched' => 'int', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', 'email' => 'string' ]; @@ -117,14 +117,14 @@ class UserDetail implements ModelInterface, ArrayAccess 'blog' => null, 'weibo' => null, 'bio' => null, - 'publicRepos' => null, - 'publicGists' => null, - 'followers' => null, - 'following' => null, - 'stared' => null, - 'watched' => null, - 'createdAt' => null, - 'updatedAt' => null, + 'publicRepos' => 'int32', + 'publicGists' => 'int32', + 'followers' => 'int32', + 'following' => 'int32', + 'stared' => 'int32', + 'watched' => 'int32', + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', 'email' => null ]; @@ -886,7 +886,7 @@ public function setBio($bio) /** * Gets publicRepos * - * @return string + * @return int */ public function getPublicRepos() { @@ -896,7 +896,7 @@ public function getPublicRepos() /** * Sets publicRepos * - * @param string $publicRepos publicRepos + * @param int $publicRepos publicRepos * * @return $this */ @@ -910,7 +910,7 @@ public function setPublicRepos($publicRepos) /** * Gets publicGists * - * @return string + * @return int */ public function getPublicGists() { @@ -920,7 +920,7 @@ public function getPublicGists() /** * Sets publicGists * - * @param string $publicGists publicGists + * @param int $publicGists publicGists * * @return $this */ @@ -934,7 +934,7 @@ public function setPublicGists($publicGists) /** * Gets followers * - * @return string + * @return int */ public function getFollowers() { @@ -944,7 +944,7 @@ public function getFollowers() /** * Sets followers * - * @param string $followers followers + * @param int $followers followers * * @return $this */ @@ -958,7 +958,7 @@ public function setFollowers($followers) /** * Gets following * - * @return string + * @return int */ public function getFollowing() { @@ -968,7 +968,7 @@ public function getFollowing() /** * Sets following * - * @param string $following following + * @param int $following following * * @return $this */ @@ -982,7 +982,7 @@ public function setFollowing($following) /** * Gets stared * - * @return string + * @return int */ public function getStared() { @@ -992,7 +992,7 @@ public function getStared() /** * Sets stared * - * @param string $stared stared + * @param int $stared stared * * @return $this */ @@ -1006,7 +1006,7 @@ public function setStared($stared) /** * Gets watched * - * @return string + * @return int */ public function getWatched() { @@ -1016,7 +1016,7 @@ public function getWatched() /** * Sets watched * - * @param string $watched watched + * @param int $watched watched * * @return $this */ @@ -1030,7 +1030,7 @@ public function setWatched($watched) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -1040,7 +1040,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -1054,7 +1054,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -1064,7 +1064,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/UserEmail.php b/src/Model/UserEmail.php index d26b08c..f6c895f 100644 --- a/src/Model/UserEmail.php +++ b/src/Model/UserEmail.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/UserInfo.php b/src/Model/UserInfo.php index 520bb2f..bfaee8e 100644 --- a/src/Model/UserInfo.php +++ b/src/Model/UserInfo.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -79,14 +79,14 @@ class UserInfo implements ModelInterface, ArrayAccess 'blog' => 'string', 'weibo' => 'string', 'bio' => 'string', - 'publicRepos' => 'string', - 'publicGists' => 'string', - 'followers' => 'string', - 'following' => 'string', - 'stared' => 'string', - 'watched' => 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string', + 'publicRepos' => 'int', + 'publicGists' => 'int', + 'followers' => 'int', + 'following' => 'int', + 'stared' => 'int', + 'watched' => 'int', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', 'company' => 'string', 'profession' => 'string', 'wechat' => 'string', @@ -122,14 +122,14 @@ class UserInfo implements ModelInterface, ArrayAccess 'blog' => null, 'weibo' => null, 'bio' => null, - 'publicRepos' => null, - 'publicGists' => null, - 'followers' => null, - 'following' => null, - 'stared' => null, - 'watched' => null, - 'createdAt' => null, - 'updatedAt' => null, + 'publicRepos' => 'int32', + 'publicGists' => 'int32', + 'followers' => 'int32', + 'following' => 'int32', + 'stared' => 'int32', + 'watched' => 'int32', + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', 'company' => null, 'profession' => null, 'wechat' => null, @@ -916,7 +916,7 @@ public function setBio($bio) /** * Gets publicRepos * - * @return string + * @return int */ public function getPublicRepos() { @@ -926,7 +926,7 @@ public function getPublicRepos() /** * Sets publicRepos * - * @param string $publicRepos publicRepos + * @param int $publicRepos publicRepos * * @return $this */ @@ -940,7 +940,7 @@ public function setPublicRepos($publicRepos) /** * Gets publicGists * - * @return string + * @return int */ public function getPublicGists() { @@ -950,7 +950,7 @@ public function getPublicGists() /** * Sets publicGists * - * @param string $publicGists publicGists + * @param int $publicGists publicGists * * @return $this */ @@ -964,7 +964,7 @@ public function setPublicGists($publicGists) /** * Gets followers * - * @return string + * @return int */ public function getFollowers() { @@ -974,7 +974,7 @@ public function getFollowers() /** * Sets followers * - * @param string $followers followers + * @param int $followers followers * * @return $this */ @@ -988,7 +988,7 @@ public function setFollowers($followers) /** * Gets following * - * @return string + * @return int */ public function getFollowing() { @@ -998,7 +998,7 @@ public function getFollowing() /** * Sets following * - * @param string $following following + * @param int $following following * * @return $this */ @@ -1012,7 +1012,7 @@ public function setFollowing($following) /** * Gets stared * - * @return string + * @return int */ public function getStared() { @@ -1022,7 +1022,7 @@ public function getStared() /** * Sets stared * - * @param string $stared stared + * @param int $stared stared * * @return $this */ @@ -1036,7 +1036,7 @@ public function setStared($stared) /** * Gets watched * - * @return string + * @return int */ public function getWatched() { @@ -1046,7 +1046,7 @@ public function getWatched() /** * Sets watched * - * @param string $watched watched + * @param int $watched watched * * @return $this */ @@ -1060,7 +1060,7 @@ public function setWatched($watched) /** * Gets createdAt * - * @return string + * @return \DateTime */ public function getCreatedAt() { @@ -1070,7 +1070,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param \DateTime $createdAt createdAt * * @return $this */ @@ -1084,7 +1084,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -1094,7 +1094,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/UserMessage.php b/src/Model/UserMessage.php index 664c178..1fca93e 100644 --- a/src/Model/UserMessage.php +++ b/src/Model/UserMessage.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -60,9 +60,9 @@ class UserMessage implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'id' => 'int', 'sender' => '\Gitee\Model\UserBasic', - 'unread' => 'string', + 'unread' => 'bool', 'content' => 'string', - 'updatedAt' => 'string', + 'updatedAt' => '\DateTime', 'url' => 'string', 'htmlUrl' => 'string' ]; @@ -77,7 +77,7 @@ class UserMessage implements ModelInterface, ArrayAccess 'sender' => null, 'unread' => null, 'content' => null, - 'updatedAt' => null, + 'updatedAt' => 'date-time', 'url' => null, 'htmlUrl' => null ]; @@ -292,7 +292,7 @@ public function setSender($sender) /** * Gets unread * - * @return string + * @return bool */ public function getUnread() { @@ -302,7 +302,7 @@ public function getUnread() /** * Sets unread * - * @param string $unread unread + * @param bool $unread unread * * @return $this */ @@ -340,7 +340,7 @@ public function setContent($content) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -350,7 +350,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/UserMessageList.php b/src/Model/UserMessageList.php new file mode 100644 index 0000000..f1960b9 --- /dev/null +++ b/src/Model/UserMessageList.php @@ -0,0 +1,336 @@ + 'int', + 'list' => '\Gitee\Model\UserMessage[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'totalCount' => 'int32', + 'list' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'totalCount' => 'total_count', + 'list' => 'list' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'totalCount' => 'setTotalCount', + 'list' => 'setList' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'totalCount' => 'getTotalCount', + 'list' => 'getList' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['totalCount'] = isset($data['totalCount']) ? $data['totalCount'] : null; + $this->container['list'] = isset($data['list']) ? $data['list'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets totalCount + * + * @return int + */ + public function getTotalCount() + { + return $this->container['totalCount']; + } + + /** + * Sets totalCount + * + * @param int $totalCount totalCount + * + * @return $this + */ + public function setTotalCount($totalCount) + { + $this->container['totalCount'] = $totalCount; + + return $this; + } + + /** + * Gets list + * + * @return \Gitee\Model\UserMessage[] + */ + public function getList() + { + return $this->container['list']; + } + + /** + * Sets list + * + * @param \Gitee\Model\UserMessage[] $list 私信列表 + * + * @return $this + */ + public function setList($list) + { + $this->container['list'] = $list; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UserMini.php b/src/Model/UserMini.php index 521cef9..cfaf14f 100644 --- a/src/Model/UserMini.php +++ b/src/Model/UserMini.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/UserNotification.php b/src/Model/UserNotification.php index bb84f69..97764df 100644 --- a/src/Model/UserNotification.php +++ b/src/Model/UserNotification.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -61,9 +61,9 @@ class UserNotification implements ModelInterface, ArrayAccess 'id' => 'int', 'content' => 'string', 'type' => 'string', - 'unread' => 'string', - 'mute' => 'string', - 'updatedAt' => 'string', + 'unread' => 'bool', + 'mute' => 'bool', + 'updatedAt' => '\DateTime', 'url' => 'string', 'htmlUrl' => 'string', 'actor' => '\Gitee\Model\UserBasic', @@ -83,7 +83,7 @@ class UserNotification implements ModelInterface, ArrayAccess 'type' => null, 'unread' => null, 'mute' => null, - 'updatedAt' => null, + 'updatedAt' => 'date-time', 'url' => null, 'htmlUrl' => null, 'actor' => null, @@ -346,7 +346,7 @@ public function setType($type) /** * Gets unread * - * @return string + * @return bool */ public function getUnread() { @@ -356,7 +356,7 @@ public function getUnread() /** * Sets unread * - * @param string $unread unread + * @param bool $unread unread * * @return $this */ @@ -370,7 +370,7 @@ public function setUnread($unread) /** * Gets mute * - * @return string + * @return bool */ public function getMute() { @@ -380,7 +380,7 @@ public function getMute() /** * Sets mute * - * @param string $mute mute + * @param bool $mute mute * * @return $this */ @@ -394,7 +394,7 @@ public function setMute($mute) /** * Gets updatedAt * - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -404,7 +404,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param string $updatedAt updatedAt + * @param \DateTime $updatedAt updatedAt * * @return $this */ diff --git a/src/Model/UserNotificationCount.php b/src/Model/UserNotificationCount.php index 8929ead..45cb385 100644 --- a/src/Model/UserNotificationCount.php +++ b/src/Model/UserNotificationCount.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/UserNotificationList.php b/src/Model/UserNotificationList.php new file mode 100644 index 0000000..566492f --- /dev/null +++ b/src/Model/UserNotificationList.php @@ -0,0 +1,336 @@ + 'int', + 'list' => '\Gitee\Model\UserNotification[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'totalCount' => 'int32', + 'list' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'totalCount' => 'total_count', + 'list' => 'list' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'totalCount' => 'setTotalCount', + 'list' => 'setList' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'totalCount' => 'getTotalCount', + 'list' => 'getList' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['totalCount'] = isset($data['totalCount']) ? $data['totalCount'] : null; + $this->container['list'] = isset($data['list']) ? $data['list'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets totalCount + * + * @return int + */ + public function getTotalCount() + { + return $this->container['totalCount']; + } + + /** + * Sets totalCount + * + * @param int $totalCount totalCount + * + * @return $this + */ + public function setTotalCount($totalCount) + { + $this->container['totalCount'] = $totalCount; + + return $this; + } + + /** + * Gets list + * + * @return \Gitee\Model\UserNotification[] + */ + public function getList() + { + return $this->container['list']; + } + + /** + * Sets list + * + * @param \Gitee\Model\UserNotification[] $list 通知列表 + * + * @return $this + */ + public function setList($list) + { + $this->container['list'] = $list; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UserNotificationNamespace.php b/src/Model/UserNotificationNamespace.php index 151b336..774c3a4 100644 --- a/src/Model/UserNotificationNamespace.php +++ b/src/Model/UserNotificationNamespace.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/UserNotificationSubject.php b/src/Model/UserNotificationSubject.php index 5373455..76965d9 100644 --- a/src/Model/UserNotificationSubject.php +++ b/src/Model/UserNotificationSubject.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** diff --git a/src/Model/WeekReport.php b/src/Model/WeekReport.php index 559cd4c..846f233 100644 --- a/src/Model/WeekReport.php +++ b/src/Model/WeekReport.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /** @@ -61,11 +61,11 @@ class WeekReport implements ModelInterface, ArrayAccess 'id' => 'int', 'content' => 'string', 'contentHtml' => 'string', - 'year' => 'string', - 'month' => 'string', - 'weekIndex' => 'string', - 'weekBegin' => 'string', - 'weekEnd' => 'string', + 'year' => 'int', + 'month' => 'int', + 'weekIndex' => 'int', + 'weekBegin' => '\DateTime', + 'weekEnd' => '\DateTime', 'createdAt' => '\DateTime', 'updatedAt' => '\DateTime', 'user' => '\Gitee\Model\UserMini' @@ -80,11 +80,11 @@ class WeekReport implements ModelInterface, ArrayAccess 'id' => 'int32', 'content' => null, 'contentHtml' => null, - 'year' => null, - 'month' => null, - 'weekIndex' => null, - 'weekBegin' => null, - 'weekEnd' => null, + 'year' => 'int32', + 'month' => 'int32', + 'weekIndex' => 'int32', + 'weekBegin' => 'date', + 'weekEnd' => 'date', 'createdAt' => 'date-time', 'updatedAt' => 'date-time', 'user' => null @@ -340,7 +340,7 @@ public function setContentHtml($contentHtml) /** * Gets year * - * @return string + * @return int */ public function getYear() { @@ -350,7 +350,7 @@ public function getYear() /** * Sets year * - * @param string $year year + * @param int $year year * * @return $this */ @@ -364,7 +364,7 @@ public function setYear($year) /** * Gets month * - * @return string + * @return int */ public function getMonth() { @@ -374,7 +374,7 @@ public function getMonth() /** * Sets month * - * @param string $month month + * @param int $month month * * @return $this */ @@ -388,7 +388,7 @@ public function setMonth($month) /** * Gets weekIndex * - * @return string + * @return int */ public function getWeekIndex() { @@ -398,7 +398,7 @@ public function getWeekIndex() /** * Sets weekIndex * - * @param string $weekIndex weekIndex + * @param int $weekIndex weekIndex * * @return $this */ @@ -412,7 +412,7 @@ public function setWeekIndex($weekIndex) /** * Gets weekBegin * - * @return string + * @return \DateTime */ public function getWeekBegin() { @@ -422,7 +422,7 @@ public function getWeekBegin() /** * Sets weekBegin * - * @param string $weekBegin weekBegin + * @param \DateTime $weekBegin weekBegin * * @return $this */ @@ -436,7 +436,7 @@ public function setWeekBegin($weekBegin) /** * Gets weekEnd * - * @return string + * @return \DateTime */ public function getWeekEnd() { @@ -446,7 +446,7 @@ public function getWeekEnd() /** * Sets weekEnd * - * @param string $weekEnd weekEnd + * @param \DateTime $weekEnd weekEnd * * @return $this */ diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index 0b11c8a..7a6f421 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -15,10 +15,10 @@ * * Gitee SDK for PHP * - * OpenAPI spec version: 5.4.73 + * OpenAPI spec version: 5.4.85 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.32 + * Swagger Codegen version: 2.4.42 */ /**