gitee-php / gitee-enterprise-sdk
gitee enterprise sdk for php
v1.1.0
2024-08-07 01:46 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
README
Gitee Enterprise SDK for PHP (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
Requirements
PHP 5.5 and later
Installation & Usage
Composer
composer require gitee-php/gitee-enterprise-sdk
Manual Installation
Download the files and include autoload.php
:
require_once '/path/to/vendor/autoload.php';
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once __DIR__ . '/vendor/autoload.php'; $apiInstance = new GiteeEnterprise\Api\AdminLogsStatisticApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $enterpriseId = 56; // int | 企业id (https://gitee.com/api/v8/swagger#/getList 的返回值的 id) $accessToken = "accessToken_example"; // string | 用户授权码 $member = "member_example"; // string | 成员username $startDate = "startDate_example"; // string | 查询的起始时间。(格式:yyyy-mm-dd) $endDate = "endDate_example"; // string | 查询的结束时间。(格式:yyyy-mm-dd) $page = 1; // int | 当前的页码 $perPage = 56; // int | 每页的数量,最大为 100 try { $result = $apiInstance->getEnterpriseIdLogStatisticsDeployKeyLogs($enterpriseId, $accessToken, $member, $startDate, $endDate, $page, $perPage); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdminLogsStatisticApi->getEnterpriseIdLogStatisticsDeployKeyLogs: ', $e->getMessage(), PHP_EOL; } ?>
Warning
由于 Gitee 官方提供的 swagger.json
存在错误,所以本 SDK
中存在部分 API
的返回值 Model
未能正确返回内容,如果发现可以提交 Issue 或提交 Pull Request
。
同时为了减小影响,可以使用 SDK
提供的 ResponseHandler
来获取到原始响应。
<?php require_once __DIR__ . '/vendor/autoload.php'; $response = new GiteeEnterprise\ResponseHandler(); $client = $response->createClientWithMiddleware(); $apiInstance = new GiteeEnterprise\Api\MembersApi($client); $enterpriseId = 56; // int | 企业id (https://gitee.com/api/v8/swagger#/getList 的返回值的 id) $accessToken = "accessToken_example"; // string | 用户授权码 try { $result = $apiInstance->getEnterpriseIdMembers($enterpriseId, $accessToken); print_r($result); print_r($response->toArray()); } catch (Exception $e) { echo 'Exception when calling MembersApi->getEnterpriseIdMembers: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://api.gitee.com/enterprises
Documentation For Models
- Annotation
- Annotations
- AttachFile
- AttachFileIssue
- Branch
- BulkResponseWithKey
- CheckRun
- CheckRunOutOut
- CheckRunSummary
- CheckRuns
- CherryPick
- Commit
- CommitBase
- CommitBranch
- CommitCompare
- CommitDetail
- CommitList
- CommitNote
- CommitNoteDetail
- CommitSignature
- DeployKey
- DeployKeyLog
- Diff
- DiffPosition
- Doc
- DocAttachFile
- DocDirectory
- DocNode
- DocNodeDetail
- DocNodeLevel
- DocNodeLog
- DocRecent
- EmailInvitation
- Enterprise
- EnterpriseAuth
- EnterpriseDeployKey
- EnterpriseNavigate
- EnterpriseProgram
- EnterpriseProgramsList
- EnterpriseProject
- EnterpriseProjectsList
- EnterpriseQuota
- EnterpriseRole
- EnterpriseRoleBase
- EnterpriseRoleDetail
- EnterpriseRoleLog
- EnterpriseScrumVersion
- EnvVariable
- Event
- FileVersion
- GiteegoPipeline
- Group
- GroupDetail
- GroupManageLog
- GroupMember
- GroupWithAuth
- InviteGroupMember
- InviteProjectGroupMember
- Issue
- IssueAuth
- IssueDetail
- IssueDetailWithRelatedInfos
- IssueField
- IssueGantt
- IssueMain
- IssueMemberSelect
- IssueNote
- IssueOperateLog
- IssueReaction
- IssueState
- IssueStateDetail
- IssueStateForMigration
- IssueType
- IssueTypeInEnterprise
- IssueTypeInProgram
- IssueTypeStateRef
- IssueTypeWithStateRef
- IssueWorkloadOverview
- Label
- LabelDetail
- LinkIssue
- Member
- MemberApplication
- MemberBulkModify
- MemberManageLog
- MemberWeekReport
- Milestone
- MilestoneDetail
- MilestoneList
- ModelNamespace
- MyWeekReport
- OsProject
- OsProjectsList
- PrAssign
- PrAssigner
- PrOperateLog
- Program
- ProgramComponent
- ProgramDirectory
- ProgramExtraField
- ProgramList
- ProgramManageLog
- ProgramWithAuth
- ProgramWithCollection
- ProgramWithComponents
- Project
- ProjectAccessLog
- ProjectBase
- ProjectBaseSetting
- ProjectCloneWaysBase
- ProjectContributor
- ProjectDetail
- ProjectGroup
- ProjectGroupDetail
- ProjectGroupManageLog
- ProjectGroupMember
- ProjectGroupOperateAuths
- ProjectGroupRoot
- ProjectManageLog
- ProjectMember
- ProjectMemberAdd
- ProjectMemberList
- ProjectMemberOverview
- ProjectOverview
- ProjectPushConfig
- ProjectRole
- ProjectSummary
- ProjectSyncSetting
- ProjectTagBase
- ProjectWithAuth
- ProjectsList
- PullRequest
- PullRequestAuth
- PullRequestDetail
- PullRequestFiles
- PullRequestNote
- PullRequestNoteTree
- PullRuns
- Reaction
- Release
- ResultResponse
- RevertedPullRequest
- RootGroupMember
- ScrumDocNode
- ScrumSprint
- ScrumStage
- SecuritySettingLog
- Statistic
- Tag
- TestPlan
- TestRepository
- TreeNote
- User
- UserProjectList
- UserStatistic
- UserWithRemark
- UserWorkloadsList
- UsersProjects
- WeekReport
- WeekReportDetail
- WeekReportNote
- WeekReportPreview
- WeekReportRelation
- WeekReportTemplate
- WikiInfo
- WikiSort
- WikiSortDetail
- WithAttachFiles
- WithWorkload