gitee-php/gitee-enterprise-sdk

gitee enterprise sdk for php

v1.1.0 2024-08-07 01:46 UTC

This package is auto-updated.

Last update: 2024-09-07 02:03:30 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

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