From 800101c370267a8ed40abf82c331ca7d507ff113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Mon, 15 Nov 2021 10:24:20 +0800 Subject: [PATCH] Add Client method description (#242) --- bin/release | 39 ++++++- src/Client.php | 191 +++++++++++++++++----------------- src/Service.php | 267 +++++++++++------------------------------------- 3 files changed, 194 insertions(+), 303 deletions(-) diff --git a/bin/release b/bin/release index 9ae9c2cc..d1a117e3 100755 --- a/bin/release +++ b/bin/release @@ -20,17 +20,27 @@ $clientFileContent = file_get_contents($class->getFileName()); $des = new Description(Service::getService()); $operations = array_keys($des->getOperations()); $docComment = "/**\n"; +$token = genToken(); foreach ($operations as $key => $operation) { - $type = $arg = ''; + $type = $arg = $methodDesc = ''; $model = $des->getOperation($operation)->getResponseModel(); if ($des->hasModel($model)) { $type = $des->getModel($model)->getType(); if (!empty($des->getOperation($operation)->getParams())) { - $arg = ' (array $arg)'; + $arg = '(array $args)'; + } + if (isset($token['method'][$operation])) { + $line = $token['method'][$operation]; + if (isset($token['comment'][$line - 1])) { + $methodDesc = $token['comment'][$line - 1]; + } else { + $methodDesc = isset($token['comment'][$line]) ? $token['comment'][$line] : ''; + } } } - $docComment .= " * @method {$type} {$operation}{$arg}\n"; + $docComment .= " * @method {$type} {$operation}{$arg} {$methodDesc}\n"; } +$docComment .= " * @see \Qcloud\Cos\Service::getService()\n"; $docComment .= ' */'; $data = str_replace($oldDocComment, $docComment, $clientFileContent); @@ -49,3 +59,26 @@ if (isset($argv[1])) { echo 'Update version successfully.', PHP_EOL; } } + +function genToken() +{ + $result = []; + $token = token_get_all(file_get_contents(dirname(__DIR__) . '/src/Service.php')); + foreach ($token as $value) { + if (!is_array($value) || !in_array($value[0], [T_COMMENT, T_CONSTANT_ENCAPSED_STRING])) { + continue; + } + switch ($value[0]) { + case T_COMMENT: + $result['comment'][$value[2]] = trim(ltrim($value[1], '//')); + break; + case T_CONSTANT_ENCAPSED_STRING: + $key = trim($value[1], "'"); + if(!isset($result['method'][$key])) { + $result['method'][$key] = $value[2]; + } + break; + } + } + return $result; +} diff --git a/src/Client.php b/src/Client.php index da2a18e9..60bf59f4 100644 --- a/src/Client.php +++ b/src/Client.php @@ -15,100 +15,101 @@ use GuzzleHttp\Psr7; /** - * @method object AbortMultipartUpload (array $arg) - * @method object CreateBucket (array $arg) - * @method object CompleteMultipartUpload (array $arg) - * @method object CreateMultipartUpload (array $arg) - * @method object CopyObject (array $arg) - * @method object DeleteBucket (array $arg) - * @method object DeleteBucketCors (array $arg) - * @method object DeleteBucketTagging (array $arg) - * @method object DeleteBucketInventory (array $arg) - * @method object DeleteObject (array $arg) - * @method object DeleteObjects (array $arg) - * @method object DeleteBucketWebsite (array $arg) - * @method object DeleteBucketLifecycle (array $arg) - * @method object DeleteBucketReplication (array $arg) - * @method object PutObjectTagging (array $arg) - * @method object GetObjectTagging (array $arg) - * @method object DeleteObjectTagging (array $arg) - * @method object GetObject (array $arg) - * @method object GetObjectAcl (array $arg) - * @method object GetBucketAcl (array $arg) - * @method object GetBucketCors (array $arg) - * @method object GetBucketDomain (array $arg) - * @method object GetBucketAccelerate (array $arg) - * @method object GetBucketWebsite (array $arg) - * @method object GetBucketLifecycle (array $arg) - * @method object GetBucketVersioning (array $arg) - * @method object GetBucketReplication (array $arg) - * @method object GetBucketLocation (array $arg) - * @method object GetBucketNotification (array $arg) - * @method object GetBucketLogging (array $arg) - * @method object GetBucketInventory (array $arg) - * @method object GetBucketTagging (array $arg) - * @method object UploadPart (array $arg) - * @method object PutObject (array $arg) - * @method object AppendObject (array $arg) - * @method object PutObjectAcl (array $arg) - * @method object PutBucketAcl (array $arg) - * @method object PutBucketCors (array $arg) - * @method object PutBucketDomain (array $arg) - * @method object PutBucketLifecycle (array $arg) - * @method object PutBucketVersioning (array $arg) - * @method object PutBucketAccelerate (array $arg) - * @method object PutBucketWebsite (array $arg) - * @method object PutBucketReplication (array $arg) - * @method object PutBucketNotification (array $arg) - * @method object PutBucketTagging (array $arg) - * @method object PutBucketLogging (array $arg) - * @method object PutBucketInventory (array $arg) - * @method object RestoreObject (array $arg) - * @method object ListParts (array $arg) - * @method object ListObjects (array $arg) - * @method object ListBuckets - * @method object ListObjectVersions (array $arg) - * @method object ListMultipartUploads (array $arg) - * @method object ListBucketInventoryConfigurations (array $arg) - * @method object HeadObject (array $arg) - * @method object HeadBucket (array $arg) - * @method object UploadPartCopy (array $arg) - * @method object SelectObjectContent (array $arg) - * @method object PutBucketIntelligentTiering (array $arg) - * @method object GetBucketIntelligentTiering (array $arg) - * @method object ImageInfo (array $arg) - * @method object ImageExif (array $arg) - * @method object ImageAve (array $arg) - * @method object ImageProcess (array $arg) - * @method object Qrcode (array $arg) - * @method object QrcodeGenerate (array $arg) - * @method object DetectLabel (array $arg) - * @method object PutBucketImageStyle (array $arg) - * @method object GetBucketImageStyle (array $arg) - * @method object DeleteBucketImageStyle (array $arg) - * @method object PutBucketGuetzli (array $arg) - * @method object GetBucketGuetzli (array $arg) - * @method object DeleteBucketGuetzli (array $arg) - * @method object GetObjectSensitiveContentRecognition (array $arg) - * @method object DetectText (array $arg) - * @method object GetSnapshot (array $arg) - * @method object PutBucketReferer (array $arg) - * @method object GetBucketReferer (array $arg) - * @method object GetMediaInfo (array $arg) - * @method object CreateMediaTranscodeJobs (array $arg) - * @method object CreateMediaSnapshotJobs (array $arg) - * @method object CreateMediaConcatJobs (array $arg) - * @method object DetectAudio (array $arg) - * @method object GetDetectAudioResult (array $arg) - * @method object GetDetectTextResult (array $arg) - * @method object DetectVideo (array $arg) - * @method object GetDetectVideoResult (array $arg) - * @method object DetectDocument (array $arg) - * @method object GetDetectDocumentResult (array $arg) - * @method object CreateDocProcessJobs (array $arg) - * @method object DescribeDocProcessQueues (array $arg) - * @method object DescribeDocProcessJob (array $arg) - * @method object GetDescribeDocProcessJobs (array $arg) + * @method object AbortMultipartUpload(array $args) 舍弃一个分块上传且删除已上传的分片块 + * @method object CreateBucket(array $args) 创建存储桶(Bucket) + * @method object CompleteMultipartUpload(array $args) 完成整个分块上传 + * @method object CreateMultipartUpload(array $args) 初始化分块上传 + * @method object CopyObject(array $args) 复制对象 + * @method object DeleteBucket(array $args) 删除存储桶 (Bucket) + * @method object DeleteBucketCors(array $args) 删除跨域访问配置信息 + * @method object DeleteBucketTagging(array $args) 删除存储桶标签信息 + * @method object DeleteBucketInventory(array $args) 删除存储桶标清单任务 + * @method object DeleteObject(array $args) 删除 COS 上单个对象 + * @method object DeleteObjects(array $args) 批量删除 COS 对象 + * @method object DeleteBucketWebsite(array $args) 删除存储桶(Bucket)的website + * @method object DeleteBucketLifecycle(array $args) 删除存储桶(Bucket)的生命周期配置 + * @method object DeleteBucketReplication(array $args) 删除跨区域复制配置 + * @method object PutObjectTagging(array $args) 配置对象标签 + * @method object GetObjectTagging(array $args) 获取对象标签信息 + * @method object DeleteObjectTagging(array $args) 删除对象标签 + * @method object GetObject(array $args) 下载对象 + * @method object GetObjectAcl(array $args) 获取 COS 对象的访问权限信息(Access Control List, ACL) + * @method object GetBucketAcl(array $args) 获取存储桶(Bucket)的访问权限信息(Access Control List, ACL) + * @method object GetBucketCors(array $args) 查询存储桶(Bucket)跨域访问配置信息 + * @method object GetBucketDomain(array $args) 查询存储桶(Bucket)Domain配置信息 + * @method object GetBucketAccelerate(array $args) 查询存储桶(Bucket)Accelerate配置信息 + * @method object GetBucketWebsite(array $args) 查询存储桶(Bucket)Website配置信息 + * @method object GetBucketLifecycle(array $args) 查询存储桶(Bucket)的生命周期配置 + * @method object GetBucketVersioning(array $args) 获取存储桶(Bucket)版本控制信息 + * @method object GetBucketReplication(array $args) 获取存储桶(Bucket)跨区域复制配置信息 + * @method object GetBucketLocation(array $args) 获取存储桶(Bucket)所在的地域信息 + * @method object GetBucketNotification(array $args) 获取存储桶(Bucket)Notification信息 + * @method object GetBucketLogging(array $args) 获取存储桶(Bucket)日志信息 + * @method object GetBucketInventory(array $args) 获取存储桶(Bucket)清单信息 + * @method object GetBucketTagging(array $args) 获取存储桶(Bucket)标签信息 + * @method object UploadPart(array $args) 分块上传 + * @method object PutObject(array $args) 上传对象 + * @method object AppendObject(array $args) 追加对象 + * @method object PutObjectAcl(array $args) 设置 COS 对象的访问权限信息(Access Control List, ACL) + * @method object PutBucketAcl(array $args) 设置存储桶(Bucket)的访问权限(Access Control List, ACL) + * @method object PutBucketCors(array $args) 设置存储桶(Bucket)的跨域配置信息 + * @method object PutBucketDomain(array $args) 设置存储桶(Bucket)的Domain信息 + * @method object PutBucketLifecycle(array $args) 设置存储桶(Bucket)生命周期配置 + * @method object PutBucketVersioning(array $args) 存储桶(Bucket)版本控制 + * @method object PutBucketAccelerate(array $args) 配置存储桶(Bucket)Accelerate + * @method object PutBucketWebsite(array $args) 配置存储桶(Bucket)website + * @method object PutBucketReplication(array $args) 配置存储桶(Bucket)跨区域复制 + * @method object PutBucketNotification(array $args) 设置存储桶(Bucket)的回调设置 + * @method object PutBucketTagging(array $args) 配置存储桶(Bucket)标签 + * @method object PutBucketLogging(array $args) 开启存储桶(Bucket)日志服务 + * @method object PutBucketInventory(array $args) 配置存储桶(Bucket)清单 + * @method object RestoreObject(array $args) 回热归档对象 + * @method object ListParts(array $args) 查询存储桶(Bucket)中正在进行中的分块上传对象 + * @method object ListObjects(array $args) 查询存储桶(Bucket)下的部分或者全部对象 + * @method object ListBuckets 获取所属账户的所有存储空间列表 + * @method object ListObjectVersions(array $args) 获取多版本对象 + * @method object ListMultipartUploads(array $args) 获取已上传分块列表 + * @method object ListBucketInventoryConfigurations(array $args) 获取清单列表 + * @method object HeadObject(array $args) 获取对象的meta信息 + * @method object HeadBucket(array $args) 存储桶(Bucket)是否存在 + * @method object UploadPartCopy(array $args) 分块copy + * @method object SelectObjectContent(array $args) 检索对象内容 + * @method object PutBucketIntelligentTiering(array $args) 存储桶(Bucket)开启智能分层 + * @method object GetBucketIntelligentTiering(array $args) 查询存储桶(Bucket)智能分层 + * @method object ImageInfo(array $args) 万象-获取图片基本信息 + * @method object ImageExif(array $args) 万象-获取图片EXIF信息 + * @method object ImageAve(array $args) 万象-获取图片主色调信息 + * @method object ImageProcess(array $args) 万象-云上数据处理 + * @method object Qrcode(array $args) 万象-二维码下载时识别 + * @method object QrcodeGenerate(array $args) 万象-二维码生成 + * @method object DetectLabel(array $args) 万象-图片标签 + * @method object PutBucketImageStyle(array $args) 万象-增加样式 + * @method object GetBucketImageStyle(array $args) 万象-查询样式 + * @method object DeleteBucketImageStyle(array $args) 万象-删除样式 + * @method object PutBucketGuetzli(array $args) 万象-开通Guetzli压缩 + * @method object GetBucketGuetzli(array $args) 万象-查询Guetzli状态 + * @method object DeleteBucketGuetzli(array $args) 万象-关闭Guetzli压缩 + * @method object GetObjectSensitiveContentRecognition(array $args) 图片审核 + * @method object DetectText(array $args) 文本审核 + * @method object GetSnapshot(array $args) 媒体截图 + * @method object PutBucketReferer(array $args) 添加防盗链 + * @method object GetBucketReferer(array $args) 获取防盗链规则 + * @method object GetMediaInfo(array $args) 获取媒体信息 + * @method object CreateMediaTranscodeJobs(array $args) 媒体转码 + * @method object CreateMediaSnapshotJobs(array $args) 媒体转码 + * @method object CreateMediaConcatJobs(array $args) 媒体截图 + * @method object DetectAudio(array $args) 媒体拼接 + * @method object GetDetectAudioResult(array $args) 音频审核 + * @method object GetDetectTextResult(array $args) 主动获取音频审核结果 + * @method object DetectVideo(array $args) 主动获取文本文件审核结果 + * @method object GetDetectVideoResult(array $args) 视频审核 + * @method object DetectDocument(array $args) 主动获取视频审核结果 + * @method object GetDetectDocumentResult(array $args) 文档审核 + * @method object CreateDocProcessJobs(array $args) 主动获取文档审核结果 + * @method object DescribeDocProcessQueues(array $args) 提交文档转码任务 + * @method object DescribeDocProcessJob(array $args) 查询文档转码队列 + * @method object GetDescribeDocProcessJobs(array $args) 查询文档转码任务 + * @see \Qcloud\Cos\Service::getService() */ class Client extends GuzzleClient { const VERSION = '2.4.1'; @@ -123,7 +124,7 @@ class Client extends GuzzleClient { private $signature; private $rawCosConfig; - public function __construct($cosConfig) { + public function __construct(array $cosConfig) { $this->rawCosConfig = $cosConfig; $this->cosConfig['schema'] = isset($cosConfig['schema']) ? $cosConfig['schema'] : 'http'; $this->cosConfig['region'] = isset($cosConfig['region']) ? region_map($cosConfig['region']) : null; diff --git a/src/Service.php b/src/Service.php index 534cade5..7f81522f 100644 --- a/src/Service.php +++ b/src/Service.php @@ -1,8 +1,10 @@ 'V5', 'description' => 'Cos V5 API Service', 'operations' => array( - // 舍弃一个分块上传且删除已上传的分片块的方法. + // 舍弃一个分块上传且删除已上传的分片块 'AbortMultipartUpload' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}{/Key*}', @@ -37,7 +39,7 @@ public static function getService() { ) ) ), - // 创建存储桶(Bucket)的方法. + // 创建存储桶(Bucket) 'CreateBucket' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}', @@ -59,7 +61,7 @@ public static function getService() { ) ) ), - // 完成整个分块上传的方法. + // 完成整个分块上传 'CompleteMultipartUpload' => array( 'httpMethod' => 'POST', 'uri' => '/{Bucket}{/Key*}', @@ -117,7 +119,7 @@ public static function getService() { ) ) ), - // 初始化分块上传的方法. + // 初始化分块上传 'CreateMultipartUpload' => array( 'httpMethod' => 'POST', 'uri' => '/{Bucket}{/Key*}?uploads', @@ -254,7 +256,7 @@ public static function getService() { ) ) ), - // 复制对象的方法. + // 复制对象 'CopyObject' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}{/Key*}', @@ -431,7 +433,7 @@ public static function getService() { ) ), ), - // 删除存储桶 (Bucket)的方法. + // 删除存储桶 (Bucket) 'DeleteBucket' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}', @@ -446,7 +448,7 @@ public static function getService() { ) ) ), - // 删除跨域访问配置信息的方法 + // 删除跨域访问配置信息 'DeleteBucketCors' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}?cors', @@ -461,7 +463,7 @@ public static function getService() { ), ), ), - // 删除存储桶标签信息的方法 + // 删除存储桶标签信息 'DeleteBucketTagging' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}?tagging', @@ -476,7 +478,7 @@ public static function getService() { ), ), ), - // 删除存储桶标清单任务的方法 + // 删除存储桶标清单任务 'DeleteBucketInventory' => array( 'httpMethod' => 'Delete', 'uri' => '/{Bucket}?inventory', @@ -497,7 +499,7 @@ public static function getService() { ) ), ), - // 删除 COS 上单个对象的方法. + // 删除 COS 上单个对象 'DeleteObject' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}{/Key*}', @@ -536,7 +538,7 @@ public static function getService() { ) ) ), - // 批量删除 COS 对象的方法. + // 批量删除 COS 对象 'DeleteObjects' => array( 'httpMethod' => 'POST', 'uri' => '/{Bucket}?delete', @@ -594,7 +596,7 @@ public static function getService() { ) ), ), - // 删除存储桶(Bucket) 的website的方法. + // 删除存储桶(Bucket)的website 'DeleteBucketWebsite' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}?website', @@ -609,7 +611,7 @@ public static function getService() { ), ), ), - // 删除存储桶(Bucket) 的生命周期配置的方法. + // 删除存储桶(Bucket)的生命周期配置 'DeleteBucketLifecycle' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}?lifecycle', @@ -624,7 +626,7 @@ public static function getService() { ), ), ), - // 删除跨区域复制配置的方法. + // 删除跨区域复制配置 'DeleteBucketReplication' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}?replication', @@ -639,7 +641,7 @@ public static function getService() { ), ), ), - // 配置对象标签的方法. + // 配置对象标签 'PutObjectTagging' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}{/Key*}?tagging', @@ -689,7 +691,7 @@ public static function getService() { ), ), ), - // 获取对象标签信息的方法 + // 获取对象标签信息 'GetObjectTagging' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}{/Key*}?tagging', @@ -713,7 +715,7 @@ public static function getService() { ) ), ), - // 删除对象标签的方法 + // 删除对象标签 'DeleteObjectTagging' => array( 'httpMethod' => 'DELETE', 'uri' => '/{Bucket}{/Key*}?tagging', @@ -737,7 +739,7 @@ public static function getService() { ) ) ), - // 下载对象的方法. + // 下载对象 'GetObject' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}{/Key*}', @@ -854,7 +856,7 @@ public static function getService() { ) ) ), - // 获取 COS 对象的访问权限信息(Access Control List, ACL)的方法. + // 获取 COS 对象的访问权限信息(Access Control List, ACL) 'GetObjectAcl' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}{/Key*}?acl', @@ -887,7 +889,7 @@ public static function getService() { ) ) ), - // 获取存储桶(Bucket) 的访问权限信息(Access Control List, ACL)的方法. + // 获取存储桶(Bucket)的访问权限信息(Access Control List, ACL) 'GetBucketAcl' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?acl', @@ -902,7 +904,7 @@ public static function getService() { ) ) ), - // 查询存储桶(Bucket) 跨域访问配置信息的方法. + // 查询存储桶(Bucket)跨域访问配置信息 'GetBucketCors' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?cors', @@ -917,7 +919,7 @@ public static function getService() { ) ), ), - // 查询存储桶(Bucket) Domain配置信息的方法. + // 查询存储桶(Bucket)Domain配置信息 'GetBucketDomain' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?domain', @@ -932,7 +934,7 @@ public static function getService() { ) ), ), - // 查询存储桶(Bucket) Accelerate配置信息的方法. + // 查询存储桶(Bucket)Accelerate配置信息 'GetBucketAccelerate' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?accelerate', @@ -947,7 +949,7 @@ public static function getService() { ) ), ), - // 查询存储桶(Bucket) Website配置信息的方法. + // 查询存储桶(Bucket)Website配置信息 'GetBucketWebsite' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?website', @@ -962,7 +964,7 @@ public static function getService() { ) ), ), - // 查询存储桶(Bucket) 的生命周期配置的方法. + // 查询存储桶(Bucket)的生命周期配置 'GetBucketLifecycle' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?lifecycle', @@ -977,7 +979,7 @@ public static function getService() { ) ), ), - // 获取存储桶(Bucket)版本控制信息的方法. + // 获取存储桶(Bucket)版本控制信息 'GetBucketVersioning' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?versioning', @@ -992,7 +994,7 @@ public static function getService() { ) ), ), - // 获取存储桶(Bucket) 跨区域复制配置信息的方法. + // 获取存储桶(Bucket)跨区域复制配置信息 'GetBucketReplication' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?replication', @@ -1007,7 +1009,7 @@ public static function getService() { ) ), ), - // 获取存储桶(Bucket) 所在的地域信息的方法. + // 获取存储桶(Bucket)所在的地域信息 'GetBucketLocation' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?location', @@ -1022,7 +1024,7 @@ public static function getService() { ), ), ), - // 获取存储桶(Bucket) Notification信息的方法. + // 获取存储桶(Bucket)Notification信息 'GetBucketNotification' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?notification', @@ -1037,7 +1039,7 @@ public static function getService() { ) ), ), - // 获取存储桶(Bucket) 日志信息的方法. + // 获取存储桶(Bucket)日志信息 'GetBucketLogging' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?logging', @@ -1052,7 +1054,7 @@ public static function getService() { ) ), ), - // 获取存储桶(Bucket) 清单信息的方法. + // 获取存储桶(Bucket)清单信息 'GetBucketInventory' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?inventory', @@ -1073,7 +1075,7 @@ public static function getService() { ) ), ), - // 获取存储桶(Bucket) 标签信息的方法. + // 获取存储桶(Bucket)标签信息 'GetBucketTagging' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?tagging', @@ -1088,7 +1090,7 @@ public static function getService() { ) ), ), - // 分块上传的方法. + // 分块上传 'UploadPart' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}{/Key*}', @@ -1119,7 +1121,6 @@ public static function getService() { ), 'ContentMD5' => array( 'type' => array( -// 'string', 'boolean' ), 'location' => 'header', @@ -1176,7 +1177,7 @@ public static function getService() { ) ) ), - // 上传对象的方法. + // 上传对象 'PutObject' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}{/Key*}', @@ -1234,7 +1235,6 @@ public static function getService() { ), 'ContentMD5' => array( 'type' => array( -// 'string', 'boolean' ), 'location' => 'header', @@ -1454,146 +1454,7 @@ public static function getService() { ) ) ), - // 追加对象 - 'AppendObject' => array( - 'httpMethod' => 'POST', - 'uri' => '/{Bucket}{/Key*}?append', - 'class' => 'Qcloud\\Cos\\Command', - 'responseClass' => 'AppendObjectOutput', - 'responseType' => 'model', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'AppendObjectRequest' - ) - ), - 'parameters' => array( - 'Position' => array( - 'type' => 'integer', - 'required' => true, - 'location' => 'query', - 'sentAs' => 'position' - ), - 'ACL' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-acl' - ), - 'Body' => array( - 'required' => true, - 'type' => array( - 'any' - ), - 'location' => 'body' - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri' - ), - 'CacheControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Cache-Control' - ), - 'ContentDisposition' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Disposition' - ), - 'ContentEncoding' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Encoding' - ), - 'ContentLanguage' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Language' - ), - 'ContentLength' => array( - 'type' => 'numeric', - 'minimum'=> 0, - 'location' => 'header', - 'sentAs' => 'Content-Length' - ), - 'ContentMD5' => array( - 'type' => array( - 'boolean' - ), - 'location' => 'header', - 'sentAs' => 'Content-MD5' - ), - 'ContentType' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Type' - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'minLength' => 1, - 'filters' => array( - 'Qcloud\\Cos\\Client::explodeKey' - ) - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-server-side-encryption', - ), - 'StorageClass' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-storage-class', - ), - 'WebsiteRedirectLocation' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-website-redirect-location', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-server-side-encryption-cos-kms-key-id', - ), - 'RequestPayer' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-cos-request-payer', - ), - 'ACP' => array( - 'type' => 'object', - 'additionalProperties' => true, - ), - 'PicOperations' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Pic-Operations', - ), - 'TrafficLimit' => array( - 'type' => 'integer', - 'location' => 'header', - 'sentAs' => 'x-cos-traffic-limit', - ) - ) - ), - // 设置 COS 对象的访问权限信息(Access Control List, ACL)的方法. + // 设置 COS 对象的访问权限信息(Access Control List, ACL) 'PutObjectAcl' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}{/Key*}?acl', @@ -1701,7 +1562,7 @@ public static function getService() { ), ) ), - // 设置存储桶(Bucket) 的访问权限(Access Control List, ACL)的方法. + // 设置存储桶(Bucket)的访问权限(Access Control List, ACL) 'PutBucketAcl' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?acl', @@ -1807,7 +1668,7 @@ public static function getService() { ), ), ), - // 设置存储桶(Bucket) 的跨域配置信息的方法. + // 设置存储桶(Bucket)的跨域配置信息 'PutBucketCors' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?cors', @@ -1895,7 +1756,7 @@ public static function getService() { ), ), ), - // 设置存储桶(Bucket) 的Domain信息的方法. + // 设置存储桶(Bucket)的Domain信息 'PutBucketDomain' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?domain', @@ -1946,7 +1807,7 @@ public static function getService() { ), ), ), - // 设置存储桶(Bucket) 生命周期配置的方法. + // 设置存储桶(Bucket)生命周期配置 'PutBucketLifecycle' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?lifecycle', @@ -2073,7 +1934,7 @@ public static function getService() { ), ), ), - // 存储桶(Bucket)版本控制的方法. + // 存储桶(Bucket)版本控制 'PutBucketVersioning' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?versioning', @@ -2107,7 +1968,7 @@ public static function getService() { ), ), ), - // 配置存储桶(Bucket) Accelerate的方法. + // 配置存储桶(Bucket)Accelerate 'PutBucketAccelerate' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?accelerate', @@ -2133,7 +1994,7 @@ public static function getService() { ) ), ), - // 配置存储桶(Bucket) website的方法. + // 配置存储桶(Bucket)website 'PutBucketWebsite' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?website', @@ -2228,7 +2089,7 @@ public static function getService() { ), ), ), - // 配置存储桶(Bucket) 跨区域复制的方法. + // 配置存储桶(Bucket)跨区域复制 'PutBucketReplication' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?replication', @@ -2293,7 +2154,7 @@ public static function getService() { ), ), ), - // 设置存储桶(Bucket) 的回调设置的方法. + // 设置存储桶(Bucket)的回调设置 'PutBucketNotification' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?notification', @@ -2379,7 +2240,7 @@ public static function getService() { ), ), ), - // 配置存储桶(Bucket) 标签的方法. + // 配置存储桶(Bucket)标签 'PutBucketTagging' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?tagging', @@ -2420,7 +2281,7 @@ public static function getService() { ), ), ), - //开启存储桶(Bucket) 日志服务的方法. + //开启存储桶(Bucket)日志服务 'PutBucketLogging' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?logging', @@ -2455,7 +2316,7 @@ public static function getService() { ), ), ), - // 配置存储桶(Bucket) 清单的方法. + // 配置存储桶(Bucket)清单 'PutBucketInventory' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}?inventory', @@ -2554,7 +2415,7 @@ public static function getService() { ), ), ), - // 回热归档对象的方法. + // 回热归档对象 'RestoreObject' => array( 'httpMethod' => 'POST', 'uri' => '/{Bucket}{/Key*}?restore', @@ -2607,7 +2468,7 @@ public static function getService() { ), ), ), - // 查询存储桶(Bucket)中正在进行中的分块上传对象的方法. + // 查询存储桶(Bucket)中正在进行中的分块上传对象 'ListParts' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}{/Key*}', @@ -2646,7 +2507,7 @@ public static function getService() { ) ) ), - // 查询存储桶(Bucket) 下的部分或者全部对象的方法. + // 查询存储桶(Bucket)下的部分或者全部对象 'ListObjects' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}', @@ -2686,7 +2547,7 @@ public static function getService() { ) ) ), - // 获取所属账户的所有存储空间列表的方法. + // 获取所属账户的所有存储空间列表 'ListBuckets' => array( 'httpMethod' => 'GET', 'uri' => '/', @@ -2696,7 +2557,7 @@ public static function getService() { 'parameters' => array( ), ), - // 获取多版本对象的方法. + // 获取多版本对象 'ListObjectVersions' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?versions', @@ -2741,7 +2602,7 @@ public static function getService() { ) ), ), - // 获取已上传分块列表的方法 + // 获取已上传分块列表 'ListMultipartUploads' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?uploads', @@ -2786,7 +2647,7 @@ public static function getService() { ) ), ), - // 获取清单列表的方法. + // 获取清单列表 'ListBucketInventoryConfigurations' => array( 'httpMethod' => 'GET', 'uri' => '/{Bucket}?inventory', @@ -2806,7 +2667,7 @@ public static function getService() { ), ), ), - // 获取对象的meta信息的方法 + // 获取对象的meta信息 'HeadObject' => array( 'httpMethod' => 'HEAD', 'uri' => '/{Bucket}{/Key*}', @@ -2888,7 +2749,7 @@ public static function getService() { ), ) ), - // 存储桶(Bucket) 是否存在的方法. + // 存储桶(Bucket)是否存在 'HeadBucket' => array( 'httpMethod' => 'HEAD', 'uri' => '/{Bucket}', @@ -2903,7 +2764,7 @@ public static function getService() { ), ) ), - // 分块copy的方法. + // 分块copy 'UploadPartCopy' => array( 'httpMethod' => 'PUT', 'uri' => '/{Bucket}{/Key*}', @@ -3019,6 +2880,7 @@ public static function getService() { ) ), ), + // 检索对象内容 'SelectObjectContent' => array( 'httpMethod' => 'Post', 'uri' => '/{/Key*}?select&select-type=2', @@ -4222,7 +4084,6 @@ public static function getService() { ), ), ), - //设置对象标签 'PutObjectTaggingOutput' => array( 'type' => 'object', 'additionalProperties' => true, @@ -4233,7 +4094,6 @@ public static function getService() { ), ), ), - //查询对象标签 'GetObjectTaggingOutput' => array( 'type' => 'object', 'additionalProperties' => true, @@ -4260,7 +4120,6 @@ public static function getService() { ), ), ), - //删除对象标签 'DeleteObjectTaggingOutput' => array( 'type' => 'object', 'additionalProperties' => true, @@ -6957,7 +6816,6 @@ public static function getService() { ) ) ), - //设置防盗链 'PutBucketRefererOutput' => array( 'type' => 'object', 'additionalProperties' => true, @@ -6978,7 +6836,6 @@ public static function getService() { ) ) ), - //获取防盗链规则 'GetBucketRefererOutput' => array( 'type' => 'object', 'additionalProperties' => true,