Panda 3 months ago
parent
commit
2506e453ab
93 changed files with 30236 additions and 0 deletions
  1. 1 0
      addons/cos/.addonrc
  2. 158 0
      addons/cos/Cos.php
  3. 268 0
      addons/cos/bootstrap.js
  4. 257 0
      addons/cos/config.php
  5. 358 0
      addons/cos/controller/Index.php
  6. 10 0
      addons/cos/info.ini
  7. 37 0
      addons/cos/library/Auth.php
  8. 60 0
      addons/cos/library/Guzzle/command/CHANGELOG.md
  9. 23 0
      addons/cos/library/Guzzle/command/LICENSE
  10. 2 0
      addons/cos/library/Guzzle/command/Makefile
  11. 168 0
      addons/cos/library/Guzzle/command/README.md
  12. 50 0
      addons/cos/library/Guzzle/command/composer.json
  13. 23 0
      addons/cos/library/Guzzle/command/phpunit.xml.dist
  14. 55 0
      addons/cos/library/Guzzle/command/src/Command.php
  15. 39 0
      addons/cos/library/Guzzle/command/src/CommandInterface.php
  16. 7 0
      addons/cos/library/Guzzle/command/src/Exception/CommandClientException.php
  17. 109 0
      addons/cos/library/Guzzle/command/src/Exception/CommandException.php
  18. 7 0
      addons/cos/library/Guzzle/command/src/Exception/CommandServerException.php
  19. 66 0
      addons/cos/library/Guzzle/command/src/HasDataTrait.php
  20. 18 0
      addons/cos/library/Guzzle/command/src/Result.php
  21. 9 0
      addons/cos/library/Guzzle/command/src/ResultInterface.php
  22. 219 0
      addons/cos/library/Guzzle/command/src/ServiceClient.php
  23. 92 0
      addons/cos/library/Guzzle/command/src/ServiceClientInterface.php
  24. 16 0
      addons/cos/library/Guzzle/command/src/ToArrayInterface.php
  25. 363 0
      addons/cos/library/Guzzle/guzzle-services/CHANGELOG.md
  26. 23 0
      addons/cos/library/Guzzle/guzzle-services/LICENSE
  27. 2 0
      addons/cos/library/Guzzle/guzzle-services/Makefile
  28. 134 0
      addons/cos/library/Guzzle/guzzle-services/README.md
  29. 59 0
      addons/cos/library/Guzzle/guzzle-services/composer.json
  30. 23 0
      addons/cos/library/Guzzle/guzzle-services/phpunit.xml.dist
  31. 265 0
      addons/cos/library/Guzzle/guzzle-services/src/Description.php
  32. 107 0
      addons/cos/library/Guzzle/guzzle-services/src/DescriptionInterface.php
  33. 294 0
      addons/cos/library/Guzzle/guzzle-services/src/Deserializer.php
  34. 169 0
      addons/cos/library/Guzzle/guzzle-services/src/GuzzleClient.php
  35. 82 0
      addons/cos/library/Guzzle/guzzle-services/src/Handler/ValidatedDescriptionHandler.php
  36. 312 0
      addons/cos/library/Guzzle/guzzle-services/src/Operation.php
  37. 655 0
      addons/cos/library/Guzzle/guzzle-services/src/Parameter.php
  38. 13 0
      addons/cos/library/Guzzle/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php
  39. 33 0
      addons/cos/library/Guzzle/guzzle-services/src/QuerySerializer/Rfc3986Serializer.php
  40. 101 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/AbstractLocation.php
  41. 49 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/BodyLocation.php
  42. 83 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/FormParamLocation.php
  43. 67 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/HeaderLocation.php
  44. 86 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/JsonLocation.php
  45. 76 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/MultiPartLocation.php
  46. 92 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/QueryLocation.php
  47. 44 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/RequestLocationInterface.php
  48. 328 0
      addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/XmlLocation.php
  49. 69 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/AbstractLocation.php
  50. 39 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/BodyLocation.php
  51. 47 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/HeaderLocation.php
  52. 176 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/JsonLocation.php
  53. 41 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/ReasonPhraseLocation.php
  54. 61 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/ResponseLocationInterface.php
  55. 39 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/StatusCodeLocation.php
  56. 311 0
      addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/XmlLocation.php
  57. 141 0
      addons/cos/library/Guzzle/guzzle-services/src/SchemaFormatter.php
  58. 297 0
      addons/cos/library/Guzzle/guzzle-services/src/SchemaValidator.php
  59. 166 0
      addons/cos/library/Guzzle/guzzle-services/src/Serializer.php
  60. 37 0
      addons/cos/library/Guzzle/uri-template/CHANGELOG.md
  61. 23 0
      addons/cos/library/Guzzle/uri-template/LICENSE
  62. 33 0
      addons/cos/library/Guzzle/uri-template/README.md
  63. 71 0
      addons/cos/library/Guzzle/uri-template/composer.json
  64. 297 0
      addons/cos/library/Guzzle/uri-template/src/UriTemplate.php
  65. 569 0
      addons/cos/library/Qcloud/Cos/Client.php
  66. 370 0
      addons/cos/library/Qcloud/Cos/CommandToRequestTransformer.php
  67. 69 0
      addons/cos/library/Qcloud/Cos/Common.php
  68. 140 0
      addons/cos/library/Qcloud/Cos/Copy.php
  69. 11918 0
      addons/cos/library/Qcloud/Cos/Descriptions.php
  70. 5 0
      addons/cos/library/Qcloud/Cos/Exception/CosException.php
  71. 189 0
      addons/cos/library/Qcloud/Cos/Exception/ServiceResponseException.php
  72. 71 0
      addons/cos/library/Qcloud/Cos/ExceptionMiddleware.php
  73. 112 0
      addons/cos/library/Qcloud/Cos/ExceptionParser.php
  74. 87 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/BlindWatermarkTemplate.php
  75. 39 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/CIParamTransformation.php
  76. 31 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/CIProcessTransformation.php
  77. 374 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageMogrTemplate.php
  78. 37 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageQrcodeTemplate.php
  79. 33 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageStyleTemplate.php
  80. 18 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageTemplate.php
  81. 115 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageViewTemplate.php
  82. 212 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageWatermarkTemplate.php
  83. 64 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/PicOperationsTransformation.php
  84. 180 0
      addons/cos/library/Qcloud/Cos/ImageParamTemplate/TextWatermarkTemplate.php
  85. 167 0
      addons/cos/library/Qcloud/Cos/MultipartUpload.php
  86. 145 0
      addons/cos/library/Qcloud/Cos/RangeDownload.php
  87. 49 0
      addons/cos/library/Qcloud/Cos/Request/BodyLocation.php
  88. 260 0
      addons/cos/library/Qcloud/Cos/ResultTransformer.php
  89. 81 0
      addons/cos/library/Qcloud/Cos/Serializer.php
  90. 7387 0
      addons/cos/library/Qcloud/Cos/Service.php
  91. 131 0
      addons/cos/library/Qcloud/Cos/Signature.php
  92. 23 0
      addons/cos/library/Qcloud/Cos/SignatureMiddleware.php
  93. 0 0
      public/assets/addons/cos/js/spark.js

+ 1 - 0
addons/cos/.addonrc

@@ -0,0 +1 @@
+{"files":["public\\assets\\addons\\cos\\js\\spark.js"],"license":"regular","licenseto":"19079","licensekey":"oXPFTucLhJUKGdYz EgT7OutdDlLC0XePaRNezA==","domains":["xiaoshan123.com"],"licensecodes":[],"validations":["88b06a55b4fb30f5170ad6b82d158050"]}

+ 158 - 0
addons/cos/Cos.php

@@ -0,0 +1,158 @@
+<?php
+
+namespace addons\cos;
+
+use addons\cos\library\Auth;
+use app\common\library\Menu;
+use fast\Http;
+use Qcloud\Cos\Client;
+use think\Addons;
+use think\App;
+use think\Loader;
+
+/**
+ * COS插件
+ */
+class Cos extends Addons
+{
+
+    /**
+     * 插件安装方法
+     * @return bool
+     */
+    public function install()
+    {
+
+        return true;
+    }
+
+    /**
+     * 插件卸载方法
+     * @return bool
+     */
+    public function uninstall()
+    {
+
+        return true;
+    }
+
+    /**
+     * 插件启用方法
+     * @return bool
+     */
+    public function enable()
+    {
+
+        return true;
+    }
+
+    /**
+     * 插件禁用方法
+     * @return bool
+     */
+    public function disable()
+    {
+
+        return true;
+    }
+
+    /**
+     * 渲染命名空间配置信息
+     */
+    public function appInit()
+    {
+        if (!class_exists('\Qcloud\Cos\Client')) {
+            Loader::addNamespace('Qcloud\Cos', $this->addons_path . str_replace('/', DS, 'library/Qcloud/Cos/'));
+        }
+        if (!class_exists('\GuzzleHttp\Command\Command')) {
+            Loader::addNamespace('GuzzleHttp\Command', $this->addons_path . str_replace('/', DS, 'library/Guzzle/command/src/'));
+        }
+        if (!class_exists('\GuzzleHttp\Command\Guzzle\Description')) {
+            Loader::addNamespace('GuzzleHttp\Command\Guzzle', $this->addons_path . str_replace('/', DS, 'library/Guzzle/guzzle-services/src/'));
+        }
+        if (!class_exists('\GuzzleHttp\UriTemplate\UriTemplate')) {
+            Loader::addNamespace('GuzzleHttp\UriTemplate', $this->addons_path . str_replace('/', DS, 'library/Guzzle/uri-template/src/'));
+        }
+
+    }
+
+    /**
+     * 判断是否来源于API上传
+     */
+    public function moduleInit($request)
+    {
+        $config = $this->getConfig();
+        $module = strtolower($request->module());
+        if ($module == 'api' && ($config['apiupload'] ?? 0) &&
+            strtolower($request->controller()) == 'common' &&
+            strtolower($request->action()) == 'upload') {
+            request()->param('isApi', true);
+            App::invokeMethod(["\\addons\\cos\\controller\\Index", "upload"], ['isApi' => true]);
+        }
+    }
+
+    /**
+     *
+     */
+    public function uploadConfigInit(&$upload)
+    {
+        $config = $this->getConfig();
+        $module = request()->module();
+        $module = $module ? strtolower($module) : 'index';
+
+        $data = ['deadline' => time() + $config['expire']];
+        $signature = hash_hmac('sha1', json_encode($data), $config['secretKey'], true);
+
+        $token = '';
+        if (Auth::isModuleAllow()) {
+            $token = $config['appId'] . ':' . base64_encode($signature) . ':' . base64_encode(json_encode($data));
+        }
+        $multipart = [
+            'costoken' => $token
+        ];
+
+        $upload = array_merge($upload, [
+            'cdnurl'     => $config['cdnurl'],
+            'uploadurl'  => $config['uploadmode'] == 'client' ? $config['uploadurl'] : addon_url('cos/index/upload', [], false, true),
+            'uploadmode' => $config['uploadmode'],
+            'bucket'     => $config['bucket'],
+            'maxsize'    => $config['maxsize'],
+            'mimetype'   => $config['mimetype'],
+            'savekey'    => $config['savekey'],
+            'chunking'   => (bool)($config['chunking'] ?? $upload['chunking']),
+            'chunksize'  => (int)($config['chunksize'] ?? $upload['chunksize']),
+            'multipart'  => $multipart,
+            'storage'    => $this->getName(),
+            'multiple'   => (bool)$config['multiple'],
+        ]);
+    }
+
+    /**
+     * 附件删除后
+     */
+    public function uploadDelete($attachment)
+    {
+        $config = $this->getConfig();
+        if ($attachment['storage'] == 'cos' && isset($config['syncdelete']) && $config['syncdelete']) {
+            $cosConfig = array(
+                'region'      => $config['region'],
+                'schema'      => 'https', //协议头部,默认为http
+                'credentials' => array(
+                    'secretId'  => $config['secretId'],
+                    'secretKey' => $config['secretKey']
+                )
+            );
+            $oss = new Client($cosConfig);
+            $ret = $oss->deleteObject(array('Bucket' => $config['bucket'], 'Key' => ltrim($attachment->url, '/')));
+
+            //如果是服务端中转,还需要删除本地文件
+            //if ($config['uploadmode'] == 'server') {
+            //    $filePath = ROOT_PATH . 'public' . str_replace('/', DS, $attachment->url);
+            //    if ($filePath) {
+            //        @unlink($filePath);
+            //    }
+            //}
+        }
+        return true;
+    }
+}

+ 268 - 0
addons/cos/bootstrap.js

@@ -0,0 +1,268 @@
+if (typeof Config.upload.storage !== 'undefined' && Config.upload.storage === 'cos') {
+    require(['upload'], function (Upload) {
+        //获取文件MD5值
+        var getFileMd5 = function (file, cb) {
+            //如果savekey中未检测到md5,则无需获取文件md5,直接返回upload的uuid
+            if (!Config.upload.savekey.match(/\{(file)?md5\}/)) {
+                cb && cb(file.upload.uuid);
+                return;
+            }
+            require(['../addons/cos/js/spark'], function (SparkMD5) {
+                var blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice,
+                    chunkSize = 10 * 1024 * 1024,
+                    chunks = Math.ceil(file.size / chunkSize),
+                    currentChunk = 0,
+                    spark = new SparkMD5.ArrayBuffer(),
+                    fileReader = new FileReader();
+
+                fileReader.onload = function (e) {
+                    spark.append(e.target.result);
+                    currentChunk++;
+                    if (currentChunk < chunks) {
+                        loadNext();
+                    } else {
+                        cb && cb(spark.end());
+                    }
+                };
+
+                fileReader.onerror = function () {
+                    console.warn('文件读取错误');
+                };
+
+                function loadNext() {
+                    var start = currentChunk * chunkSize,
+                        end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize;
+
+                    fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
+                }
+
+                loadNext();
+            });
+        };
+
+        var _onInit = Upload.events.onInit;
+        //初始化中完成判断
+        Upload.events.onInit = function () {
+            _onInit.apply(this, Array.prototype.slice.apply(arguments));
+            //如果上传接口不是COS,则不处理
+            if (this.options.url !== Config.upload.uploadurl) {
+                return;
+            }
+            $.extend(this.options, {
+                //关闭自动处理队列功能
+                autoQueue: false,
+                params: function (files, xhr, chunk) {
+                    var params = Config.upload.multipart;
+                    if (chunk) {
+                        return $.extend({}, params, {
+                            filesize: chunk.file.size,
+                            filename: chunk.file.name,
+                            chunkid: chunk.file.upload.uuid,
+                            chunkindex: chunk.index,
+                            chunkcount: chunk.file.upload.totalChunkCount,
+                            chunkfilesize: chunk.dataBlock.data.size,
+                            chunksize: this.options.chunkSize,
+                            width: chunk.file.width || 0,
+                            height: chunk.file.height || 0,
+                            type: chunk.file.type,
+                            uploadId: chunk.file.uploadId,
+                            key: chunk.file.key,
+                        });
+                    } else {
+                        params = $.extend({}, params, files[0].params);
+                        params.category = files[0].category || '';
+                    }
+                    return params;
+                },
+                chunkSuccess: function (chunk, file, response) {
+                    var etag = chunk.xhr.getResponseHeader("ETag").replace(/(^")|("$)/g, '');
+                    file.etags = file.etags ? file.etags : [];
+                    file.etags[chunk.index] = etag;
+                },
+                chunksUploaded: function (file, done) {
+                    var that = this;
+
+                    Fast.api.ajax({
+                        url: "/addons/cos/index/upload",
+                        data: {
+                            action: 'merge',
+                            filesize: file.size,
+                            filename: file.name,
+                            chunkid: file.upload.uuid,
+                            chunkcount: file.upload.totalChunkCount,
+                            md5: file.md5,
+                            key: file.key,
+                            uploadId: file.uploadId,
+                            etags: file.etags,
+                            category: file.category || '',
+                            costoken: Config.upload.multipart.costoken,
+                        },
+                    }, function (data, ret) {
+                        done(JSON.stringify(ret));
+                        return false;
+                    }, function (data, ret) {
+                        file.accepted = false;
+                        that._errorProcessing([file], ret.msg);
+                        return false;
+                    });
+
+                },
+            });
+
+            var _success = this.options.success;
+            //先移除已有的事件
+            this.off("success", _success).on("success", function (file, response) {
+                var ret = {code: 0, msg: response};
+                try {
+                    if (response) {
+                        ret = typeof response === 'string' ? JSON.parse(response) : response;
+                    }
+                    if (file.xhr.status === 200 || file.xhr.status === 204) {
+                        if (Config.upload.uploadmode === 'client') {
+                            ret = {code: 1, data: {url: '/' + file.key}};
+                        }
+
+                        if (ret.code == 1) {
+                            var url = ret.data.url || '';
+                            Fast.api.ajax({
+                                url: "/addons/cos/index/notify",
+                                data: {name: file.name, url: url, md5: file.md5, size: file.size, width: file.width || 0, height: file.height || 0, type: file.type, category: file.category || '', costoken: Config.upload.multipart.costoken}
+                            }, function () {
+                                return false;
+                            }, function () {
+                                return false;
+                            });
+                        } else {
+                            console.error(ret);
+                        }
+                    } else {
+                        console.error(file.xhr);
+                    }
+                } catch (e) {
+                    console.error(e);
+                }
+                _success.call(this, file, ret);
+            });
+
+            this.on("addedfile", function (file) {
+                var that = this;
+                setTimeout(function () {
+                    if (file.status === 'error') {
+                        return;
+                    }
+                    getFileMd5(file, function (md5) {
+                        var chunk = that.options.chunking && file.size > that.options.chunkSize ? 1 : 0;
+                        var params = $(that.element).data("params") || {};
+                        var category = typeof params.category !== 'undefined' ? params.category : ($(that.element).data("category") || '');
+                        category = typeof category === 'function' ? category.call(that, file) : category;
+                        Fast.api.ajax({
+                            url: "/addons/cos/index/params",
+                            data: {method: 'POST', category: category, md5: md5, name: file.name, type: file.type, size: file.size, chunk: chunk, chunksize: that.options.chunkSize, costoken: Config.upload.multipart.costoken},
+                        }, function (data) {
+                            file.md5 = md5;
+                            file.id = data.id;
+                            file.key = data.key;
+                            file.date = data.date;
+                            file.uploadId = data.uploadId;
+                            file.policy = data.policy;
+                            file.signature = data.signature;
+                            file.partsAuthorization = data.partsAuthorization;
+                            file.params = data;
+                            file.category = category;
+
+                            if (file.status != 'error') {
+                                //开始上传
+                                that.enqueueFile(file);
+                            } else {
+                                that.removeFile(file);
+                            }
+                            return false;
+                        }, function () {
+                            that.removeFile(file);
+                        });
+                    });
+                }, 0);
+            });
+
+
+            if (Config.upload.uploadmode === 'client') {
+                var _method = this.options.method;
+                var _url = this.options.url;
+                this.options.method = function (files) {
+                    if (files[0].upload.chunked) {
+                        var chunk = null;
+                        files[0].upload.chunks.forEach(function (item) {
+                            if (item.status === 'uploading') {
+                                chunk = item;
+                            }
+                        });
+                        if (!chunk) {
+                            return "POST";
+                        } else {
+                            return "PUT";
+                        }
+                    }
+                    return _method;
+                };
+                this.options.url = function (files) {
+                    if (files[0].upload.chunked) {
+                        var chunk = null;
+                        files[0].upload.chunks.forEach(function (item) {
+                            if (item.status === 'uploading') {
+                                chunk = item;
+                            }
+                        });
+                        var index = chunk.dataBlock.chunkIndex;
+                        // debugger;
+                        this.options.headers = {"Authorization": files[0]['partsAuthorization'][index], "x-date": files[0]['date']};
+                        if (!chunk) {
+                            return Config.upload.uploadurl + "/" + files[0].key + "?uploadId=" + files[0].uploadId;
+                        } else {
+                            return Config.upload.uploadurl + "/" + files[0].key + "?partNumber=" + (index + 1) + "&uploadId=" + files[0].uploadId;
+                        }
+                    }
+                    return _url;
+                };
+                this.options.params = function (files, xhr, chunk) {
+                    var params = Config.upload.multipart;
+                    if (chunk) {
+                        return $.extend({}, params, {
+                            filesize: chunk.file.size,
+                            filename: chunk.file.name,
+                            chunkid: chunk.file.upload.uuid,
+                            chunkindex: chunk.index,
+                            chunkcount: chunk.file.upload.totalChunkCount,
+                            chunkfilesize: chunk.dataBlock.data.size,
+                            width: chunk.file.width || 0,
+                            height: chunk.file.height || 0,
+                            type: chunk.file.type,
+                        });
+                    } else {
+                        var retParams = $.extend({}, params, files[0].params || {});
+                        delete retParams.costoken;
+                        return retParams;
+                    }
+                };
+                this.on("sending", function (file, xhr, formData) {
+                    var that = this;
+                    if (file.upload.chunked) {
+                        var _send = xhr.send;
+                        xhr.send = function () {
+                            var chunk = null;
+                            file.upload.chunks.forEach(function (item) {
+                                if (item.status == 'uploading') {
+                                    chunk = item;
+                                }
+                            });
+                            if (chunk) {
+                                _send.call(xhr, chunk.dataBlock.data);
+                            }
+                        };
+                    } else {
+
+                    }
+                });
+            }
+        };
+    });
+}

+ 257 - 0
addons/cos/config.php

@@ -0,0 +1,257 @@
+<?php
+
+return [
+    [
+        'name' => 'appId',
+        'title' => 'AppID',
+        'type' => 'string',
+        'content' => [],
+        'value' => '1331914430',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '请前往腾讯控制台 > 访问管理 > API密钥',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'secretId',
+        'title' => 'SecretId',
+        'type' => 'string',
+        'content' => [],
+        'value' => 'AKIDdBnCSdgZIrFPK8JSf27ygGk4A8vVhjcG',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '请前往腾讯控制台 > 访问管理 > API密钥',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'secretKey',
+        'title' => 'SecretKey',
+        'type' => 'string',
+        'content' => [],
+        'value' => 'd7RyMYvqLxgQ4umUiwANQFtLaaM2Yszs',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '请前往腾讯控制台 > 访问管理 > API密钥',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'bucket',
+        'title' => '存储桶名称',
+        'type' => 'string',
+        'content' => [],
+        'value' => 'xiaoshan-1331914430',
+        'rule' => 'required;bucket',
+        'msg' => '',
+        'tip' => '存储空间名称',
+        'ok' => '',
+        'extend' => 'data-rule-bucket="[/^[0-9a-z_\\-]{3,63}$/, \'请输入正确的存储桶名称\']"',
+    ],
+    [
+        'name' => 'region',
+        'title' => '地域名称',
+        'type' => 'string',
+        'content' => [],
+        'value' => 'ap-beijing',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '请输入地域简称,请注意使用英文',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'uploadmode',
+        'title' => '上传模式',
+        'type' => 'select',
+        'content' => [
+            'client' => '客户端直传(速度快,无备份)',
+            'server' => '服务器中转(占用服务器带宽,有备份)',
+        ],
+        'value' => 'client',
+        'rule' => '',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'serverbackup',
+        'title' => '服务器中转模式备份',
+        'type' => 'radio',
+        'content' => [
+            1 => '备份(附件管理将产生2条记录)',
+            0 => '不备份',
+        ],
+        'value' => '0',
+        'rule' => '',
+        'msg' => '',
+        'tip' => '服务器中转模式下是否备份文件',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'uploadurl',
+        'title' => '上传接口地址',
+        'type' => 'string',
+        'content' => [],
+        'value' => 'https://xiaoshan-1331914430.cos.ap-beijing.myqcloud.com',
+        'rule' => 'required;uploadurl',
+        'msg' => '',
+        'tip' => '请输入你的上传接口地址',
+        'ok' => '',
+        'extend' => 'data-rule-uploadurl="[/^http(s)?:\\/\\/.*$/, \'必需以http(s)://开头\']"',
+    ],
+    [
+        'name' => 'cdnurl',
+        'title' => 'CDN地址',
+        'type' => 'string',
+        'content' => [],
+        'value' => 'https://xiaoshan-1331914430.cos.ap-beijing.myqcloud.com',
+        'rule' => 'required;cdnurl',
+        'msg' => '',
+        'tip' => '请配置你的CDN地址或在存储桶基础配置中获取',
+        'ok' => '',
+        'extend' => 'data-rule-cdnurl="[/^http(s)?:\\/\\/.*$/, \'必需以http(s)://开头\']"',
+    ],
+    [
+        'name' => 'savekey',
+        'title' => '保存文件名',
+        'type' => 'string',
+        'content' => [],
+        'value' => '/uploads/{year}{mon}{day}/{filemd5}{.suffix}',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'expire',
+        'title' => '上传有效时长',
+        'type' => 'string',
+        'content' => [],
+        'value' => '600',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '用户停留页面上传有效时长,单位秒',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'maxsize',
+        'title' => '最大可上传',
+        'type' => 'string',
+        'content' => [],
+        'value' => '10M',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'mimetype',
+        'title' => '可上传后缀格式',
+        'type' => 'string',
+        'content' => [],
+        'value' => 'jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx,mp4,mp3,wav',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'multiple',
+        'title' => '多文件上传',
+        'type' => 'bool',
+        'content' => [],
+        'value' => '0',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'thumbstyle',
+        'title' => '缩略图样式',
+        'type' => 'string',
+        'content' => [],
+        'value' => '',
+        'rule' => '',
+        'msg' => '',
+        'tip' => '用于后台列表缩略图样式,可使用:?imageMogr2/thumbnail/120x90',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'chunking',
+        'title' => '分片上传',
+        'type' => 'radio',
+        'content' => [
+            1 => '开启',
+            0 => '关闭',
+        ],
+        'value' => '0',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'chunksize',
+        'title' => '分片大小',
+        'type' => 'number',
+        'content' => [],
+        'value' => '4194304',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'syncdelete',
+        'title' => '附件删除时是否同步删除云存储文件',
+        'type' => 'bool',
+        'content' => [],
+        'value' => '0',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'apiupload',
+        'title' => 'API接口使用云存储',
+        'type' => 'bool',
+        'content' => [],
+        'value' => '0',
+        'rule' => 'required',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+    [
+        'name' => 'noneedlogin',
+        'title' => '免登录上传',
+        'type' => 'checkbox',
+        'content' => [
+            'api' => 'API',
+            'index' => '前台',
+            'admin' => '后台',
+        ],
+        'value' => 'api',
+        'rule' => '',
+        'msg' => '',
+        'tip' => '',
+        'ok' => '',
+        'extend' => '',
+    ],
+];

+ 358 - 0
addons/cos/controller/Index.php

@@ -0,0 +1,358 @@
+<?php
+
+namespace addons\cos\controller;
+
+use addons\cos\library\Auth;
+use app\common\exception\UploadException;
+use app\common\library\Upload;
+use app\common\model\Attachment;
+use Qcloud\Cos\Client;
+use Qcloud\Cos\Signature;
+use think\addons\Controller;
+use think\Config;
+
+/**
+ * COS云储存
+ *
+ */
+class Index extends Controller
+{
+    protected $cosConfig = [];
+
+    public function _initialize()
+    {
+        //跨域检测
+        check_cors_request();
+
+        parent::_initialize();
+        Config::set('default_return_type', 'json');
+
+        $config = get_addon_config('cos');
+        $this->cosConfig = array(
+            'region'      => $config['region'],
+            'schema'      => 'https', //协议头部,默认为http
+            'credentials' => array(
+                'secretId'  => $config['secretId'],
+                'secretKey' => $config['secretKey']
+            )
+        );
+    }
+
+    public function index()
+    {
+        Config::set('default_return_type', 'html');
+        $this->error("当前插件暂无前台页面");
+    }
+
+    public function params()
+    {
+        $this->check();
+
+        $config = get_addon_config('cos');
+        $name = $this->request->post('name');
+        $md5 = $this->request->post('md5');
+        $chunk = $this->request->post('chunk');
+
+        $key = (new Upload())->getSavekey($config['savekey'], $name, $md5);
+        $key = ltrim($key, "/");
+        $params = [
+            'key' => $key,
+            'md5' => $md5
+        ];
+        if ($chunk) {
+            $fileSize = $this->request->post('size');
+            $oss = new Client($this->cosConfig);
+
+            $result = $oss->createMultipartUpload(array(
+                'Bucket' => $config['bucket'],
+                'Key'    => $key,
+            ));
+            $uploadId = $result['UploadId'];
+
+            $sig = new Signature($config['secretId'], $config['secretKey'], ['signHost' => true]);
+
+            $partSize = $this->request->post("chunksize");
+            $i = 0;
+            $size_count = $fileSize;
+            $values = array();
+            while ($size_count > 0) {
+                $size_count -= $partSize;
+                $values[] = array(
+                    $partSize * $i,
+                    ($size_count > 0) ? $partSize : ($size_count + $partSize),
+                );
+                $i++;
+            }
+
+            $params['key'] = $key;
+            $params['uploadId'] = $uploadId;
+            $params['partsAuthorization'] = [];
+            $date = gmdate('D, d M Y H:i:s \G\M\T');
+            foreach ($values as $index => $part) {
+                $partNumber = $index + 1;
+                $options = array(
+                    'Bucket'     => $config['bucket'],
+                    'Key'        => $key,
+                    'UploadId'   => $uploadId,
+                    'PartNumber' => $partNumber,
+                    'Body'       => ''
+                );
+                $command = $oss->getCommand('uploadPart', $options);
+                $request = $oss->commandToRequestTransformer($command);
+                $authorization = $sig->createAuthorization($request);
+
+                $params['partsAuthorization'][$index] = $authorization;
+            }
+            $params['date'] = $date;
+        } else {
+            if ($config['uploadmode'] == 'client') {
+                $expiretime = time() + $config['expire'];
+                $expiration = gmdate("Y-m-d\TH:i:s.414\Z", $expiretime);
+                $keytime = (time() - 60) . ';' . $expiretime;
+                $policy = json_encode([
+                    'expiration' => $expiration,
+                    'conditions' => [
+                        ['q-sign-algorithm' => 'sha1'],
+                        ['q-ak' => $config['secretId']],
+                        ['q-sign-time' => $keytime]
+                    ]
+                ]);
+                $signature = hash_hmac('sha1', sha1($policy), hash_hmac('sha1', $keytime, $config['secretKey']));
+                $params = [
+                    'key'              => $key,
+                    'policy'           => base64_encode($policy),
+                    'q-sign-algorithm' => 'sha1',
+                    'q-ak'             => $config['secretId'],
+                    'q-key-time'       => $keytime,
+                    'q-sign-time'      => $keytime,
+                    'q-signature'      => $signature
+                ];
+            }
+        }
+
+        $this->success('', null, $params);
+        return;
+    }
+
+    /**
+     * 服务器中转上传文件
+     * 上传分片
+     * 合并分片
+     * @param bool $isApi
+     */
+    public function upload($isApi = false)
+    {
+        if ($isApi === true) {
+            if (!Auth::isModuleAllow()) {
+                $this->error("请登录后再进行操作");
+            }
+        } else {
+            $this->check();
+        }
+        $config = get_addon_config('cos');
+        $oss = new Client($this->cosConfig);
+
+        //检测删除文件或附件
+        $checkDeleteFile = function ($attachment, $upload, $force = false) use ($config) {
+            //如果设定为不备份则删除文件和记录 或 强制删除
+            if ((isset($config['serverbackup']) && !$config['serverbackup']) || $force) {
+                if ($attachment && !empty($attachment['id'])) {
+                    $attachment->delete();
+                }
+                if ($upload) {
+                    //文件绝对路径
+                    $filePath = $upload->getFile()->getRealPath() ?: $upload->getFile()->getPathname();
+                    @unlink($filePath);
+                }
+            }
+        };
+
+        $chunkid = $this->request->post("chunkid");
+        if ($chunkid) {
+            $action = $this->request->post("action");
+            $chunkindex = $this->request->post("chunkindex/d");
+            $chunkcount = $this->request->post("chunkcount/d");
+            $filesize = $this->request->post("filesize");
+            $filename = $this->request->post("filename");
+            $method = $this->request->method(true);
+            $key = $this->request->post("key");
+            $uploadId = $this->request->post("uploadId");
+
+            if ($action == 'merge') {
+                $attachment = null;
+                $upload = null;
+                //合并分片
+                if ($config['uploadmode'] == 'server') {
+                    //合并分片文件
+                    try {
+                        $upload = new Upload();
+                        $attachment = $upload->merge($chunkid, $chunkcount, $filename);
+                    } catch (UploadException $e) {
+                        $this->error($e->getMessage());
+                    }
+                }
+
+                $etags = $this->request->post("etags/a", []);
+                if (count($etags) != $chunkcount) {
+                    $checkDeleteFile($attachment, $upload, true);
+                    $this->error("分片数据错误");
+                }
+                $listParts = [];
+                for ($i = 0; $i < $chunkcount; $i++) {
+                    $listParts[] = array("PartNumber" => $i + 1, "ETag" => $etags[$i]);
+                }
+                try {
+                    $result = $oss->completeMultipartUpload(
+                        array(
+                            'Bucket'   => $config['bucket'],
+                            'Key'      => $key,
+                            'UploadId' => $uploadId,
+                            'Parts'    => $listParts
+                        )
+                    );
+                } catch (\Exception $e) {
+                    $checkDeleteFile($attachment, $upload, true);
+                    $this->error($e->getMessage());
+                }
+
+                if (!isset($result['Key'])) {
+                    $checkDeleteFile($attachment, $upload, true);
+                    $this->error("上传失败");
+                } else {
+                    $checkDeleteFile($attachment, $upload);
+                    $this->success("上传成功", '', ['url' => "/" . $key, 'fullurl' => cdnurl("/" . $key, true)]);
+                }
+            } else {
+                //默认普通上传文件
+                $file = $this->request->file('file');
+                try {
+                    $upload = new Upload($file);
+                    $file = $upload->chunk($chunkid, $chunkindex, $chunkcount);
+                } catch (UploadException $e) {
+                    $this->error($e->getMessage());
+                }
+                try {
+                    $params = array(
+                        'Bucket'     => $config['bucket'],
+                        'Key'        => $key,
+                        'UploadId'   => $uploadId,
+                        'PartNumber' => $chunkindex + 1,
+                        'Body'       => $file->fread($file->getSize())
+                    );
+                    $ret = $oss->uploadPart($params);
+                    $etag = $ret['ETag'];
+                } catch (\Exception $e) {
+                    $this->error($e->getMessage());
+                }
+
+                $this->success("上传成功", "", [], 3, ['ETag' => $etag]);
+            }
+        } else {
+            $attachment = null;
+            //默认普通上传文件
+            $file = $this->request->file('file');
+            try {
+                $upload = new Upload($file);
+                $attachment = $upload->upload();
+            } catch (UploadException $e) {
+                $this->error($e->getMessage());
+            }
+
+            //文件绝对路径
+            $filePath = $upload->getFile()->getRealPath() ?: $upload->getFile()->getPathname();
+
+            $url = $attachment->url;
+
+            try {
+                $ret = $oss->upload($config['bucket'], ltrim($attachment->url, "/"), $upload->getFile());
+                //成功不做任何操作
+            } catch (\Exception $e) {
+                $checkDeleteFile($attachment, $upload, true);
+                $this->error("上传失败");
+            }
+            $checkDeleteFile($attachment, $upload);
+
+            // 记录云存储记录
+            $data = $attachment->toArray();
+            unset($data['id']);
+            $data['storage'] = 'cos';
+            Attachment::create($data, true);
+
+            $this->success("上传成功", '', ['url' => $url, 'fullurl' => cdnurl($url, true)]);
+        }
+        return;
+    }
+
+    /**
+     * 回调
+     */
+    public function notify()
+    {
+        $this->check();
+        $config = get_addon_config('cos');
+        if ($config['uploadmode'] != 'client') {
+            $this->error("无需执行该操作");
+        }
+        $this->request->filter('trim,strip_tags,htmlspecialchars,xss_clean');
+
+        $size = $this->request->post('size/d');
+        $name = $this->request->post('name', '');
+        $md5 = $this->request->post('md5', '');
+        $type = $this->request->post('type', '');
+        $url = $this->request->post('url', '');
+        $width = $this->request->post('width/d');
+        $height = $this->request->post('height/d');
+        $category = $this->request->post('category', '');
+        $category = array_key_exists($category, config('site.attachmentcategory') ?? []) ? $category : '';
+        $suffix = strtolower(pathinfo($name, PATHINFO_EXTENSION));
+        $suffix = $suffix && preg_match("/^[a-zA-Z0-9]+$/", $suffix) ? $suffix : 'file';
+        $attachment = Attachment::where('url', $url)->where('storage', 'cos')->find();
+        if (!$attachment) {
+            $params = array(
+                'category'    => $category,
+                'admin_id'    => (int)session('admin.id'),
+                'user_id'     => (int)cookie('uid'),
+                'filesize'    => $size,
+                'filename'    => $name,
+                'imagewidth'  => $width,
+                'imageheight' => $height,
+                'imagetype'   => $suffix,
+                'imageframes' => 0,
+                'mimetype'    => $type,
+                'url'         => $url,
+                'uploadtime'  => time(),
+                'storage'     => 'cos',
+                'sha1'        => $md5,
+            );
+            Attachment::create($params, true);
+        }
+        $this->success();
+        return;
+    }
+
+    /**
+     * 检查签名是否正确或过期
+     */
+    protected function check()
+    {
+        $costoken = $this->request->post('costoken', '', 'trim');
+        if (!$costoken) {
+            $this->error("参数不正确(code:1)");
+        }
+        $config = get_addon_config('cos');
+        list($appId, $sign, $data) = explode(':', $costoken);
+        if (!$appId || !$sign || !$data) {
+            $this->error("参数不正确(code:2)");
+        }
+        if ($appId !== $config['appId']) {
+            $this->error("参数不正确(code:3)");
+        }
+        if ($sign !== base64_encode(hash_hmac('sha1', base64_decode($data), $config['secretKey'], true))) {
+            $this->error("签名不正确");
+        }
+        $json = json_decode(base64_decode($data), true);
+        if ($json['deadline'] < time()) {
+            $this->error("请求已经超时");
+        }
+    }
+}

+ 10 - 0
addons/cos/info.ini

@@ -0,0 +1,10 @@
+name = cos
+title = 腾讯COS云存储
+intro = 使用腾讯COS云存储作为默认云储存
+author = FastAdmin
+website = https://www.fastadmin.net
+version = 1.2.8
+state = 1
+url = /addons/cos
+license = regular
+licenseto = 19079

+ 37 - 0
addons/cos/library/Auth.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace addons\cos\library;
+
+class Auth
+{
+
+    public function __construct()
+    {
+
+    }
+
+    public static function isModuleAllow()
+    {
+        $config = get_addon_config('cos');
+        $module = request()->module();
+        $module = $module ? strtolower($module) : 'index';
+        $noNeedLogin = array_filter(explode(',', $config['noneedlogin'] ?? ''));
+        $isModuleLogin = false;
+        $tagName = 'upload_config_checklogin';
+        foreach (\think\Hook::get($tagName) as $index => $name) {
+            if (\think\Hook::exec($name, $tagName)) {
+                $isModuleLogin = true;
+                break;
+            }
+        }
+        if (in_array($module, $noNeedLogin)
+            || ($module == 'admin' && \app\admin\library\Auth::instance()->id)
+            || ($module != 'admin' && \app\common\library\Auth::instance()->id)
+            || $isModuleLogin) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+}

+ 60 - 0
addons/cos/library/Guzzle/command/CHANGELOG.md

@@ -0,0 +1,60 @@
+# CHANGELOG
+
+## 1.0.0 - 2016-11-24
+
+* Add badges to README.md
+* Switch README from .rst to .md format 
+* Update dependencies
+* Add command to handler call to provide support for GuzzleServices
+
+## 0.9.0 - 2016-01-30
+
+* Updated to use Guzzle 6 and PSR-7.
+* Event system has been replaced with a middleware system
+    * Middleware at the command layer work the same as middleware from the
+      HTTP layer, but work with `Command` and `Result` objects instead of
+      `Request` and `Response` objects
+    * The command middleware is in a separate `HandlerStack` instance than the
+      HTTP middleware.
+* `Result` objects are the result of executing a `Command` and are used to hold
+  the parsed response data.
+* Asynchronous code now uses the `guzzlehttp/promises` package instead of 
+  `guzzlehttp/ringphp`, which means that asynchronous results are implemented
+  as Promises/A+ compliant `Promise` objects, instead of futures.
+* The existing `Subscriber`s were removed.
+* The `ServiceClientInterface` and `ServiceClient` class now provide the basic
+  foundation of a web service client.
+
+## 0.8.0 - 2015-02-02
+
+* Removed `setConfig` from `ServiceClientInterface`.
+* Added `initTransaction` to `ServiceClientInterface`.
+
+## 0.7.1 - 2015-01-14
+
+* Fixed and issue where intercepting commands encapsulated by a
+  CommandToRequestIterator could lead to deep recursion. These commands are
+  now skipped and the iterator moves to the next element using a `goto`
+  statement.
+
+## 0.7.0 - 2014-10-12
+
+* Updated to use Guzzle 5, and added support for asynchronous results.
+* Renamed `prepare` event to `prepared`.
+* Added `init` event.
+
+## 0.6.0 - 2014-08-08
+
+* Added a Debug subscriber that can be used to trace through the lifecycle of
+  a command and how it is modified in each event.
+
+## 0.5.0 - 2014-08-01
+
+* Rewrote event system so that all exceptions encountered during the transfer
+  of a command are emitted to the "error" event.
+* No longer wrapping exceptions thrown during the execution of a command.
+* Added the ability to get a CommandTransaction from events and updating
+  classes to use a CommandTransaction rather than many constructor arguments.
+* Fixed an issue with sending many commands in parallel
+* Added `batch()` to ServiceClientInterface for sending commands in batches
+* Added subscriber to easily mock commands results

+ 23 - 0
addons/cos/library/Guzzle/command/LICENSE

@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Michael Dowling <mtdowling@gmail.com>
+Copyright (c) 2014 Graham Campbell <hello@gjcampbell.co.uk>
+Copyright (c) 2014 Jeremy Lindblom <jeremeamia@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 2 - 0
addons/cos/library/Guzzle/command/Makefile

@@ -0,0 +1,2 @@
+test:
+	vendor/bin/phpunit $(TEST)

+ 168 - 0
addons/cos/library/Guzzle/command/README.md

@@ -0,0 +1,168 @@
+# Guzzle Commands
+
+This library uses Guzzle and provides the foundations to create fully-featured
+web service clients by abstracting Guzzle HTTP *requests* and *responses* into
+higher-level *commands* and *results*. A *middleware* system, analogous to, but
+separate from, the one in the HTTP layer may be used to customize client
+behavior when preparing commands into requests and processing responses into
+results.
+
+### Commands
+
+Key-value pair objects representing an operation of a web service. Commands
+have a name and a set of parameters.
+
+### Results
+
+Key-value pair objects representing the processed result of executing an
+operation of a web service.
+
+## Installing
+
+This project can be installed using [Composer](https://getcomposer.org/):
+
+```
+composer require guzzlehttp/command
+```
+
+## Service Clients
+
+Service Clients are web service clients that implement the
+`GuzzleHttp\Command\ServiceClientInterface` and use an underlying Guzzle HTTP
+client (`GuzzleHttp\ClientInterface`) to communicate with the service. Service
+clients create and execute *commands* (`GuzzleHttp\Command\CommandInterface`),
+which encapsulate operations within the web service, including the operation
+name and parameters. This library provides a generic implementation of a service
+client: the `GuzzleHttp\Command\ServiceClient` class.
+
+## Instantiating a Service Client
+
+The provided service client implementation (`GuzzleHttp\Command\ServiceClient`)
+can be instantiated by providing the following arguments:
+
+1. A fully-configured Guzzle HTTP client that will be used to perform the
+   underlying HTTP requests. That is, an instance of an object implementing
+   `GuzzleHttp\ClientInterface` such as `new GuzzleHttp\Client()`.
+1. A callable that transforms a Command into a Request. The function should
+   accept a `GuzzleHttp\Command\CommandInterface` object and return a
+   `Psr\Http\Message\RequestInterface` object.
+1. A callable that transforms a Response into a Result. The function should
+   accept a `Psr\Http\Message\ResponseInterface` object and optionally a
+   `Psr\Http\Message\RequestInterface` object, and return a
+   `GuzzleHttp\Command\ResultInterface` object.
+1. Optionally, a Guzzle HandlerStack (`GuzzleHttp\HandlerStack`), which can be
+   used to add command-level middleware to the service client.
+
+Below is an example configured to send and receive JSON payloads:
+
+```php
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Result;
+use GuzzleHttp\Command\ResultInterface;
+use GuzzleHttp\Command\ServiceClient;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\UriTemplate\UriTemplate;
+use GuzzleHttp\Utils;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+$client = new ServiceClient(
+    new HttpClient(),
+    function (CommandInterface $command): RequestInterface {
+        return new Request(
+            'POST',
+            UriTemplate::expand('/{command}', ['command' => $command->getName()]),
+            ['Accept' => 'application/json', 'Content-Type' => 'application/json'],
+            Utils::jsonEncode($command->toArray())
+        );
+    },
+    function (ResponseInterface $response, RequestInterface $request): ResultInterface {
+        return new Result(
+            Utils::jsonDecode((string) $response->getBody(), true)
+        );
+    }
+);
+```
+
+## Executing Commands
+
+Service clients create command objects using the ``getCommand()`` method.
+
+```php
+$commandName = 'foo';
+$arguments = ['baz' => 'bar'];
+$command = $client->getCommand($commandName, $arguments);
+```
+
+After creating a command, you may execute the command using the `execute()`
+method of the client.
+
+```php
+$result = $client->execute($command);
+```
+
+The result of executing a command will be an instance of an object implementing
+`GuzzleHttp\Command\ResultInterface`. Result objects are `ArrayAccess`-ible and
+contain the data parsed from HTTP response.
+
+Service clients have magic methods that act as shortcuts to executing commands
+by name without having to create the ``Command`` object in a separate step
+before executing it.
+
+```php
+$result = $client->foo(['baz' => 'bar']);
+```
+
+## Asynchronous Commands
+
+@TODO Add documentation
+
+* ``-Async`` suffix for client methods
+* Promises
+
+```php
+// Create and execute an asynchronous command.
+$command = $command = $client->getCommand('foo', ['baz' => 'bar']);
+$promise = $client->executeAsync($command);
+
+// Use asynchronous commands with magic methods.
+$promise = $client->fooAsync(['baz' => 'bar']);
+```
+
+@TODO Add documentation
+
+* ``wait()``-ing on promises.
+
+```php
+$result = $promise->wait();
+
+echo $result['fizz']; //> 'buzz'
+```
+
+## Concurrent Requests
+
+@TODO Add documentation
+
+* ``executeAll()``
+* ``executeAllAsync()``.
+* Options (``fulfilled``, ``rejected``, ``concurrency``)
+
+## Middleware: Extending the Client
+
+Middleware can be added to the service client or underlying HTTP client to
+implement additional behavior and customize the ``Command``-to-``Result`` and
+``Request``-to-``Response`` lifecycles, respectively.
+
+## Security
+
+If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/command/security/policy) for more information.
+
+## License
+
+Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
+## For Enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-command?utm_source=packagist-guzzlehttp-command&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

+ 50 - 0
addons/cos/library/Guzzle/command/composer.json

@@ -0,0 +1,50 @@
+{
+    "name": "guzzlehttp/command",
+    "description": "Provides the foundation for building command-based web service clients",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Graham Campbell",
+            "email": "hello@gjcampbell.co.uk",
+            "homepage": "https://github.com/GrahamCampbell"
+        },
+        {
+            "name": "Michael Dowling",
+            "email": "mtdowling@gmail.com",
+            "homepage": "https://github.com/mtdowling"
+        },
+        {
+            "name": "Jeremy Lindblom",
+            "email": "jeremeamia@gmail.com",
+            "homepage": "https://github.com/jeremeamia"
+        },
+        {
+            "name": "Tobias Nyholm",
+            "email": "tobias.nyholm@gmail.com",
+            "homepage": "https://github.com/Nyholm"
+        }
+    ],
+    "require": {
+        "php": "^7.2.5 || ^8.0",
+        "guzzlehttp/guzzle": "^7.4.1",
+        "guzzlehttp/promises": "^1.5.1",
+        "guzzlehttp/psr7": "^1.8.3 || ^2.1"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "^8.5.19"
+    },
+    "autoload": {
+        "psr-4": {
+            "GuzzleHttp\\Command\\": "src/"
+        }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "1.2-dev"
+        }
+    },
+    "config": {
+        "preferred-install": "dist",
+        "sort-packages": true
+    }
+}

+ 23 - 0
addons/cos/library/Guzzle/command/phpunit.xml.dist

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit
+    backupGlobals="true"
+    beStrictAboutOutputDuringTests="true"
+    beStrictAboutTestsThatDoNotTestAnything="true"
+    colors="true"
+    bootstrap="vendor/autoload.php"
+    convertDeprecationsToExceptions="true"
+    convertErrorsToExceptions="true"
+    convertNoticesToExceptions="true"
+    convertWarningsToExceptions="true"
+>
+    <testsuites>
+        <testsuite name="unit">
+            <directory>tests</directory>
+        </testsuite>
+    </testsuites>
+    <filter>
+        <whitelist>
+            <directory>src</directory>
+        </whitelist>
+    </filter>
+</phpunit>

+ 55 - 0
addons/cos/library/Guzzle/command/src/Command.php

@@ -0,0 +1,55 @@
+<?php
+namespace GuzzleHttp\Command;
+
+use GuzzleHttp\HandlerStack;
+
+/**
+ * Default command implementation.
+ */
+class Command implements CommandInterface
+{
+    use HasDataTrait;
+
+    /** @var string */
+    private $name;
+
+    /** @var HandlerStack */
+    private $handlerStack;
+
+    /**
+     * @param string       $name         Name of the command
+     * @param array        $args         Arguments to pass to the command
+     * @param HandlerStack $handlerStack Stack of middleware for the command
+     */
+    public function __construct(
+        $name,
+        array $args = [],
+        HandlerStack $handlerStack = null
+    ) {
+        $this->name = $name;
+        $this->data = $args;
+        $this->handlerStack = $handlerStack;
+    }
+
+    public function getHandlerStack()
+    {
+        return $this->handlerStack;
+    }
+
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    public function hasParam($name)
+    {
+        return array_key_exists($name, $this->data);
+    }
+
+    public function __clone()
+    {
+        if ($this->handlerStack) {
+            $this->handlerStack = clone $this->handlerStack;
+        }
+    }
+}

+ 39 - 0
addons/cos/library/Guzzle/command/src/CommandInterface.php

@@ -0,0 +1,39 @@
+<?php
+namespace GuzzleHttp\Command;
+
+use GuzzleHttp\HandlerStack;
+
+/**
+ * A command object encapsulates the input parameters used to control the
+ * creation of a HTTP request and processing of a HTTP response.
+ *
+ * Using the getParams() method will return the input parameters of the command
+ * as an associative array.
+ */
+interface CommandInterface extends \ArrayAccess, \IteratorAggregate, \Countable, ToArrayInterface
+{
+    /**
+     * Retrieves the handler stack specific to this command's execution.
+     *
+     * This can be used to add middleware that is specific to the command instance.
+     *
+     * @return HandlerStack
+     */
+    public function getHandlerStack();
+
+    /**
+     * Get the name of the command.
+     *
+     * @return string
+     */
+    public function getName();
+
+    /**
+     * Check if the command has a parameter by name.
+     *
+     * @param string $name Name of the parameter to check.
+     *
+     * @return bool
+     */
+    public function hasParam($name);
+}

+ 7 - 0
addons/cos/library/Guzzle/command/src/Exception/CommandClientException.php

@@ -0,0 +1,7 @@
+<?php
+namespace GuzzleHttp\Command\Exception;
+
+/**
+ * Exception encountered when a 4xx level response is received for a request
+ */
+class CommandClientException extends CommandException {}

+ 109 - 0
addons/cos/library/Guzzle/command/src/Exception/CommandException.php

@@ -0,0 +1,109 @@
+<?php
+namespace GuzzleHttp\Command\Exception;
+
+use GuzzleHttp\Exception\GuzzleException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Command\CommandInterface;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Exception encountered while executing a command.
+ */
+class CommandException extends \RuntimeException implements GuzzleException
+{
+    /** @var CommandInterface */
+    private $command;
+
+    /** @var RequestInterface */
+    private $request;
+
+    /** @var ResponseInterface */
+    private $response;
+
+    /**
+     * @param CommandInterface $command
+     * @param \Exception $prev
+     * @return CommandException
+     */
+    public static function fromPrevious(CommandInterface $command, \Exception $prev)
+    {
+        // If the exception is already a command exception, return it.
+        if ($prev instanceof self && $command === $prev->getCommand()) {
+            return $prev;
+        }
+
+        // If the exception is a RequestException, get the Request and Response.
+        $request = $response = null;
+        if ($prev instanceof RequestException) {
+            $request = $prev->getRequest();
+            $response = $prev->getResponse();
+        }
+
+        // Throw a more specific exception for 4XX or 5XX responses.
+        $class = self::class;
+        $statusCode = $response ? $response->getStatusCode() : 0;
+        if ($statusCode >= 400 && $statusCode < 500) {
+            $class = CommandClientException::class;
+        } elseif ($statusCode >= 500 && $statusCode < 600) {
+            $class = CommandServerException::class;
+        }
+
+        // Prepare the message.
+        $message = 'There was an error executing the ' . $command->getName()
+            . ' command: ' . $prev->getMessage();
+
+        // Create the exception.
+        return new $class($message, $command, $prev, $request, $response);
+    }
+
+    /**
+     * @param string $message Exception message
+     * @param CommandInterface $command
+     * @param \Exception $previous Previous exception (if any)
+     * @param RequestInterface $request
+     * @param ResponseInterface $response
+     */
+    public function __construct(
+        $message,
+        CommandInterface $command,
+        \Exception $previous = null,
+        RequestInterface $request = null,
+        ResponseInterface $response = null
+    ) {
+        $this->command = $command;
+        $this->request = $request;
+        $this->response = $response;
+        parent::__construct($message, 0, $previous);
+    }
+
+    /**
+     * Gets the command that failed.
+     *
+     * @return CommandInterface
+     */
+    public function getCommand()
+    {
+        return $this->command;
+    }
+
+    /**
+     * Gets the request that caused the exception
+     *
+     * @return RequestInterface|null
+     */
+    public function getRequest()
+    {
+        return $this->request;
+    }
+
+    /**
+     * Gets the associated response
+     *
+     * @return ResponseInterface|null
+     */
+    public function getResponse()
+    {
+        return $this->response;
+    }
+}

+ 7 - 0
addons/cos/library/Guzzle/command/src/Exception/CommandServerException.php

@@ -0,0 +1,7 @@
+<?php
+namespace GuzzleHttp\Command\Exception;
+
+/**
+ * Exception encountered when a 5xx level response is received for a request
+ */
+class CommandServerException extends CommandException {}

+ 66 - 0
addons/cos/library/Guzzle/command/src/HasDataTrait.php

@@ -0,0 +1,66 @@
+<?php
+
+namespace GuzzleHttp\Command;
+
+/**
+ * Basic collection behavior for Command and Result objects.
+ *
+ * The methods in the class are primarily for implementing the ArrayAccess,
+ * Countable, and IteratorAggregate interfaces.
+ */
+trait HasDataTrait
+{
+    /** @var array Data stored in the collection. */
+    protected $data;
+
+    public function __toString()
+    {
+        return print_r($this, true);
+    }
+
+    public function __debugInfo()
+    {
+        return $this->data;
+    }
+
+    #[\ReturnTypeWillChange]
+    public function offsetExists($offset)
+    {
+        return array_key_exists($offset, $this->data);
+    }
+
+    #[\ReturnTypeWillChange]
+    public function offsetGet($offset)
+    {
+        return isset($this->data[$offset]) ? $this->data[$offset] : null;
+    }
+
+    #[\ReturnTypeWillChange]
+    public function offsetSet($offset, $value)
+    {
+        $this->data[$offset] = $value;
+    }
+
+    #[\ReturnTypeWillChange]
+    public function offsetUnset($offset)
+    {
+        unset($this->data[$offset]);
+    }
+
+    #[\ReturnTypeWillChange]
+    public function count()
+    {
+        return count($this->data);
+    }
+
+    #[\ReturnTypeWillChange]
+    public function getIterator()
+    {
+        return new \ArrayIterator($this->data);
+    }
+
+    public function toArray()
+    {
+        return $this->data;
+    }
+}

+ 18 - 0
addons/cos/library/Guzzle/command/src/Result.php

@@ -0,0 +1,18 @@
+<?php
+namespace GuzzleHttp\Command;
+
+/**
+ * Default command implementation.
+ */
+class Result implements ResultInterface
+{
+    use HasDataTrait;
+
+    /**
+     * @param array $data
+     */
+    public function __construct(array $data = [])
+    {
+        $this->data = $data;
+    }
+}

+ 9 - 0
addons/cos/library/Guzzle/command/src/ResultInterface.php

@@ -0,0 +1,9 @@
+<?php
+namespace GuzzleHttp\Command;
+
+/**
+ * An array-like object that represents the result of executing a command.
+ */
+interface ResultInterface extends \ArrayAccess, \IteratorAggregate, \Countable, ToArrayInterface
+{
+}

+ 219 - 0
addons/cos/library/Guzzle/command/src/ServiceClient.php

@@ -0,0 +1,219 @@
+<?php
+namespace GuzzleHttp\Command;
+
+use GuzzleHttp\ClientInterface as HttpClient;
+use GuzzleHttp\Command\Exception\CommandException;
+use GuzzleHttp\HandlerStack;
+use GuzzleHttp\Promise;
+use GuzzleHttp\Promise\Coroutine;
+use GuzzleHttp\Promise\Create;
+use GuzzleHttp\Promise\PromiseInterface;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * The Guzzle ServiceClient serves as the foundation for creating web service
+ * clients that interact with RPC-style APIs.
+ */
+class ServiceClient implements ServiceClientInterface
+{
+    /** @var HttpClient HTTP client used to send requests */
+    private $httpClient;
+
+    /** @var HandlerStack */
+    private $handlerStack;
+    
+    /** @var callable */
+    private $commandToRequestTransformer;
+
+    /** @var callable */
+    private $responseToResultTransformer;
+
+    /**
+     * Instantiates a Guzzle ServiceClient for making requests to a web service.
+     *
+     * @param HttpClient $httpClient A fully-configured Guzzle HTTP client that
+     *     will be used to perform the underlying HTTP requests.
+     * @param callable $commandToRequestTransformer A callable that transforms
+     *     a Command into a Request. The function should accept a
+     *     `GuzzleHttp\Command\CommandInterface` object and return a
+     *     `Psr\Http\Message\RequestInterface` object.
+     * @param callable $responseToResultTransformer A callable that transforms a
+     *     Response into a Result. The function should accept a
+     *     `Psr\Http\Message\ResponseInterface` object (and optionally a
+     *     `Psr\Http\Message\RequestInterface` object) and return a
+     *     `GuzzleHttp\Command\ResultInterface` object.
+     * @param HandlerStack $commandHandlerStack A Guzzle HandlerStack, which can
+     *     be used to add command-level middleware to the service client.
+     */
+    public function __construct(
+        HttpClient $httpClient,
+        callable $commandToRequestTransformer,
+        callable $responseToResultTransformer,
+        HandlerStack $commandHandlerStack = null
+    ) {
+        $this->httpClient = $httpClient;
+        $this->commandToRequestTransformer = $commandToRequestTransformer;
+        $this->responseToResultTransformer = $responseToResultTransformer;
+        $this->handlerStack = $commandHandlerStack ?: new HandlerStack();
+        $this->handlerStack->setHandler($this->createCommandHandler());
+    }
+
+    public function getHttpClient()
+    {
+        return $this->httpClient;
+    }
+
+    public function getHandlerStack()
+    {
+        return $this->handlerStack;
+    }
+
+    public function getCommand($name, array $params = [])
+    {
+        return new Command($name, $params, clone $this->handlerStack);
+    }
+
+    public function execute(CommandInterface $command)
+    {
+        return $this->executeAsync($command)->wait();
+    }
+
+    public function executeAsync(CommandInterface $command)
+    {
+        $stack = $command->getHandlerStack() ?: $this->handlerStack;
+        $handler = $stack->resolve();
+
+        return $handler($command);
+    }
+
+    public function executeAll($commands, array $options = [])
+    {
+        // Modify provided callbacks to track results.
+        $results = [];
+        $options['fulfilled'] = function ($v, $k) use (&$results, $options) {
+            if (isset($options['fulfilled'])) {
+                $options['fulfilled']($v, $k);
+            }
+            $results[$k] = $v;
+        };
+        $options['rejected'] = function ($v, $k) use (&$results, $options) {
+            if (isset($options['rejected'])) {
+                $options['rejected']($v, $k);
+            }
+            $results[$k] = $v;
+        };
+
+        // Execute multiple commands synchronously, then sort and return the results.
+        return $this->executeAllAsync($commands, $options)
+            ->then(function () use (&$results) {
+                ksort($results);
+                return $results;
+            })
+            ->wait();
+    }
+
+    public function executeAllAsync($commands, array $options = [])
+    {
+        // Apply default concurrency.
+        if (!isset($options['concurrency'])) {
+            $options['concurrency'] = 25;
+        }
+
+        // Convert the iterator of commands to a generator of promises.
+        $commands = Create::iterFor($commands);
+        $promises = function () use ($commands) {
+            foreach ($commands as $key => $command) {
+                if (!$command instanceof CommandInterface) {
+                    throw new \InvalidArgumentException('The iterator must '
+                        . 'yield instances of ' . CommandInterface::class);
+                }
+                yield $key => $this->executeAsync($command);
+            }
+        };
+
+        // Execute the commands using a pool.
+        return (new Promise\EachPromise($promises(), $options))->promise();
+    }
+
+    /**
+     * Creates and executes a command for an operation by name.
+     *
+     * @param string $name Name of the command to execute.
+     * @param array $args Arguments to pass to the getCommand method.
+     *
+     * @return ResultInterface|PromiseInterface
+     * @see \GuzzleHttp\Command\ServiceClientInterface::getCommand
+     */
+    public function __call($name, array $args)
+    {
+        $args = isset($args[0]) ? $args[0] : [];
+        if (substr($name, -5) === 'Async') {
+            $command = $this->getCommand(substr($name, 0, -5), $args);
+            return $this->executeAsync($command);
+        } else {
+            return $this->execute($this->getCommand($name, $args));
+        }
+    }
+
+    /**
+     * Defines the main handler for commands that uses the HTTP client.
+     *
+     * @return callable
+     */
+    private function createCommandHandler()
+    {
+        return function (CommandInterface $command) {
+            return Coroutine::of(function () use ($command) {
+                // Prepare the HTTP options.
+                $opts = $command['@http'] ?: [];
+                unset($command['@http']);
+
+                try {
+                    // Prepare the request from the command and send it.
+                    $request = $this->transformCommandToRequest($command);
+                    $promise = $this->httpClient->sendAsync($request, $opts);
+
+                    // Create a result from the response.
+                    $response = (yield $promise);
+                    yield $this->transformResponseToResult($response, $request, $command);
+                } catch (\Exception $e) {
+                    throw CommandException::fromPrevious($command, $e);
+                }
+            });
+        };
+    }
+
+    /**
+     * Transforms a Command object into a Request object.
+     *
+     * @param CommandInterface $command
+     * @return RequestInterface
+     */
+    private function transformCommandToRequest(CommandInterface $command)
+    {
+        $transform = $this->commandToRequestTransformer;
+
+        return $transform($command);
+    }
+
+
+    /**
+     * Transforms a Response object, also using data from the Request object,
+     * into a Result object.
+     *
+     * @param ResponseInterface $response
+     * @param RequestInterface $request
+     * @param CommandInterface $command
+     * @return ResultInterface
+     */
+    private function transformResponseToResult(
+        ResponseInterface $response,
+        RequestInterface $request,
+        CommandInterface $command
+    ) {
+        $transform = $this->responseToResultTransformer;
+
+        return $transform($response, $request, $command);
+    }
+}

+ 92 - 0
addons/cos/library/Guzzle/command/src/ServiceClientInterface.php

@@ -0,0 +1,92 @@
+<?php
+namespace GuzzleHttp\Command;
+
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Command\Exception\CommandException;
+use GuzzleHttp\HandlerStack;
+use GuzzleHttp\Promise\PromiseInterface;
+
+/**
+ * Web service client interface.
+ */
+interface ServiceClientInterface
+{
+    /**
+     * Create a command for an operation name.
+     *
+     * Special keys may be set on the command to control how it behaves.
+     * Implementations SHOULD be able to utilize the following keys or throw
+     * an exception if unable.
+     *
+     * @param string $name Name of the operation to use in the command
+     * @param array  $args Arguments to pass to the command
+     *
+     * @return CommandInterface
+     * @throws \InvalidArgumentException if no command can be found by name
+     */
+    public function getCommand($name, array $args = []);
+
+    /**
+     * Execute a single command.
+     *
+     * @param CommandInterface $command Command to execute
+     *
+     * @return ResultInterface The result of the executed command
+     * @throws CommandException
+     */
+    public function execute(CommandInterface $command);
+
+    /**
+     * Execute a single command asynchronously
+     *
+     * @param CommandInterface $command Command to execute
+     *
+     * @return PromiseInterface A Promise that resolves to a Result.
+     */
+    public function executeAsync(CommandInterface $command);
+
+    /**
+     * Executes multiple commands concurrently using a fixed pool size.
+     *
+     * @param array|\Iterator $commands Array or iterator that contains
+     *     CommandInterface objects to execute with the client.
+     * @param array $options Associative array of options to apply.
+     *     - concurrency: (int) Max number of commands to execute concurrently.
+     *     - fulfilled: (callable) Function to invoke when a command completes.
+     *     - rejected: (callable) Function to invoke when a command fails.
+     *
+     * @return array
+     * @see GuzzleHttp\Command\ServiceClientInterface::createPool for options.
+     */
+    public function executeAll($commands, array $options = []);
+
+    /**
+     * Executes multiple commands concurrently and asynchronously using a
+     * fixed pool size.
+     *
+     * @param array|\Iterator $commands Array or iterator that contains
+     *     CommandInterface objects to execute with the client.
+     * @param array $options Associative array of options to apply.
+     *     - concurrency: (int) Max number of commands to execute concurrently.
+     *     - fulfilled: (callable) Function to invoke when a command completes.
+     *     - rejected: (callable) Function to invoke when a command fails.
+     *
+     * @return PromiseInterface
+     * @see GuzzleHttp\Command\ServiceClientInterface::createPool for options.
+     */
+    public function executeAllAsync($commands, array $options = []);
+
+    /**
+     * Get the HTTP client used to send requests for the web service client
+     *
+     * @return ClientInterface
+     */
+    public function getHttpClient();
+
+    /**
+     * Get the HandlerStack which can be used to add middleware to the client.
+     *
+     * @return HandlerStack
+     */
+    public function getHandlerStack();
+}

+ 16 - 0
addons/cos/library/Guzzle/command/src/ToArrayInterface.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace GuzzleHttp\Command;
+
+/**
+ * An object that can be represented as an array
+ */
+interface ToArrayInterface
+{
+    /**
+     * Get the array representation of an object
+     *
+     * @return array
+     */
+    public function toArray();
+}

+ 363 - 0
addons/cos/library/Guzzle/guzzle-services/CHANGELOG.md

@@ -0,0 +1,363 @@
+# Change Log
+
+## [1.2.0](https://github.com/guzzle/guzzle-services/tree/1.2.0) (2020-11-13)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/1.2.0...HEAD)
+
+**Closed issues:**
+
+- Fix weird "equal equal not" operator [\#154](https://github.com/guzzle/guzzle-services/issues/154)
+
+**Merged pull requests:**
+
+- Support Guzzle 7 [\#176](https://github.com/guzzle/guzzle-services/pull/176) ([ptlevi](https://github.com/ptlevi))
+
+## [1.1.3](https://github.com/guzzle/guzzle-services/tree/1.1.3) (2017-10-06)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/1.1.2...HEAD)
+
+**Closed issues:**
+
+- Parameter type configuration causes issue when filters change input type [\#147](https://github.com/guzzle/guzzle-services/issues/147)
+
+**Merged pull requests:**
+
+- Use wire name when visiting array [\#152](https://github.com/guzzle/guzzle-services/pull/152) ([my2ter](https://github.com/my2ter))
+
+- Adding descriptive error message on parameter failure [\#144](https://github.com/guzzle/guzzle-services/pull/144) ([igorsantos07](https://github.com/igorsantos07))
+
+## [1.1.2](https://github.com/guzzle/guzzle-services/tree/1.1.2) (2017-05-19)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/1.1.1...1.1.2)
+
+**Closed issues:**
+
+- Default values ignored in 1.1 [\#146](https://github.com/guzzle/guzzle-services/issues/146)
+
+- Operations extends is broken in 1.1.1 [\#145](https://github.com/guzzle/guzzle-services/issues/145)
+
+## [1.1.1](https://github.com/guzzle/guzzle-services/tree/1.1.1) (2017-05-15)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/1.1.0...1.1.1)
+
+**Closed issues:**
+
+- Filters are applied twice [\#134](https://github.com/guzzle/guzzle-services/issues/134)
+
+- Is it possible to NOT urlencode a specific uri parameter value? [\#97](https://github.com/guzzle/guzzle-services/issues/97)
+
+**Merged pull requests:**
+
+- Fix minor typos in documentation. [\#139](https://github.com/guzzle/guzzle-services/pull/139) ([forevermatt](https://github.com/forevermatt))
+
+- Do not mutate command at validation [\#135](https://github.com/guzzle/guzzle-services/pull/135) ([danizord](https://github.com/danizord))
+
+- Added tests for JSON array of arrays and array of objects [\#131](https://github.com/guzzle/guzzle-services/pull/131) ([selfcatering](https://github.com/selfcatering))
+
+- Allow filters on response model [\#138](https://github.com/guzzle/guzzle-services/pull/138) ([danizord](https://github.com/danizord))
+
+- Exposing properties to a parent class [\#136](https://github.com/guzzle/guzzle-services/pull/136) ([Napas](https://github.com/Napas))
+
+## [1.1.0](https://github.com/guzzle/guzzle-services/tree/1.1.0) (2017-01-31)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/1.0.1...1.1.0)
+
+**Closed issues:**
+
+- Grab a list of objects when they are not located at top level of a json response \(HATEOAS\) [\#90](https://github.com/guzzle/guzzle-services/issues/90)
+
+- Regression of Issue \#51 - XmlLocation response not handling multiple tags of the same name correctly [\#82](https://github.com/guzzle/guzzle-services/issues/82)
+
+- PUT requests with parameters with location of "postField" result in Exception [\#78](https://github.com/guzzle/guzzle-services/issues/78)
+
+- Allow to provide Post Body as an Array [\#77](https://github.com/guzzle/guzzle-services/issues/77)
+
+**Merged pull requests:**
+
+- Bring more flexibility to query params serialization [\#132](https://github.com/guzzle/guzzle-services/pull/132) ([bakura10](https://github.com/bakura10))
+
+- Allow to fix validation for parameters with a format [\#130](https://github.com/guzzle/guzzle-services/pull/130) ([bakura10](https://github.com/bakura10))
+
+## [1.0.1](https://github.com/guzzle/guzzle-services/tree/1.0.1) (2017-01-13)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/1.0.0...1.0.1)
+
+**Implemented enhancements:**
+
+- Set a name when pushing ValidatedDescriptionHandler to stack [\#127](https://github.com/guzzle/guzzle-services/issues/127)
+
+**Fixed bugs:**
+
+- combine method in Uri [\#101](https://github.com/guzzle/guzzle-services/issues/101)
+
+- Undefined Variable [\#88](https://github.com/guzzle/guzzle-services/issues/88)
+
+- Regression in array parameter serialization [\#128](https://github.com/guzzle/guzzle-services/issues/128)
+
+- Unable to POST multiple multipart parameters [\#123](https://github.com/guzzle/guzzle-services/issues/123)
+
+**Closed issues:**
+
+- Tag pre 1.0.0 release [\#121](https://github.com/guzzle/guzzle-services/issues/121)
+
+- Adjust inline documentation of Parameter [\#120](https://github.com/guzzle/guzzle-services/issues/120)
+
+- postField location not recognized after upgrading to 1.0 [\#119](https://github.com/guzzle/guzzle-services/issues/119)
+
+- Create a new release for the guzzle6 branch [\#118](https://github.com/guzzle/guzzle-services/issues/118)
+
+- Compatibility problem with PHP7.0 ? [\#116](https://github.com/guzzle/guzzle-services/issues/116)
+
+- What is the correct type of Parameter static option [\#113](https://github.com/guzzle/guzzle-services/issues/113)
+
+- Improve the construction of baseUri in Description [\#112](https://github.com/guzzle/guzzle-services/issues/112)
+
+- Please create version tag for current master branch [\#110](https://github.com/guzzle/guzzle-services/issues/110)
+
+- Problems with postField params [\#98](https://github.com/guzzle/guzzle-services/issues/98)
+
+**Merged pull requests:**
+
+- Fix serialization of query params [\#129](https://github.com/guzzle/guzzle-services/pull/129) ([bakura10](https://github.com/bakura10))
+
+## [1.0.0](https://github.com/guzzle/guzzle-services/tree/1.0.0) (2016-11-24)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/0.6.0...1.0.0)
+
+**Closed issues:**
+
+- AbstractClient' not found [\#117](https://github.com/guzzle/guzzle-services/issues/117)
+
+**Merged pull requests:**
+
+- Make Guzzle Services compatible with Guzzle6 [\#109](https://github.com/guzzle/guzzle-services/pull/109) ([Konafets](https://github.com/Konafets))
+
+## [0.6.0](https://github.com/guzzle/guzzle-services/tree/0.6.0) (2016-10-21)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/0.5.0...0.6.0)
+
+**Closed issues:**
+
+- Broken composer install [\#111](https://github.com/guzzle/guzzle-services/issues/111)
+
+- The visit\(\) method is expected to return a RequestInterface but it doesn't in JsonLocation [\#106](https://github.com/guzzle/guzzle-services/issues/106)
+
+- Allow parameters in baseUrl [\#102](https://github.com/guzzle/guzzle-services/issues/102)
+
+- Have default params at client construction, gone away? [\#100](https://github.com/guzzle/guzzle-services/issues/100)
+
+- Runtime Exception Error is always empty [\#99](https://github.com/guzzle/guzzle-services/issues/99)
+
+- PHP Fatal error:  Unsupported operand types in guzzlehttp/guzzle-services/src/GuzzleClient.php on line 72 [\#95](https://github.com/guzzle/guzzle-services/issues/95)
+
+- Date of next version [\#94](https://github.com/guzzle/guzzle-services/issues/94)
+
+- Map null reponse values to defined reponse model properties [\#91](https://github.com/guzzle/guzzle-services/issues/91)
+
+- Map a json-array into a Model [\#80](https://github.com/guzzle/guzzle-services/issues/80)
+
+- If property specified in json model but empty, notice raised [\#75](https://github.com/guzzle/guzzle-services/issues/75)
+
+- Allow primitive response types for operations [\#73](https://github.com/guzzle/guzzle-services/issues/73)
+
+- Allow shortened definition of properties in models [\#71](https://github.com/guzzle/guzzle-services/issues/71)
+
+- Where's the ServiceDescriptionLoader/AbstractConfigLoader? [\#68](https://github.com/guzzle/guzzle-services/issues/68)
+
+- errorResposnes from operation is never used [\#66](https://github.com/guzzle/guzzle-services/issues/66)
+
+- Updating the description  [\#65](https://github.com/guzzle/guzzle-services/issues/65)
+
+- Parameter type validation is too strict [\#7](https://github.com/guzzle/guzzle-services/issues/7)
+
+**Merged pull requests:**
+
+- fix code example [\#115](https://github.com/guzzle/guzzle-services/pull/115) ([snoek09](https://github.com/snoek09))
+
+- Bug Fix for GuzzleClient constructor [\#96](https://github.com/guzzle/guzzle-services/pull/96) ([peterfox](https://github.com/peterfox))
+
+- add plugin section to readme [\#93](https://github.com/guzzle/guzzle-services/pull/93) ([gimler](https://github.com/gimler))
+
+- Allow mapping null response values to defined response model properties [\#92](https://github.com/guzzle/guzzle-services/pull/92) ([shaun785](https://github.com/shaun785))
+
+- Updated exception message for better debugging [\#85](https://github.com/guzzle/guzzle-services/pull/85) ([stovak](https://github.com/stovak))
+
+- Gracefully handle null return from $this-\>getConfig\('defaults'\) [\#84](https://github.com/guzzle/guzzle-services/pull/84) ([fuhry](https://github.com/fuhry))
+
+- Fixing issue \#82 to address regression for handling elements with the sa... [\#83](https://github.com/guzzle/guzzle-services/pull/83) ([sprak3000](https://github.com/sprak3000))
+
+- Fix for specified property but no value in json \(notice for undefined in... [\#76](https://github.com/guzzle/guzzle-services/pull/76) ([rfink](https://github.com/rfink))
+
+- Add ErrorHandler subscriber [\#67](https://github.com/guzzle/guzzle-services/pull/67) ([bakura10](https://github.com/bakura10))
+
+- Fix combine base url and command uri [\#108](https://github.com/guzzle/guzzle-services/pull/108) ([vlastv](https://github.com/vlastv))
+
+- Fixing JsonLocation::visit\(\) not returning a request \#106 [\#107](https://github.com/guzzle/guzzle-services/pull/107) ([Pinolo](https://github.com/Pinolo))
+
+- Fix call to undefined method "GuzzleHttp\Psr7\Uri::combine" [\#105](https://github.com/guzzle/guzzle-services/pull/105) ([horrorin](https://github.com/horrorin))
+
+- fix description for get request example [\#87](https://github.com/guzzle/guzzle-services/pull/87) ([snoek09](https://github.com/snoek09))
+
+- Allow raw values \(non array/object\) for root model definitions [\#74](https://github.com/guzzle/guzzle-services/pull/74) ([rfink](https://github.com/rfink))
+
+- Allow shortened definition of properties by assigning them directly to a type [\#72](https://github.com/guzzle/guzzle-services/pull/72) ([rfink](https://github.com/rfink))
+
+## [0.5.0](https://github.com/guzzle/guzzle-services/tree/0.5.0) (2014-12-23)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/0.4.0...0.5.0)
+
+**Closed issues:**
+
+- Does it supports custom class instantiate to define an operation using a service description [\#62](https://github.com/guzzle/guzzle-services/issues/62)
+
+- Tag version 0.4.0 [\#61](https://github.com/guzzle/guzzle-services/issues/61)
+
+- XmlLocation not adding attributes to non-leaf child nodes [\#52](https://github.com/guzzle/guzzle-services/issues/52)
+
+- XmlLocation response not handling multiple tags of the same name correctly [\#51](https://github.com/guzzle/guzzle-services/issues/51)
+
+- Validation Bug [\#47](https://github.com/guzzle/guzzle-services/issues/47)
+
+- CommandException doesn't contain response data [\#44](https://github.com/guzzle/guzzle-services/issues/44)
+
+- \[Fix included\] XmlLocation requires text value to have attributes [\#37](https://github.com/guzzle/guzzle-services/issues/37)
+
+- Question: Mocking a Response does not throw exception [\#35](https://github.com/guzzle/guzzle-services/issues/35)
+
+- allow default 'location' on Model [\#26](https://github.com/guzzle/guzzle-services/issues/26)
+
+- create mock subscriber requests from descriptions [\#25](https://github.com/guzzle/guzzle-services/issues/25)
+
+**Merged pull requests:**
+
+- Documentation: Add 'boolean-string' as a supported "format" value [\#63](https://github.com/guzzle/guzzle-services/pull/63) ([jwcobb](https://github.com/jwcobb))
+
+## [0.4.0](https://github.com/guzzle/guzzle-services/tree/0.4.0) (2014-11-03)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/0.3.0...0.4.0)
+
+**Closed issues:**
+
+- Exceptions Thrown From Subscribers Are Ignored? [\#58](https://github.com/guzzle/guzzle-services/issues/58)
+
+- Totally Broken With Guzzle 5 [\#57](https://github.com/guzzle/guzzle-services/issues/57)
+
+- GuzzleHTTP/Command Dependency fail [\#50](https://github.com/guzzle/guzzle-services/issues/50)
+
+- Request parameter PathLocation [\#46](https://github.com/guzzle/guzzle-services/issues/46)
+
+- Requesting a new version tag [\#45](https://github.com/guzzle/guzzle-services/issues/45)
+
+- CommandException expects second parameter to be CommandTransaction instance  [\#43](https://github.com/guzzle/guzzle-services/issues/43)
+
+- Cannot add Autorization header to my requests [\#39](https://github.com/guzzle/guzzle-services/issues/39)
+
+- Resouce Itterators [\#36](https://github.com/guzzle/guzzle-services/issues/36)
+
+- Question [\#33](https://github.com/guzzle/guzzle-services/issues/33)
+
+- query location array can be comma separated [\#31](https://github.com/guzzle/guzzle-services/issues/31)
+
+- Automatically returns array from command? [\#30](https://github.com/guzzle/guzzle-services/issues/30)
+
+- Arrays nested under objects in JSON response broken? [\#27](https://github.com/guzzle/guzzle-services/issues/27)
+
+- Question? [\#23](https://github.com/guzzle/guzzle-services/issues/23)
+
+**Merged pull requests:**
+
+- Bump the version in the readme [\#60](https://github.com/guzzle/guzzle-services/pull/60) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Bump the next version to 0.4 [\#56](https://github.com/guzzle/guzzle-services/pull/56) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Fixed the guzzlehttp/command version constraint [\#55](https://github.com/guzzle/guzzle-services/pull/55) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Work with latest Guzzle 5 and Command updates [\#54](https://github.com/guzzle/guzzle-services/pull/54) ([mtdowling](https://github.com/mtdowling))
+
+- Addressing Issue \#51 & Issue \#52 [\#53](https://github.com/guzzle/guzzle-services/pull/53) ([sprak3000](https://github.com/sprak3000))
+
+- added description interface to extend it [\#49](https://github.com/guzzle/guzzle-services/pull/49) ([danieledangeli](https://github.com/danieledangeli))
+
+- Update readme to improve documentation \(\#46\) [\#48](https://github.com/guzzle/guzzle-services/pull/48) ([bonndan](https://github.com/bonndan))
+
+- Fixed the readme version constraint [\#42](https://github.com/guzzle/guzzle-services/pull/42) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Update .travis.yml [\#41](https://github.com/guzzle/guzzle-services/pull/41) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Added a branch alias [\#40](https://github.com/guzzle/guzzle-services/pull/40) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Fixes Response\XmlLocation requires text value [\#38](https://github.com/guzzle/guzzle-services/pull/38) ([magnetik](https://github.com/magnetik))
+
+- Removing unnecessary \(\) from docblock [\#32](https://github.com/guzzle/guzzle-services/pull/32) ([jamiehannaford](https://github.com/jamiehannaford))
+
+- Fix JSON response location so that both is supported: arrays nested unde... [\#28](https://github.com/guzzle/guzzle-services/pull/28) ([ukautz](https://github.com/ukautz))
+
+- Throw Any Exceptions On Process [\#59](https://github.com/guzzle/guzzle-services/pull/59) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Allow extension to work recursively over models [\#34](https://github.com/guzzle/guzzle-services/pull/34) ([jamiehannaford](https://github.com/jamiehannaford))
+
+- A custom class can be configured for command instances. [\#29](https://github.com/guzzle/guzzle-services/pull/29) ([robinvdvleuten](https://github.com/robinvdvleuten))
+
+- \[WIP\] doing some experimentation [\#24](https://github.com/guzzle/guzzle-services/pull/24) ([cordoval](https://github.com/cordoval))
+
+## [0.3.0](https://github.com/guzzle/guzzle-services/tree/0.3.0) (2014-06-01)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/0.2.0...0.3.0)
+
+**Closed issues:**
+
+- Testing Guzzle Services doesn't work [\#19](https://github.com/guzzle/guzzle-services/issues/19)
+
+- Description factory [\#18](https://github.com/guzzle/guzzle-services/issues/18)
+
+- support to load service description from file [\#15](https://github.com/guzzle/guzzle-services/issues/15)
+
+- Update dependency on guzzlehttp/command [\#11](https://github.com/guzzle/guzzle-services/issues/11)
+
+**Merged pull requests:**
+
+- Add license file [\#22](https://github.com/guzzle/guzzle-services/pull/22) ([siwinski](https://github.com/siwinski))
+
+- Fix 'Invalid argument supplied for foreach\(\)' [\#21](https://github.com/guzzle/guzzle-services/pull/21) ([Olden](https://github.com/Olden))
+
+- Fixed string zero \('0'\) values not being filtered in XML. [\#20](https://github.com/guzzle/guzzle-services/pull/20) ([dragonwize](https://github.com/dragonwize))
+
+- baseUrl can be a string or an uri template [\#16](https://github.com/guzzle/guzzle-services/pull/16) ([robinvdvleuten](https://github.com/robinvdvleuten))
+
+## [0.2.0](https://github.com/guzzle/guzzle-services/tree/0.2.0) (2014-03-30)
+
+[Full Changelog](https://github.com/guzzle/guzzle-services/compare/0.1.0...0.2.0)
+
+**Closed issues:**
+
+- please remove wiki [\#13](https://github.com/guzzle/guzzle-services/issues/13)
+
+- Parameter validation fails for union types [\#12](https://github.com/guzzle/guzzle-services/issues/12)
+
+- question on integration with Guzzle4 [\#8](https://github.com/guzzle/guzzle-services/issues/8)
+
+- typehints for operations property [\#6](https://github.com/guzzle/guzzle-services/issues/6)
+
+- improve exception message [\#5](https://github.com/guzzle/guzzle-services/issues/5)
+
+**Merged pull requests:**
+
+- Update composer.json [\#14](https://github.com/guzzle/guzzle-services/pull/14) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Update composer.json [\#9](https://github.com/guzzle/guzzle-services/pull/9) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- some fixes [\#4](https://github.com/guzzle/guzzle-services/pull/4) ([cordoval](https://github.com/cordoval))
+
+- Fix the CommandException path used in ValidateInput [\#2](https://github.com/guzzle/guzzle-services/pull/2) ([mookle](https://github.com/mookle))
+
+- Minor improvements [\#1](https://github.com/guzzle/guzzle-services/pull/1) ([GrahamCampbell](https://github.com/GrahamCampbell))
+
+- Use latest guzzlehttp/command to fix dependencies [\#10](https://github.com/guzzle/guzzle-services/pull/10) ([sbward](https://github.com/sbward))
+
+- some collaboration using Gush :\) [\#3](https://github.com/guzzle/guzzle-services/pull/3) ([cordoval](https://github.com/cordoval))
+
+## [0.1.0](https://github.com/guzzle/guzzle-services/tree/0.1.0) (2014-03-15)
+
+
+
+\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

+ 23 - 0
addons/cos/library/Guzzle/guzzle-services/LICENSE

@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Michael Dowling <mtdowling@gmail.com>
+Copyright (c) 2014 Graham Campbell <hello@gjcampbell.co.uk>
+Copyright (c) 2016 Stefano Kowalke <blueduck@mail.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 2 - 0
addons/cos/library/Guzzle/guzzle-services/Makefile

@@ -0,0 +1,2 @@
+test:
+	vendor/bin/phpunit $(TEST)

+ 134 - 0
addons/cos/library/Guzzle/guzzle-services/README.md

@@ -0,0 +1,134 @@
+# Guzzle Services
+
+Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.
+
+```php
+use GuzzleHttp\Client;
+use GuzzleHttp\Command\Guzzle\GuzzleClient;
+use GuzzleHttp\Command\Guzzle\Description;
+
+$client = new Client();
+$description = new Description([
+	'baseUri' => 'http://httpbin.org/',
+	'operations' => [
+		'testing' => [
+			'httpMethod' => 'GET',
+			'uri' => '/get{?foo}',
+			'responseModel' => 'getResponse',
+			'parameters' => [
+				'foo' => [
+					'type' => 'string',
+					'location' => 'uri'
+				],
+				'bar' => [
+					'type' => 'string',
+					'location' => 'query'
+				]
+			]
+		]
+	],
+	'models' => [
+		'getResponse' => [
+			'type' => 'object',
+			'additionalProperties' => [
+				'location' => 'json'
+			]
+		]
+	]
+]);
+
+$guzzleClient = new GuzzleClient($client, $description);
+
+$result = $guzzleClient->testing(['foo' => 'bar']);
+echo $result['args']['foo'];
+// bar
+```
+
+## Installing
+
+This project can be installed using Composer:
+
+``composer require guzzlehttp/guzzle-services``
+
+For **Guzzle 5**, use ``composer require guzzlehttp/guzzle-services:0.6``.
+
+**Note:** If Composer is not installed [globally](https://getcomposer.org/doc/00-intro.md#globally) then you may need to run the preceding Composer commands using ``php composer.phar`` (where ``composer.phar`` is the path to your copy of Composer), instead of just ``composer``.
+
+## Plugins
+
+* Load Service description from file [https://github.com/gimler/guzzle-description-loader]
+
+## Transition guide from Guzzle 5.0 to 6.0
+ 
+### Change regarding PostField and PostFile
+
+The request locations `postField` and `postFile` were removed in favor of `formParam` and `multipart`. If your description looks like
+ 
+```php
+[
+    'baseUri' => 'http://httpbin.org/',
+    'operations' => [
+        'testing' => [
+            'httpMethod' => 'GET',
+            'uri' => '/get{?foo}',
+            'responseModel' => 'getResponse',
+            'parameters' => [
+                'foo' => [
+                    'type' => 'string',
+                    'location' => 'postField'
+                ],
+                'bar' => [
+                    'type' => 'string',
+                    'location' => 'postFile'
+                ]
+            ]
+        ]
+    ],
+]
+```
+
+you need to change `postField` to `formParam` and `postFile` to `multipart`. 
+
+More documentation coming soon.
+
+## Cookbook
+
+### Changing the way query params are serialized
+
+By default, query params are serialized using strict RFC3986 rules, using `http_build_query` method. With this, array params are serialized this way:
+
+```php
+$client->myMethod(['foo' => ['bar', 'baz']]);
+
+// Query params will be foo[0]=bar&foo[1]=baz
+```
+
+However, a lot of APIs in the wild require the numeric indices to be removed, so that the query params end up being `foo[]=bar&foo[]=baz`. You
+can easily change the behaviour by creating your own serializer and overriding the "query" request location:
+
+```php
+use GuzzleHttp\Command\Guzzle\GuzzleClient;
+use GuzzleHttp\Command\Guzzle\RequestLocation\QueryLocation;
+use GuzzleHttp\Command\Guzzle\QuerySerializer\Rfc3986Serializer;
+use GuzzleHttp\Command\Guzzle\Serializer;
+
+$queryLocation = new QueryLocation('query', new Rfc3986Serializer(true));
+$serializer = new Serializer($description, ['query' => $queryLocation]);
+$guzzleClient = new GuzzleClient($client, $description, $serializer);
+```
+
+You can also create your own serializer if you have specific needs.
+
+## Security
+
+If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle-services/security/policy) for more information.
+
+## License
+
+Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
+## For Enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle-services?utm_source=packagist-guzzlehttp-guzzle-services&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

+ 59 - 0
addons/cos/library/Guzzle/guzzle-services/composer.json

@@ -0,0 +1,59 @@
+{
+    "name": "guzzlehttp/guzzle-services",
+    "description": "Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Graham Campbell",
+            "email": "hello@gjcampbell.co.uk",
+            "homepage": "https://github.com/GrahamCampbell"
+        },
+        {
+            "name": "Michael Dowling",
+            "email": "mtdowling@gmail.com",
+            "homepage": "https://github.com/mtdowling"
+        },
+        {
+            "name": "Stefano Kowalke",
+            "email": "blueduck@mail.org",
+            "homepage": "https://github.com/Konafets"
+        },
+        {
+            "name": "Tobias Nyholm",
+            "email": "tobias.nyholm@gmail.com",
+            "homepage": "https://github.com/Nyholm"
+        }
+    ],
+    "require": {
+        "php": "^7.2.5 || ^8.0",
+        "guzzlehttp/guzzle": "^7.4.1",
+        "guzzlehttp/command": "^1.2.2",
+        "guzzlehttp/psr7": "^1.8.3 || ^2.1",
+        "guzzlehttp/uri-template": "^1.0.1"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "^8.5.19 || ^9.5.8"
+    },
+    "autoload": {
+        "psr-4": {
+            "GuzzleHttp\\Command\\Guzzle\\": "src/"
+        }
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "GuzzleHttp\\Tests\\Command\\Guzzle\\": "tests/"
+        }
+    },
+    "suggest": {
+        "gimler/guzzle-description-loader": "^0.0.4"
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "1.3-dev"
+        }
+    },
+    "config": {
+        "preferred-install": "dist",
+        "sort-packages": true
+    }
+}

+ 23 - 0
addons/cos/library/Guzzle/guzzle-services/phpunit.xml.dist

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit
+    backupGlobals="true"
+    beStrictAboutOutputDuringTests="true"
+    beStrictAboutTestsThatDoNotTestAnything="true"
+    bootstrap="vendor/autoload.php"
+    colors="true"
+    convertDeprecationsToExceptions="true"
+    convertErrorsToExceptions="true"
+    convertNoticesToExceptions="true"
+    convertWarningsToExceptions="true"
+>
+    <testsuites>
+        <testsuite name="unit">
+            <directory>tests</directory>
+        </testsuite>
+    </testsuites>
+    <filter>
+        <whitelist>
+            <directory>src</directory>
+        </whitelist>
+    </filter>
+</phpunit>

+ 265 - 0
addons/cos/library/Guzzle/guzzle-services/src/Description.php

@@ -0,0 +1,265 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\Psr7\Uri;
+
+/**
+ * Represents a Guzzle service description
+ */
+class Description implements DescriptionInterface
+{
+    /** @var array Array of {@see OperationInterface} objects */
+    private $operations = [];
+
+    /** @var array Array of API models */
+    private $models = [];
+
+    /** @var string Name of the API */
+    private $name;
+
+    /** @var string API version */
+    private $apiVersion;
+
+    /** @var string Summary of the API */
+    private $description;
+
+    /** @var array Any extra API data */
+    private $extraData = [];
+
+    /** @var Uri baseUri/basePath */
+    private $baseUri;
+
+    /** @var SchemaFormatter */
+    private $formatter;
+
+    /**
+     * @param array $config  Service description data
+     * @param array $options Custom options to apply to the description
+     *     - formatter: Can provide a custom SchemaFormatter class
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function __construct(array $config, array $options = [])
+    {
+        // Keep a list of default keys used in service descriptions that is
+        // later used to determine extra data keys.
+        static $defaultKeys = ['name', 'models', 'apiVersion', 'description'];
+
+        // Pull in the default configuration values
+        foreach ($defaultKeys as $key) {
+            if (isset($config[$key])) {
+                $this->{$key} = $config[$key];
+            }
+        }
+
+        // Set the baseUri
+        // Account for the old style of using baseUrl
+        if (isset($config['baseUrl'])) {
+            $config['baseUri'] = $config['baseUrl'];
+        }
+        $this->baseUri = isset($config['baseUri']) ? new Uri($config['baseUri']) : new Uri();
+
+        // Ensure that the models and operations properties are always arrays
+        $this->models = (array) $this->models;
+        $this->operations = (array) $this->operations;
+
+        // We want to add operations differently than adding the other properties
+        $defaultKeys[] = 'operations';
+
+        // Create operations for each operation
+        if (isset($config['operations'])) {
+            foreach ($config['operations'] as $name => $operation) {
+                if (!is_array($operation)) {
+                    throw new \InvalidArgumentException('Operations must be arrays');
+                }
+                $this->operations[$name] = $operation;
+            }
+        }
+
+        // Get all of the additional properties of the service description and
+        // store them in a data array
+        foreach (array_diff(array_keys($config), $defaultKeys) as $key) {
+            $this->extraData[$key] = $config[$key];
+        }
+
+        // Configure the schema formatter
+        if (isset($options['formatter'])) {
+            $this->formatter = $options['formatter'];
+        } else {
+            static $defaultFormatter;
+            if (!$defaultFormatter) {
+                $defaultFormatter = new SchemaFormatter();
+            }
+            $this->formatter = $defaultFormatter;
+        }
+    }
+
+    /**
+     * Get the basePath/baseUri of the description
+     *
+     * @return Uri
+     */
+    public function getBaseUri()
+    {
+        return $this->baseUri;
+    }
+
+    /**
+     * Get the API operations of the service
+     *
+     * @return Operation[] Returns an array of {@see Operation} objects
+     */
+    public function getOperations()
+    {
+        return $this->operations;
+    }
+
+    /**
+     * Check if the service has an operation by name
+     *
+     * @param string $name Name of the operation to check
+     *
+     * @return bool
+     */
+    public function hasOperation($name)
+    {
+        return isset($this->operations[$name]);
+    }
+
+    /**
+     * Get an API operation by name
+     *
+     * @param string $name Name of the command
+     *
+     * @return Operation
+     * @throws \InvalidArgumentException if the operation is not found
+     */
+    public function getOperation($name)
+    {
+        if (!$this->hasOperation($name)) {
+            throw new \InvalidArgumentException("No operation found named $name");
+        }
+
+        // Lazily create operations as they are retrieved
+        if (!($this->operations[$name] instanceof Operation)) {
+            $this->operations[$name]['name'] = $name;
+            $this->operations[$name] = new Operation($this->operations[$name], $this);
+        }
+
+        return $this->operations[$name];
+    }
+
+    /**
+     * Get a shared definition structure.
+     *
+     * @param string $id ID/name of the model to retrieve
+     *
+     * @return Parameter
+     * @throws \InvalidArgumentException if the model is not found
+     */
+    public function getModel($id)
+    {
+        if (!$this->hasModel($id)) {
+            throw new \InvalidArgumentException("No model found named $id");
+        }
+
+        // Lazily create models as they are retrieved
+        if (!($this->models[$id] instanceof Parameter)) {
+            $this->models[$id] = new Parameter(
+                $this->models[$id],
+                ['description' => $this]
+            );
+        }
+
+        return $this->models[$id];
+    }
+
+    /**
+     * Get all models of the service description.
+     *
+     * @return array
+     */
+    public function getModels()
+    {
+        $models = [];
+        foreach ($this->models as $name => $model) {
+            $models[$name] = $this->getModel($name);
+        }
+
+        return $models;
+    }
+
+    /**
+     * Check if the service description has a model by name.
+     *
+     * @param string $id Name/ID of the model to check
+     *
+     * @return bool
+     */
+    public function hasModel($id)
+    {
+        return isset($this->models[$id]);
+    }
+
+    /**
+     * Get the API version of the service
+     *
+     * @return string
+     */
+    public function getApiVersion()
+    {
+        return $this->apiVersion;
+    }
+
+    /**
+     * Get the name of the API
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Get a summary of the purpose of the API
+     *
+     * @return string
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * Format a parameter using named formats.
+     *
+     * @param string $format Format to convert it to
+     * @param mixed  $input  Input string
+     *
+     * @return mixed
+     */
+    public function format($format, $input)
+    {
+        return $this->formatter->format($format, $input);
+    }
+
+    /**
+     * Get arbitrary data from the service description that is not part of the
+     * Guzzle service description specification.
+     *
+     * @param string $key Data key to retrieve or null to retrieve all extra
+     *
+     * @return null|mixed
+     */
+    public function getData($key = null)
+    {
+        if ($key === null) {
+            return $this->extraData;
+        } elseif (isset($this->extraData[$key])) {
+            return $this->extraData[$key];
+        } else {
+            return null;
+        }
+    }
+}

+ 107 - 0
addons/cos/library/Guzzle/guzzle-services/src/DescriptionInterface.php

@@ -0,0 +1,107 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\Psr7\Uri;
+
+interface DescriptionInterface
+{
+    /**
+     * Get the basePath/baseUri of the description
+     *
+     * @return Uri
+     */
+    public function getBaseUri();
+
+    /**
+     * Get the API operations of the service
+     *
+     * @return Operation[] Returns an array of {@see Operation} objects
+     */
+    public function getOperations();
+
+    /**
+     * Check if the service has an operation by name
+     *
+     * @param string $name Name of the operation to check
+     *
+     * @return bool
+     */
+    public function hasOperation($name);
+
+    /**
+     * Get an API operation by name
+     *
+     * @param string $name Name of the command
+     *
+     * @return Operation
+     * @throws \InvalidArgumentException if the operation is not found
+     */
+    public function getOperation($name);
+
+    /**
+     * Get a shared definition structure.
+     *
+     * @param string $id ID/name of the model to retrieve
+     *
+     * @return Parameter
+     * @throws \InvalidArgumentException if the model is not found
+     */
+    public function getModel($id);
+
+    /**
+     * Get all models of the service description.
+     *
+     * @return array
+     */
+    public function getModels();
+
+    /**
+     * Check if the service description has a model by name.
+     *
+     * @param string $id Name/ID of the model to check
+     *
+     * @return bool
+     */
+    public function hasModel($id);
+
+    /**
+     * Get the API version of the service
+     *
+     * @return string
+     */
+    public function getApiVersion();
+
+    /**
+     * Get the name of the API
+     *
+     * @return string
+     */
+    public function getName();
+
+    /**
+     * Get a summary of the purpose of the API
+     *
+     * @return string
+     */
+    public function getDescription();
+
+    /**
+     * Format a parameter using named formats.
+     *
+     * @param string $format Format to convert it to
+     * @param mixed  $input  Input string
+     *
+     * @return mixed
+     */
+    public function format($format, $input);
+
+    /**
+     * Get arbitrary data from the service description that is not part of the
+     * Guzzle service description specification.
+     *
+     * @param string $key Data key to retrieve or null to retrieve all extra
+     *
+     * @return null|mixed
+     */
+    public function getData($key = null);
+}

+ 294 - 0
addons/cos/library/Guzzle/guzzle-services/src/Deserializer.php

@@ -0,0 +1,294 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\ResponseLocation\BodyLocation;
+use GuzzleHttp\Command\Guzzle\ResponseLocation\HeaderLocation;
+use GuzzleHttp\Command\Guzzle\ResponseLocation\JsonLocation;
+use GuzzleHttp\Command\Guzzle\ResponseLocation\ReasonPhraseLocation;
+use GuzzleHttp\Command\Guzzle\ResponseLocation\ResponseLocationInterface;
+use GuzzleHttp\Command\Guzzle\ResponseLocation\StatusCodeLocation;
+use GuzzleHttp\Command\Guzzle\ResponseLocation\XmlLocation;
+use GuzzleHttp\Command\Result;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Handler used to create response models based on an HTTP response and
+ * a service description.
+ *
+ * Response location visitors are registered with this Handler to handle
+ * locations (e.g., 'xml', 'json', 'header'). All of the locations of a response
+ * model that will be visited first have their ``before`` method triggered.
+ * After the before method is called on every visitor that will be walked, each
+ * visitor is triggered using the ``visit()`` method. After all of the visitors
+ * are visited, the ``after()`` method is called on each visitor. This is the
+ * place in which you should handle things like additionalProperties with
+ * custom locations (i.e., this is how it is handled in the JSON visitor).
+ */
+class Deserializer
+{
+    /** @var ResponseLocationInterface[] $responseLocations */
+    private $responseLocations;
+
+    /** @var DescriptionInterface $description */
+    private $description;
+
+    /** @var boolean $process */
+    private $process;
+
+    /**
+     * @param DescriptionInterface $description
+     * @param bool $process
+     * @param ResponseLocationInterface[] $responseLocations Extra response locations
+     */
+    public function __construct(
+        DescriptionInterface $description,
+        $process,
+        array $responseLocations = []
+    ) {
+        static $defaultResponseLocations;
+        if (!$defaultResponseLocations) {
+            $defaultResponseLocations = [
+                'body'         => new BodyLocation(),
+                'header'       => new HeaderLocation(),
+                'reasonPhrase' => new ReasonPhraseLocation(),
+                'statusCode'   => new StatusCodeLocation(),
+                'xml'          => new XmlLocation(),
+                'json'         => new JsonLocation(),
+            ];
+        }
+
+        $this->responseLocations = $responseLocations + $defaultResponseLocations;
+        $this->description = $description;
+        $this->process = $process;
+    }
+
+    /**
+     * Deserialize the response into the specified result representation
+     *
+     * @param ResponseInterface     $response
+     * @param RequestInterface|null $request
+     * @param CommandInterface      $command
+     * @return Result|ResultInterface|void|ResponseInterface
+     */
+    public function __invoke(ResponseInterface $response, RequestInterface $request, CommandInterface $command)
+    {
+        // If the user don't want to process the result, just return the plain response here
+        if ($this->process === false) {
+            return $response;
+        }
+
+        $name = $command->getName();
+        $operation = $this->description->getOperation($name);
+
+        $this->handleErrorResponses($response, $request, $command, $operation);
+
+        // Add a default Model as the result if no matching schema was found
+        if (!($modelName = $operation->getResponseModel())) {
+            // Not sure if this should be empty or contains the response.
+            // Decided to do it how it was in the old version for now.
+            return new Result();
+        }
+
+        $model = $operation->getServiceDescription()->getModel($modelName);
+        if (!$model) {
+            throw new \RuntimeException("Unknown model: {$modelName}");
+        }
+
+        return $this->visit($model, $response);
+    }
+
+    /**
+     * Handles visit() and after() methods of the Response locations
+     *
+     * @param Parameter         $model
+     * @param ResponseInterface $response
+     * @return Result|ResultInterface|void
+     */
+    protected function visit(Parameter $model, ResponseInterface $response)
+    {
+        $result = new Result();
+        $context = ['visitors' => []];
+
+        if ($model->getType() === 'object') {
+            $result = $this->visitOuterObject($model, $result, $response, $context);
+        } elseif ($model->getType() === 'array') {
+            $result = $this->visitOuterArray($model, $result, $response, $context);
+        } else {
+            throw new \InvalidArgumentException('Invalid response model: ' . $model->getType());
+        }
+
+        // Call the after() method of each found visitor
+        /** @var ResponseLocationInterface $visitor */
+        foreach ($context['visitors'] as $visitor) {
+            $result = $visitor->after($result, $response, $model);
+        }
+
+        return $result;
+    }
+
+    /**
+     * Handles the before() method of Response locations
+     *
+     * @param string            $location
+     * @param Parameter         $model
+     * @param ResultInterface   $result
+     * @param ResponseInterface $response
+     * @param array             $context
+     * @return ResultInterface
+     */
+    private function triggerBeforeVisitor(
+        $location,
+        Parameter $model,
+        ResultInterface $result,
+        ResponseInterface $response,
+        array &$context
+    ) {
+        if (!isset($this->responseLocations[$location])) {
+            throw new \RuntimeException("Unknown location: $location");
+        }
+
+        $context['visitors'][$location] = $this->responseLocations[$location];
+
+        $result = $this->responseLocations[$location]->before(
+            $result,
+            $response,
+            $model
+        );
+
+        return $result;
+    }
+
+    /**
+     * Visits the outer object
+     *
+     * @param Parameter         $model
+     * @param ResultInterface   $result
+     * @param ResponseInterface $response
+     * @param array             $context
+     * @return ResultInterface
+     */
+    private function visitOuterObject(
+        Parameter $model,
+        ResultInterface $result,
+        ResponseInterface $response,
+        array &$context
+    ) {
+        $parentLocation = $model->getLocation();
+
+        // If top-level additionalProperties is a schema, then visit it
+        $additional = $model->getAdditionalProperties();
+        if ($additional instanceof Parameter) {
+            // Use the model location if none set on additionalProperties.
+            $location = $additional->getLocation() ?: $parentLocation;
+            $result = $this->triggerBeforeVisitor($location, $model, $result, $response, $context);
+        }
+
+        // Use 'location' from all individual defined properties, but fall back
+        // to the model location if no per-property location is set. Collect
+        // the properties that need to be visited into an array.
+        $visitProperties = [];
+        foreach ($model->getProperties() as $schema) {
+            $location = $schema->getLocation() ?: $parentLocation;
+            if ($location) {
+                $visitProperties[] = [$location, $schema];
+                // Trigger the before method on each unique visitor location
+                if (!isset($context['visitors'][$location])) {
+                    $result = $this->triggerBeforeVisitor($location, $model, $result, $response, $context);
+                }
+            }
+        }
+
+        // Actually visit each response element
+        foreach ($visitProperties as $property) {
+            $result = $this->responseLocations[$property[0]]->visit($result, $response, $property[1]);
+        }
+
+        return $result;
+    }
+
+    /**
+     * Visits the outer array
+     *
+     * @param Parameter         $model
+     * @param ResultInterface   $result
+     * @param ResponseInterface $response
+     * @param array             $context
+     * @return ResultInterface|void
+     */
+    private function visitOuterArray(
+        Parameter $model,
+        ResultInterface $result,
+        ResponseInterface $response,
+        array &$context
+    ) {
+        // Use 'location' defined on the top of the model
+        if (!($location = $model->getLocation())) {
+            return;
+        }
+
+        // Trigger the before method on each unique visitor location
+        if (!isset($context['visitors'][$location])) {
+            $result = $this->triggerBeforeVisitor($location, $model, $result, $response, $context);
+        }
+
+        // Visit each item in the response
+        $result = $this->responseLocations[$location]->visit($result, $response, $model);
+
+        return $result;
+    }
+
+    /**
+     * Reads the "errorResponses" from commands, and trigger appropriate exceptions
+     *
+     * In order for the exception to be properly triggered, all your exceptions must be instance
+     * of "GuzzleHttp\Command\Exception\CommandException". If that's not the case, your exceptions will be wrapped
+     * around a CommandException
+     *
+     * @param ResponseInterface $response
+     * @param RequestInterface  $request
+     * @param CommandInterface  $command
+     * @param Operation         $operation
+     */
+    protected function handleErrorResponses(
+        ResponseInterface $response,
+        RequestInterface $request,
+        CommandInterface $command,
+        Operation $operation
+    ) {
+        $errors = $operation->getErrorResponses();
+
+        // We iterate through each errors in service description. If the descriptor contains both a phrase and
+        // status code, there must be an exact match of both. Otherwise, a match of status code is enough
+        $bestException = null;
+
+        foreach ($errors as $error) {
+            $code = (int) $error['code'];
+
+            if ($response->getStatusCode() !== $code) {
+                continue;
+            }
+
+            if (isset($error['phrase']) && ! ($error['phrase'] === $response->getReasonPhrase())) {
+                continue;
+            }
+
+            $bestException = $error['class'];
+
+            // If there is an exact match of phrase + code, then we cannot find a more specialized exception in
+            // the array, so we can break early instead of iterating the remaining ones
+            if (isset($error['phrase'])) {
+                break;
+            }
+        }
+
+        if (null !== $bestException) {
+            throw new $bestException($response->getReasonPhrase(), $command, null, $request, $response);
+        }
+
+        // If we reach here, no exception could be match from descriptor, and Guzzle exception will propagate if
+        // option "http_errors" is set to true, which is the default setting.
+    }
+}

+ 169 - 0
addons/cos/library/Guzzle/guzzle-services/src/GuzzleClient.php

@@ -0,0 +1,169 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Handler\ValidatedDescriptionHandler;
+use GuzzleHttp\Command\ServiceClient;
+use GuzzleHttp\HandlerStack;
+
+/**
+ * Default Guzzle web service client implementation.
+ */
+class GuzzleClient extends ServiceClient
+{
+    /** @var array $config */
+    private $config;
+
+    /** @var DescriptionInterface Guzzle service description */
+    private $description;
+
+    /**
+     * The client constructor accepts an associative array of configuration
+     * options:
+     *
+     * - defaults: Associative array of default command parameters to add to
+     *   each command created by the client.
+     * - validate: Specify if command input is validated (defaults to true).
+     *   Changing this setting after the client has been created will have no
+     *   effect.
+     * - process: Specify if HTTP responses are parsed (defaults to true).
+     *   Changing this setting after the client has been created will have no
+     *   effect.
+     * - response_locations: Associative array of location types mapping to
+     *   ResponseLocationInterface objects.
+     *
+     * @param ClientInterface $client HTTP client to use.
+     * @param DescriptionInterface $description Guzzle service description
+     * @param callable $commandToRequestTransformer
+     * @param callable $responseToResultTransformer
+     * @param HandlerStack $commandHandlerStack
+     * @param array $config Configuration options
+     */
+    public function __construct(
+        ClientInterface $client,
+        DescriptionInterface $description,
+        callable $commandToRequestTransformer = null,
+        callable $responseToResultTransformer = null,
+        HandlerStack $commandHandlerStack = null,
+        array $config = []
+    ) {
+        $this->config = $config;
+        $this->description = $description;
+        $serializer = $this->getSerializer($commandToRequestTransformer);
+        $deserializer = $this->getDeserializer($responseToResultTransformer);
+
+        parent::__construct($client, $serializer, $deserializer, $commandHandlerStack);
+        $this->processConfig($config);
+    }
+
+    /**
+     * Returns the command if valid; otherwise an Exception
+     * @param string $name
+     * @param array  $args
+     * @return CommandInterface
+     * @throws \InvalidArgumentException
+     */
+    public function getCommand($name, array $args = [])
+    {
+        if (!$this->description->hasOperation($name)) {
+            $name = ucfirst($name);
+            if (!$this->description->hasOperation($name)) {
+                throw new \InvalidArgumentException(
+                    "No operation found named {$name}"
+                );
+            }
+        }
+
+        // Merge in default command options
+        $args += $this->getConfig('defaults');
+
+        return parent::getCommand($name, $args);
+    }
+
+    /**
+     * Return the description
+     *
+     * @return DescriptionInterface
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * Returns the passed Serializer when set, a new instance otherwise
+     *
+     * @param callable|null $commandToRequestTransformer
+     * @return \GuzzleHttp\Command\Guzzle\Serializer
+     */
+    private function getSerializer($commandToRequestTransformer)
+    {
+        return $commandToRequestTransformer !== null
+            ? $commandToRequestTransformer
+            : new Serializer($this->description);
+    }
+
+    /**
+     * Returns the passed Deserializer when set, a new instance otherwise
+     *
+     * @param callable|null $responseToResultTransformer
+     * @return \GuzzleHttp\Command\Guzzle\Deserializer
+     */
+    private function getDeserializer($responseToResultTransformer)
+    {
+        $process = (! isset($this->config['process']) || $this->config['process'] === true);
+
+        return $responseToResultTransformer !== null
+            ? $responseToResultTransformer
+            : new Deserializer($this->description, $process);
+    }
+
+    /**
+     * Get the config of the client
+     *
+     * @param array|string $option
+     * @return mixed
+     */
+    public function getConfig($option = null)
+    {
+        return $option === null
+            ? $this->config
+            : (isset($this->config[$option]) ? $this->config[$option] : []);
+    }
+
+    /**
+     * @param $option
+     * @param $value
+     */
+    public function setConfig($option, $value)
+    {
+        $this->config[$option] = $value;
+    }
+
+    /**
+     * Prepares the client based on the configuration settings of the client.
+     *
+     * @param array $config Constructor config as an array
+     */
+    protected function processConfig(array $config)
+    {
+        // set defaults as an array if not provided
+        if (!isset($config['defaults'])) {
+            $config['defaults'] = [];
+        }
+
+        // Add the handlers based on the configuration option
+        $stack = $this->getHandlerStack();
+
+        if (!isset($config['validate']) || $config['validate'] === true) {
+            $stack->push(new ValidatedDescriptionHandler($this->description), 'validate_description');
+        }
+
+        if (!isset($config['process']) || $config['process'] === true) {
+            // TODO: This belongs to the Deserializer and should be handled there.
+            // Question: What is the result when the Deserializer is bypassed?
+            // Possible answer: The raw response.
+        }
+    }
+}

+ 82 - 0
addons/cos/library/Guzzle/guzzle-services/src/Handler/ValidatedDescriptionHandler.php

@@ -0,0 +1,82 @@
+<?php namespace GuzzleHttp\Command\Guzzle\Handler;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Exception\CommandException;
+use GuzzleHttp\Command\Guzzle\DescriptionInterface;
+use GuzzleHttp\Command\Guzzle\SchemaValidator;
+
+/**
+ * Handler used to validate command input against a service description.
+ *
+ * @author Stefano Kowalke <info@arroba-it.de>
+ */
+class ValidatedDescriptionHandler
+{
+    /** @var SchemaValidator $validator */
+    private $validator;
+
+    /** @var DescriptionInterface $description */
+    private $description;
+
+    /**
+     * ValidatedDescriptionHandler constructor.
+     *
+     * @param DescriptionInterface $description
+     * @param SchemaValidator|null $schemaValidator
+     */
+    public function __construct(DescriptionInterface $description, SchemaValidator $schemaValidator = null)
+    {
+        $this->description = $description;
+        $this->validator = $schemaValidator ?: new SchemaValidator();
+    }
+
+    /**
+     * @param callable $handler
+     * @return \Closure
+     */
+    public function __invoke(callable $handler)
+    {
+        return function (CommandInterface $command) use ($handler) {
+            $errors = [];
+            $operation = $this->description->getOperation($command->getName());
+
+            foreach ($operation->getParams() as $name => $schema) {
+                $value = $command[$name];
+
+                if ($value) {
+                    $value = $schema->filter($value);
+                }
+
+                if (! $this->validator->validate($schema, $value)) {
+                    $errors = array_merge($errors, $this->validator->getErrors());
+                } elseif ($value !== $command[$name]) {
+                    // Update the config value if it changed and no validation errors were encountered.
+                    // This happen when the user extending an operation
+                    // See https://github.com/guzzle/guzzle-services/issues/145
+                    $command[$name] = $value;
+                }
+            }
+
+            if ($params = $operation->getAdditionalParameters()) {
+                foreach ($command->toArray() as $name => $value) {
+                    // It's only additional if it isn't defined in the schema
+                    if (! $operation->hasParam($name)) {
+                        // Always set the name so that error messages are useful
+                        $params->setName($name);
+                        if (! $this->validator->validate($params, $value)) {
+                            $errors = array_merge($errors, $this->validator->getErrors());
+                        } elseif ($value !== $command[$name]) {
+                            $command[$name] = $value;
+                        }
+                    }
+                }
+            }
+
+            if ($errors) {
+                throw new CommandException('Validation errors: ' . implode("\n", $errors), $command);
+            }
+
+            return $handler($command);
+        };
+    }
+}

+ 312 - 0
addons/cos/library/Guzzle/guzzle-services/src/Operation.php

@@ -0,0 +1,312 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\Command\ToArrayInterface;
+
+/**
+ * Guzzle operation
+ */
+class Operation implements ToArrayInterface
+{
+    /** @var array Parameters */
+    private $parameters = [];
+
+    /** @var Parameter Additional parameters schema */
+    private $additionalParameters;
+
+    /** @var DescriptionInterface */
+    private $description;
+
+    /** @var array Config data */
+    private $config;
+
+    /**
+     * Builds an Operation object using an array of configuration data.
+     *
+     * - name: (string) Name of the command
+     * - httpMethod: (string) HTTP method of the operation
+     * - uri: (string) URI template that can create a relative or absolute URL
+     * - parameters: (array) Associative array of parameters for the command.
+     *   Each value must be an array that is used to create {@see Parameter}
+     *   objects.
+     * - summary: (string) This is a short summary of what the operation does
+     * - notes: (string) A longer description of the operation.
+     * - documentationUrl: (string) Reference URL providing more information
+     *   about the operation.
+     * - responseModel: (string) The model name used for processing response.
+     * - deprecated: (bool) Set to true if this is a deprecated command
+     * - errorResponses: (array) Errors that could occur when executing the
+     *   command. Array of hashes, each with a 'code' (the HTTP response code),
+     *   'phrase' (response reason phrase or description of the error), and
+     *   'class' (a custom exception class that would be thrown if the error is
+     *   encountered).
+     * - data: (array) Any extra data that might be used to help build or
+     *   serialize the operation
+     * - additionalParameters: (null|array) Parameter schema to use when an
+     *   option is passed to the operation that is not in the schema
+     *
+     * @param array                 $config      Array of configuration data
+     * @param DescriptionInterface  $description Service description used to resolve models if $ref tags are found
+     * @throws \InvalidArgumentException
+     */
+    public function __construct(array $config = [], DescriptionInterface $description = null)
+    {
+        static $defaults = [
+            'name' => '',
+            'httpMethod' => '',
+            'uri' => '',
+            'responseModel' => null,
+            'notes' => '',
+            'summary' => '',
+            'documentationUrl' => null,
+            'deprecated' => false,
+            'data' => [],
+            'parameters' => [],
+            'additionalParameters' => null,
+            'errorResponses' => []
+        ];
+
+        $this->description = $description === null ? new Description([]) : $description;
+
+        if (isset($config['extends'])) {
+            $config = $this->resolveExtends($config['extends'], $config);
+        }
+
+        $this->config = $config + $defaults;
+
+        // Account for the old style of using responseClass
+        if (isset($config['responseClass'])) {
+            $this->config['responseModel'] = $config['responseClass'];
+        }
+
+        $this->resolveParameters();
+    }
+
+    /**
+     * @return array
+     */
+    public function toArray()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Get the service description that the operation belongs to
+     *
+     * @return Description
+     */
+    public function getServiceDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * Get the params of the operation
+     *
+     * @return Parameter[]
+     */
+    public function getParams()
+    {
+        return $this->parameters;
+    }
+
+    /**
+     * Get additionalParameters of the operation
+     *
+     * @return Parameter|null
+     */
+    public function getAdditionalParameters()
+    {
+        return $this->additionalParameters;
+    }
+
+    /**
+     * Check if the operation has a specific parameter by name
+     *
+     * @param string $name Name of the param
+     *
+     * @return bool
+     */
+    public function hasParam($name)
+    {
+        return isset($this->parameters[$name]);
+    }
+
+    /**
+     * Get a single parameter of the operation
+     *
+     * @param string $name Parameter to retrieve by name
+     *
+     * @return Parameter|null
+     */
+    public function getParam($name)
+    {
+        return isset($this->parameters[$name])
+            ? $this->parameters[$name]
+            : null;
+    }
+
+    /**
+     * Get the HTTP method of the operation
+     *
+     * @return string|null
+     */
+    public function getHttpMethod()
+    {
+        return $this->config['httpMethod'];
+    }
+
+    /**
+     * Get the name of the operation
+     *
+     * @return string|null
+     */
+    public function getName()
+    {
+        return $this->config['name'];
+    }
+
+    /**
+     * Get a short summary of what the operation does
+     *
+     * @return string|null
+     */
+    public function getSummary()
+    {
+        return $this->config['summary'];
+    }
+
+    /**
+     * Get a longer text field to explain the behavior of the operation
+     *
+     * @return string|null
+     */
+    public function getNotes()
+    {
+        return $this->config['notes'];
+    }
+
+    /**
+     * Get the documentation URL of the operation
+     *
+     * @return string|null
+     */
+    public function getDocumentationUrl()
+    {
+        return $this->config['documentationUrl'];
+    }
+
+    /**
+     * Get the name of the model used for processing the response.
+     *
+     * @return string
+     */
+    public function getResponseModel()
+    {
+        return $this->config['responseModel'];
+    }
+
+    /**
+     * Get whether or not the operation is deprecated
+     *
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->config['deprecated'];
+    }
+
+    /**
+     * Get the URI that will be merged into the generated request
+     *
+     * @return string
+     */
+    public function getUri()
+    {
+        return $this->config['uri'];
+    }
+
+    /**
+     * Get the errors that could be encountered when executing the operation
+     *
+     * @return array
+     */
+    public function getErrorResponses()
+    {
+        return $this->config['errorResponses'];
+    }
+
+    /**
+     * Get extra data from the operation
+     *
+     * @param string $name Name of the data point to retrieve or null to
+     *     retrieve all of the extra data.
+     *
+     * @return mixed|null
+     */
+    public function getData($name = null)
+    {
+        if ($name === null) {
+            return $this->config['data'];
+        } elseif (isset($this->config['data'][$name])) {
+            return $this->config['data'][$name];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * @param $name
+     * @param array $config
+     * @return array
+     */
+    private function resolveExtends($name, array $config)
+    {
+        if (!$this->description->hasOperation($name)) {
+            throw new \InvalidArgumentException('No operation named ' . $name);
+        }
+
+        // Merge parameters together one level deep
+        $base = $this->description->getOperation($name)->toArray();
+        $result = $config + $base;
+
+        if (isset($base['parameters']) && isset($config['parameters'])) {
+            $result['parameters'] = $config['parameters'] + $base['parameters'];
+        }
+
+        return $result;
+    }
+
+    /**
+     * Process the description and extract the parameter config
+     *
+     * @return void
+     */
+    private function resolveParameters()
+    {
+        // Parameters need special handling when adding
+        foreach ($this->config['parameters'] as $name => $param) {
+            if (!is_array($param)) {
+                throw new \InvalidArgumentException(
+                    "Parameters must be arrays, {$this->config['name']}.$name is ".gettype($param)
+                );
+            }
+            $param['name'] = $name;
+            $this->parameters[$name] = new Parameter(
+                $param,
+                ['description' => $this->description]
+            );
+        }
+
+        if ($this->config['additionalParameters']) {
+            if (is_array($this->config['additionalParameters'])) {
+                $this->additionalParameters = new Parameter(
+                    $this->config['additionalParameters'],
+                    ['description' => $this->description]
+                );
+            } else {
+                $this->additionalParameters = $this->config['additionalParameters'];
+            }
+        }
+    }
+}

+ 655 - 0
addons/cos/library/Guzzle/guzzle-services/src/Parameter.php

@@ -0,0 +1,655 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\Command\ToArrayInterface;
+
+/**
+ * API parameter object used with service descriptions
+ */
+class Parameter implements ToArrayInterface
+{
+    private $originalData;
+
+    /** @var string $name */
+    private $name;
+
+    /** @var string $description */
+    private $description;
+
+    /** @var string|array $type */
+    private $type;
+
+    /** @var bool $required*/
+    private $required;
+
+    /** @var array|null $enum */
+    private $enum;
+
+    /** @var string $pattern */
+    private $pattern;
+
+    /** @var int $minimum*/
+    private $minimum;
+
+    /** @var int $maximum */
+    private $maximum;
+
+    /** @var int $minLength */
+    private $minLength;
+
+    /** @var int $maxLength */
+    private $maxLength;
+
+    /** @var int $minItems */
+    private $minItems;
+
+    /** @var int $maxItems */
+    private $maxItems;
+
+    /** @var mixed $default */
+    private $default;
+
+    /** @var bool $static */
+    private $static;
+
+    /** @var array $filters */
+    private $filters;
+
+    /** @var string $location */
+    private $location;
+
+    /** @var string $sentAs */
+    private $sentAs;
+
+    /** @var array $data */
+    private $data;
+
+    /** @var array $properties */
+    private $properties = [];
+
+    /** @var array|bool|Parameter $additionalProperties */
+    private $additionalProperties;
+
+    /** @var array|Parameter $items */
+    private $items;
+
+    /** @var string $format */
+    private $format;
+
+    private $propertiesCache = null;
+
+    /** @var Description */
+    private $serviceDescription;
+
+    /**
+     * Create a new Parameter using an associative array of data.
+     *
+     * The array can contain the following information:
+     *
+     * - name: (string) Unique name of the parameter
+     *
+     * - type: (string|array) Type of variable (string, number, integer,
+     *   boolean, object, array, numeric, null, any). Types are used for
+     *   validation and determining the structure of a parameter. You can use a
+     *   union type by providing an array of simple types. If one of the union
+     *   types matches the provided value, then the value is valid.
+     *
+     * - required: (bool) Whether or not the parameter is required
+     *
+     * - default: (mixed) Default value to use if no value is supplied
+     *
+     * - static: (bool) Set to true to specify that the parameter value cannot
+     *   be changed from the default.
+     *
+     * - description: (string) Documentation of the parameter
+     *
+     * - location: (string) The location of a request used to apply a parameter.
+     *   Custom locations can be registered with a command, but the defaults
+     *   are uri, query, header, body, json, xml, formParam, multipart.
+     *
+     * - sentAs: (string) Specifies how the data being modeled is sent over the
+     *   wire. For example, you may wish to include certain headers in a
+     *   response model that have a normalized casing of FooBar, but the actual
+     *   header is x-foo-bar. In this case, sentAs would be set to x-foo-bar.
+     *
+     * - filters: (array) Array of static method names to run a parameter
+     *   value through. Each value in the array must be a string containing the
+     *   full class path to a static method or an array of complex filter
+     *   information. You can specify static methods of classes using the full
+     *   namespace class name followed by '::' (e.g. Foo\Bar::baz). Some
+     *   filters require arguments in order to properly filter a value. For
+     *   complex filters, use a hash containing a 'method' key pointing to a
+     *   static method, and an 'args' key containing an array of positional
+     *   arguments to pass to the method. Arguments can contain keywords that
+     *   are replaced when filtering a value: '@value' is replaced with the
+     *   value being validated, '@api' is replaced with the Parameter object.
+     *
+     * - properties: When the type is an object, you can specify nested parameters
+     *
+     * - additionalProperties: (array) This attribute defines a schema for all
+     *   properties that are not explicitly defined in an object type
+     *   definition. If specified, the value MUST be a schema or a boolean. If
+     *   false is provided, no additional properties are allowed beyond the
+     *   properties defined in the schema. The default value is an empty schema
+     *   which allows any value for additional properties.
+     *
+     * - items: This attribute defines the allowed items in an instance array,
+     *   and MUST be a schema or an array of schemas. The default value is an
+     *   empty schema which allows any value for items in the instance array.
+     *   When this attribute value is a schema and the instance value is an
+     *   array, then all the items in the array MUST be valid according to the
+     *   schema.
+     *
+     * - pattern: When the type is a string, you can specify the regex pattern
+     *   that a value must match
+     *
+     * - enum: When the type is a string, you can specify a list of acceptable
+     *   values.
+     *
+     * - minItems: (int) Minimum number of items allowed in an array
+     *
+     * - maxItems: (int) Maximum number of items allowed in an array
+     *
+     * - minLength: (int) Minimum length of a string
+     *
+     * - maxLength: (int) Maximum length of a string
+     *
+     * - minimum: (int) Minimum value of an integer
+     *
+     * - maximum: (int) Maximum value of an integer
+     *
+     * - data: (array) Any additional custom data to use when serializing,
+     *   validating, etc
+     *
+     * - format: (string) Format used to coax a value into the correct format
+     *   when serializing or unserializing. You may specify either an array of
+     *   filters OR a format, but not both. Supported values: date-time, date,
+     *   time, timestamp, date-time-http, and boolean-string.
+     *
+     * - $ref: (string) String referencing a service description model. The
+     *   parameter is replaced by the schema contained in the model.
+     *
+     * @param array $data    Array of data as seen in service descriptions
+     * @param array $options Options used when creating the parameter. You can
+     *     specify a Guzzle service description in the 'description' key.
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function __construct(array $data = [], array $options = [])
+    {
+        $this->originalData = $data;
+
+        if (isset($options['description'])) {
+            $this->serviceDescription = $options['description'];
+            if (!($this->serviceDescription instanceof DescriptionInterface)) {
+                throw new \InvalidArgumentException('description must be a Description');
+            }
+            if (isset($data['$ref'])) {
+                if ($model = $this->serviceDescription->getModel($data['$ref'])) {
+                    $name = isset($data['name']) ? $data['name'] : null;
+                    $data = $model->toArray() + $data;
+                    if ($name) {
+                        $data['name'] = $name;
+                    }
+                }
+            } elseif (isset($data['extends'])) {
+                // If this parameter extends from another parameter then start
+                // with the actual data union in the parent's data (e.g. actual
+                // supersedes parent)
+                if ($extends = $this->serviceDescription->getModel($data['extends'])) {
+                    $data += $extends->toArray();
+                }
+            }
+        }
+
+        // Pull configuration data into the parameter
+        foreach ($data as $key => $value) {
+            $this->{$key} = $value;
+        }
+
+        $this->required = (bool) $this->required;
+        $this->data = (array) $this->data;
+
+        if ($this->filters) {
+            $this->setFilters((array) $this->filters);
+        }
+
+        if ($this->type == 'object' && $this->additionalProperties === null) {
+            $this->additionalProperties = true;
+        }
+    }
+
+    /**
+     * Convert the object to an array
+     *
+     * @return array
+     */
+    public function toArray()
+    {
+        return $this->originalData;
+    }
+
+    /**
+     * Get the default or static value of the command based on a value
+     *
+     * @param string $value Value that is currently set
+     *
+     * @return mixed Returns the value, a static value if one is present, or a default value
+     */
+    public function getValue($value)
+    {
+        if ($this->static || ($this->default !== null && $value === null)) {
+            return $this->default;
+        }
+
+        return $value;
+    }
+
+    /**
+     * Run a value through the filters OR format attribute associated with the
+     * parameter.
+     *
+     * @param mixed $value Value to filter
+     *
+     * @return mixed Returns the filtered value
+     * @throws \RuntimeException when trying to format when no service
+     *     description is available.
+     */
+    public function filter($value)
+    {
+        // Formats are applied exclusively and supersed filters
+        if ($this->format) {
+            if (!$this->serviceDescription) {
+                throw new \RuntimeException('No service description was set so '
+                    . 'the value cannot be formatted.');
+            }
+            return $this->serviceDescription->format($this->format, $value);
+        }
+
+        // Convert Boolean values
+        if ($this->type == 'boolean' && !is_bool($value)) {
+            $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
+        }
+
+        // Apply filters to the value
+        if ($this->filters) {
+            foreach ($this->filters as $filter) {
+                if (is_array($filter)) {
+                    // Convert complex filters that hold value place holders
+                    foreach ($filter['args'] as &$data) {
+                        if ($data == '@value') {
+                            $data = $value;
+                        } elseif ($data == '@api') {
+                            $data = $this;
+                        }
+                    }
+                    $value = call_user_func_array(
+                        $filter['method'],
+                        $filter['args']
+                    );
+                } else {
+                    $value = call_user_func($filter, $value);
+                }
+            }
+        }
+
+        return $value;
+    }
+
+    /**
+     * Get the name of the parameter
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Set the name of the parameter
+     *
+     * @param string $name Name to set
+     */
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    /**
+     * Get the key of the parameter, where sentAs will supersede name if it is
+     * set.
+     *
+     * @return string
+     */
+    public function getWireName()
+    {
+        return $this->sentAs ?: $this->name;
+    }
+
+    /**
+     * Get the type(s) of the parameter
+     *
+     * @return string|array
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    /**
+     * Get if the parameter is required
+     *
+     * @return bool
+     */
+    public function isRequired()
+    {
+        return $this->required;
+    }
+
+    /**
+     * Get the default value of the parameter
+     *
+     * @return string|null
+     */
+    public function getDefault()
+    {
+        return $this->default;
+    }
+
+    /**
+     * Get the description of the parameter
+     *
+     * @return string|null
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * Get the minimum acceptable value for an integer
+     *
+     * @return int|null
+     */
+    public function getMinimum()
+    {
+        return $this->minimum;
+    }
+
+    /**
+     * Get the maximum acceptable value for an integer
+     *
+     * @return int|null
+     */
+    public function getMaximum()
+    {
+        return $this->maximum;
+    }
+
+    /**
+     * Get the minimum allowed length of a string value
+     *
+     * @return int
+     */
+    public function getMinLength()
+    {
+        return $this->minLength;
+    }
+
+    /**
+     * Get the maximum allowed length of a string value
+     *
+     * @return int|null
+     */
+    public function getMaxLength()
+    {
+        return $this->maxLength;
+    }
+
+    /**
+     * Get the maximum allowed number of items in an array value
+     *
+     * @return int|null
+     */
+    public function getMaxItems()
+    {
+        return $this->maxItems;
+    }
+
+    /**
+     * Get the minimum allowed number of items in an array value
+     *
+     * @return int
+     */
+    public function getMinItems()
+    {
+        return $this->minItems;
+    }
+
+    /**
+     * Get the location of the parameter
+     *
+     * @return string|null
+     */
+    public function getLocation()
+    {
+        return $this->location;
+    }
+
+    /**
+     * Get the sentAs attribute of the parameter that used with locations to
+     * sentAs an attribute when it is being applied to a location.
+     *
+     * @return string|null
+     */
+    public function getSentAs()
+    {
+        return $this->sentAs;
+    }
+
+    /**
+     * Retrieve a known property from the parameter by name or a data property
+     * by name. When no specific name value is passed, all data properties
+     * will be returned.
+     *
+     * @param string|null $name Specify a particular property name to retrieve
+     *
+     * @return array|mixed|null
+     */
+    public function getData($name = null)
+    {
+        if (!$name) {
+            return $this->data;
+        } elseif (isset($this->data[$name])) {
+            return $this->data[$name];
+        } elseif (isset($this->{$name})) {
+            return $this->{$name};
+        }
+
+        return null;
+    }
+
+    /**
+     * Get whether or not the default value can be changed
+     *
+     * @return bool
+     */
+    public function isStatic()
+    {
+        return $this->static;
+    }
+
+    /**
+     * Get an array of filters used by the parameter
+     *
+     * @return array
+     */
+    public function getFilters()
+    {
+        return $this->filters ?: [];
+    }
+
+    /**
+     * Get the properties of the parameter
+     *
+     * @return Parameter[]
+     */
+    public function getProperties()
+    {
+        if (!$this->propertiesCache) {
+            $this->propertiesCache = [];
+            foreach (array_keys($this->properties) as $name) {
+                $this->propertiesCache[$name] = $this->getProperty($name);
+            }
+        }
+
+        return $this->propertiesCache;
+    }
+
+    /**
+     * Get a specific property from the parameter
+     *
+     * @param string $name Name of the property to retrieve
+     *
+     * @return null|Parameter
+     */
+    public function getProperty($name)
+    {
+        if (!isset($this->properties[$name])) {
+            return null;
+        }
+
+        if (!($this->properties[$name] instanceof self)) {
+            $this->properties[$name]['name'] = $name;
+            $this->properties[$name] = new static(
+                $this->properties[$name],
+                ['description' => $this->serviceDescription]
+            );
+        }
+
+        return $this->properties[$name];
+    }
+
+    /**
+     * Get the additionalProperties value of the parameter
+     *
+     * @return bool|Parameter|null
+     */
+    public function getAdditionalProperties()
+    {
+        if (is_array($this->additionalProperties)) {
+            $this->additionalProperties = new static(
+                $this->additionalProperties,
+                ['description' => $this->serviceDescription]
+            );
+        }
+
+        return $this->additionalProperties;
+    }
+
+    /**
+     * Get the item data of the parameter
+     *
+     * @return Parameter
+     */
+    public function getItems()
+    {
+        if (is_array($this->items)) {
+            $this->items = new static(
+                $this->items,
+                ['description' => $this->serviceDescription]
+            );
+        }
+
+        return $this->items;
+    }
+
+    /**
+     * Get the enum of strings that are valid for the parameter
+     *
+     * @return array|null
+     */
+    public function getEnum()
+    {
+        return $this->enum;
+    }
+
+    /**
+     * Get the regex pattern that must match a value when the value is a string
+     *
+     * @return string
+     */
+    public function getPattern()
+    {
+        return $this->pattern;
+    }
+
+    /**
+     * Get the format attribute of the schema
+     *
+     * @return string
+     */
+    public function getFormat()
+    {
+        return $this->format;
+    }
+
+    /**
+     * Set the array of filters used by the parameter
+     *
+     * @param array $filters Array of functions to use as filters
+     *
+     * @return self
+     */
+    private function setFilters(array $filters)
+    {
+        $this->filters = [];
+        foreach ($filters as $filter) {
+            $this->addFilter($filter);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add a filter to the parameter
+     *
+     * @param string|array $filter Method to filter the value through
+     *
+     * @return self
+     * @throws \InvalidArgumentException
+     */
+    private function addFilter($filter)
+    {
+        if (is_array($filter)) {
+            if (!isset($filter['method'])) {
+                throw new \InvalidArgumentException(
+                    'A [method] value must be specified for each complex filter'
+                );
+            }
+        }
+
+        if (!$this->filters) {
+            $this->filters = [$filter];
+        } else {
+            $this->filters[] = $filter;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Check if a parameter has a specific variable and if it set.
+     *
+     * @param string $var
+     * @return bool
+     */
+    public function has($var)
+    {
+        if (!is_string($var)) {
+            throw new \InvalidArgumentException('Expected a string. Got: ' . (is_object($var) ? get_class($var) : gettype($var)));
+        }
+        return isset($this->{$var}) && !empty($this->{$var});
+    }
+}

+ 13 - 0
addons/cos/library/Guzzle/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php

@@ -0,0 +1,13 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\QuerySerializer;
+
+interface QuerySerializerInterface
+{
+    /**
+     * Aggregate query params and transform them into a string
+     *
+     * @param  array $queryParams
+     * @return string
+     */
+    public function aggregate(array $queryParams);
+}

+ 33 - 0
addons/cos/library/Guzzle/guzzle-services/src/QuerySerializer/Rfc3986Serializer.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace GuzzleHttp\Command\Guzzle\QuerySerializer;
+
+class Rfc3986Serializer implements QuerySerializerInterface
+{
+    /**
+     * @var bool
+     */
+    private $removeNumericIndices;
+
+    /**
+     * @param bool $removeNumericIndices
+     */
+    public function __construct($removeNumericIndices = false)
+    {
+        $this->removeNumericIndices = $removeNumericIndices;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function aggregate(array $queryParams)
+    {
+        $queryString = http_build_query($queryParams, '', '&', PHP_QUERY_RFC3986);
+
+        if ($this->removeNumericIndices) {
+            $queryString = preg_replace('/%5B[0-9]+%5D/simU', '%5B%5D', $queryString);
+        }
+
+        return $queryString;
+    }
+}

+ 101 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/AbstractLocation.php

@@ -0,0 +1,101 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use Psr\Http\Message\RequestInterface;
+
+abstract class AbstractLocation implements RequestLocationInterface
+{
+    /** @var string */
+    protected $locationName;
+
+    /**
+     * Set the name of the location
+     *
+     * @param $locationName
+     */
+    public function __construct($locationName)
+    {
+        $this->locationName = $locationName;
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter $param
+     * @return RequestInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        return $request;
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Operation $operation
+     * @return RequestInterface
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    ) {
+        return $request;
+    }
+
+    /**
+     * Prepare (filter and set desired name for request item) the value for
+     * request.
+     *
+     * @param mixed     $value
+     * @param Parameter $param
+     *
+     * @return array|mixed
+     */
+    protected function prepareValue($value, Parameter $param)
+    {
+        return is_array($value)
+            ? $this->resolveRecursively($value, $param)
+            : $param->filter($value);
+    }
+
+    /**
+     * Recursively prepare and filter nested values.
+     *
+     * @param array     $value Value to map
+     * @param Parameter $param Parameter related to the current key.
+     *
+     * @return array Returns the mapped array
+     */
+    protected function resolveRecursively(array $value, Parameter $param)
+    {
+        foreach ($value as $name => &$v) {
+            switch ($param->getType()) {
+                case 'object':
+                    if ($subParam = $param->getProperty($name)) {
+                        $key = $subParam->getWireName();
+                        $value[$key] = $this->prepareValue($v, $subParam);
+                        if ($name != $key) {
+                            unset($value[$name]);
+                        }
+                    } elseif ($param->getAdditionalProperties() instanceof Parameter) {
+                        $v = $this->prepareValue($v, $param->getAdditionalProperties());
+                    }
+                    break;
+                case 'array':
+                    if ($items = $param->getItems()) {
+                        $v = $this->prepareValue($v, $items);
+                    }
+                    break;
+            }
+        }
+
+        return $param->filter($value);
+    }
+}

+ 49 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/BodyLocation.php

@@ -0,0 +1,49 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Psr7;
+use Psr\Http\Message\MessageInterface;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Adds a body to a request
+ */
+class BodyLocation extends AbstractLocation
+{
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'body')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter        $param
+     *
+     * @return MessageInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        $oldValue = $request->getBody()->getContents();
+
+        $value = $command[$param->getName()];
+        $value = $param->getName() . '=' . $param->filter($value);
+
+        if ($oldValue !== '') {
+            $value = $oldValue . '&' . $value;
+        }
+
+        return $request->withBody(Psr7\Utils::streamFor($value));
+    }
+}

+ 83 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/FormParamLocation.php

@@ -0,0 +1,83 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Psr7;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Add form_params to a request
+ */
+class FormParamLocation extends AbstractLocation
+{
+    /** @var string $contentType */
+    protected $contentType = 'application/x-www-form-urlencoded; charset=utf-8';
+
+    /** @var array $formParamsData */
+    protected $formParamsData = [];
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'formParam')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter        $param
+     *
+     * @return RequestInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        $this->formParamsData['form_params'][$param->getWireName()] = $this->prepareValue(
+            $command[$param->getName()],
+            $param
+        );
+
+        return $request;
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Operation        $operation
+     *
+     * @return RequestInterface
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    ) {
+        $data = $this->formParamsData;
+        $this->formParamsData = [];
+        $modify = [];
+
+        // Add additional parameters to the form_params array
+        $additional = $operation->getAdditionalParameters();
+        if ($additional && $additional->getLocation() == $this->locationName) {
+            foreach ($command->toArray() as $key => $value) {
+                if (!$operation->hasParam($key)) {
+                    $data['form_params'][$key] = $this->prepareValue($value, $additional);
+                }
+            }
+        }
+
+        $body = http_build_query($data['form_params'], '', '&');
+        $modify['body'] = Psr7\Utils::streamFor($body);
+        $modify['set_headers']['Content-Type'] = $this->contentType;
+
+        return Psr7\Utils::modifyRequest($request, $modify);
+    }
+}

+ 67 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/HeaderLocation.php

@@ -0,0 +1,67 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use Psr\Http\Message\MessageInterface;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Request header location
+ */
+class HeaderLocation extends AbstractLocation
+{
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'header')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter        $param
+     *
+     * @return MessageInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        $value = $command[$param->getName()];
+
+        return $request->withHeader($param->getWireName(), $param->filter($value));
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Operation        $operation
+     *
+     * @return RequestInterface
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    ) {
+        /** @var Parameter $additional */
+        $additional = $operation->getAdditionalParameters();
+        if ($additional && ($additional->getLocation() === $this->locationName)) {
+            foreach ($command->toArray() as $key => $value) {
+                if (!$operation->hasParam($key)) {
+                    $request = $request->withHeader($key, $additional->filter($value));
+                }
+            }
+        }
+
+        return $request;
+    }
+}

+ 86 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/JsonLocation.php

@@ -0,0 +1,86 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Psr7;
+use GuzzleHttp\Utils;
+use Psr\Http\Message\MessageInterface;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Creates a JSON document
+ */
+class JsonLocation extends AbstractLocation
+{
+    /** @var string Whether or not to add a Content-Type header when JSON is found */
+    private $jsonContentType;
+
+    /** @var array */
+    private $jsonData;
+
+    /**
+     * @param string $locationName Name of the location
+     * @param string $contentType  Content-Type header to add to the request if
+     *     JSON is added to the body. Pass an empty string to omit.
+     */
+    public function __construct($locationName = 'json', $contentType = 'application/json')
+    {
+        parent::__construct($locationName);
+        $this->jsonContentType = $contentType;
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter        $param
+     *
+     * @return RequestInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        $this->jsonData[$param->getWireName()] = $this->prepareValue(
+            $command[$param->getName()],
+            $param
+        );
+
+        return $request->withBody(Psr7\Utils::streamFor(Utils::jsonEncode($this->jsonData)));
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Operation        $operation
+     *
+     * @return MessageInterface
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    ) {
+        $data = $this->jsonData;
+        $this->jsonData = [];
+
+        // Add additional parameters to the JSON document
+        $additional = $operation->getAdditionalParameters();
+        if ($additional && ($additional->getLocation() === $this->locationName)) {
+            foreach ($command->toArray() as $key => $value) {
+                if (!$operation->hasParam($key)) {
+                    $data[$key] = $this->prepareValue($value, $additional);
+                }
+            }
+        }
+
+        // Don't overwrite the Content-Type if one is set
+        if ($this->jsonContentType && !$request->hasHeader('Content-Type')) {
+            $request = $request->withHeader('Content-Type', $this->jsonContentType);
+        }
+
+        return $request->withBody(Psr7\Utils::streamFor(Utils::jsonEncode($data)));
+    }
+}

+ 76 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/MultiPartLocation.php

@@ -0,0 +1,76 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Psr7;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Adds POST files to a request
+ */
+class MultiPartLocation extends AbstractLocation
+{
+    /** @var string $contentType */
+    protected $contentType = 'multipart/form-data; boundary=';
+
+    /** @var array $formParamsData */
+    protected $multipartData = [];
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'multipart')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter $param
+     * @return RequestInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        $this->multipartData[] = [
+            'name' => $param->getWireName(),
+            'contents' => $this->prepareValue($command[$param->getName()], $param)
+        ];
+
+        return $request;
+    }
+
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Operation $operation
+     * @return RequestInterface
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    ) {
+        $data = $this->multipartData;
+        $this->multipartData = [];
+        $modify = [];
+
+        $body = new Psr7\MultipartStream($data);
+        $modify['body'] = Psr7\Utils::streamFor($body);
+        $request = Psr7\Utils::modifyRequest($request, $modify);
+        if ($request->getBody() instanceof Psr7\MultipartStream) {
+            // Use a multipart/form-data POST if a Content-Type is not set.
+            $request->withHeader('Content-Type', $this->contentType . $request->getBody()->getBoundary());
+        }
+
+        return $request;
+    }
+}

+ 92 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/QueryLocation.php

@@ -0,0 +1,92 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\Guzzle\QuerySerializer\QuerySerializerInterface;
+use GuzzleHttp\Command\Guzzle\QuerySerializer\Rfc3986Serializer;
+use GuzzleHttp\Psr7;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Adds query string values to requests
+ */
+class QueryLocation extends AbstractLocation
+{
+    /**
+     * @var QuerySerializerInterface
+     */
+    private $querySerializer;
+
+    /**
+     * Set the name of the location
+     *
+     * @param string                        $locationName
+     * @param QuerySerializerInterface|null $querySerializer
+     */
+    public function __construct($locationName = 'query', QuerySerializerInterface $querySerializer = null)
+    {
+        parent::__construct($locationName);
+
+        $this->querySerializer = $querySerializer ?: new Rfc3986Serializer();
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter        $param
+     *
+     * @return RequestInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        $uri = $request->getUri();
+        $query = Psr7\Query::parse($uri->getQuery());
+
+        $query[$param->getWireName()] = $this->prepareValue(
+            $command[$param->getName()],
+            $param
+        );
+
+        $uri = $uri->withQuery($this->querySerializer->aggregate($query));
+
+        return $request->withUri($uri);
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Operation        $operation
+     *
+     * @return RequestInterface
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    ) {
+        $additional = $operation->getAdditionalParameters();
+        if ($additional && $additional->getLocation() == $this->locationName) {
+            foreach ($command->toArray() as $key => $value) {
+                if (!$operation->hasParam($key)) {
+                    $uri = $request->getUri();
+                    $query = Psr7\Query::parse($uri->getQuery());
+
+                    $query[$key] = $this->prepareValue(
+                        $value,
+                        $additional
+                    );
+
+                    $uri = $uri->withQuery($this->querySerializer->aggregate($query));
+                    $request = $request->withUri($uri);
+                }
+            }
+        }
+
+        return $request;
+    }
+}

+ 44 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/RequestLocationInterface.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Handles locations specified in a service description
+ */
+interface RequestLocationInterface
+{
+    /**
+     * Visits a location for each top-level parameter
+     *
+     * @param CommandInterface $command Command being prepared
+     * @param RequestInterface $request Request being modified
+     * @param Parameter        $param   Parameter being visited
+     *
+     * @return RequestInterface Modified request
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    );
+
+    /**
+     * Called when all of the parameters of a command have been visited.
+     *
+     * @param CommandInterface $command   Command being prepared
+     * @param RequestInterface $request   Request being modified
+     * @param Operation        $operation Operation being serialized
+     *
+     * @return RequestInterface Modified request
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    );
+}

+ 328 - 0
addons/cos/library/Guzzle/guzzle-services/src/RequestLocation/XmlLocation.php

@@ -0,0 +1,328 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\RequestLocation;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Operation;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Psr7;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Creates an XML document
+ */
+class XmlLocation extends AbstractLocation
+{
+    /** @var \XMLWriter XML writer resource */
+    private $writer;
+
+    /** @var string Content-Type header added when XML is found */
+    private $contentType;
+
+    /** @var Parameter[] Buffered elements to write */
+    private $buffered = [];
+
+    /**
+     * @param string $locationName Name of the location
+     * @param string $contentType  Set to a non-empty string to add a
+     *     Content-Type header to a request if any XML content is added to the
+     *     body. Pass an empty string to disable the addition of the header.
+     */
+    public function __construct($locationName = 'xml', $contentType = 'application/xml')
+    {
+        parent::__construct($locationName);
+        $this->contentType = $contentType;
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter        $param
+     *
+     * @return RequestInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        // Buffer and order the parameters to visit based on if they are
+        // top-level attributes or child nodes.
+        // @link https://github.com/guzzle/guzzle/pull/494
+        if ($param->getData('xmlAttribute')) {
+            array_unshift($this->buffered, $param);
+        } else {
+            $this->buffered[] = $param;
+        }
+
+        return $request;
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Operation        $operation
+     *
+     * @return RequestInterface
+     */
+    public function after(
+        CommandInterface $command,
+        RequestInterface $request,
+        Operation $operation
+    ) {
+        foreach ($this->buffered as $param) {
+            $this->visitWithValue(
+                $command[$param->getName()],
+                $param,
+                $operation
+            );
+        }
+
+        $this->buffered = [];
+
+        $additional = $operation->getAdditionalParameters();
+        if ($additional && $additional->getLocation() == $this->locationName) {
+            foreach ($command->toArray() as $key => $value) {
+                if (!$operation->hasParam($key)) {
+                    $additional->setName($key);
+                    $this->visitWithValue($value, $additional, $operation);
+                }
+            }
+            $additional->setName(null);
+        }
+
+        // If data was found that needs to be serialized, then do so
+        $xml = '';
+        if ($this->writer) {
+            $xml = $this->finishDocument($this->writer);
+        } elseif ($operation->getData('xmlAllowEmpty')) {
+            // Check if XML should always be sent for the command
+            $writer = $this->createRootElement($operation);
+            $xml = $this->finishDocument($writer);
+        }
+
+        if ($xml !== '') {
+            $request = $request->withBody(Psr7\Utils::streamFor($xml));
+            // Don't overwrite the Content-Type if one is set
+            if ($this->contentType && !$request->hasHeader('Content-Type')) {
+                $request = $request->withHeader('Content-Type', $this->contentType);
+            }
+        }
+
+        $this->writer = null;
+
+        return $request;
+    }
+
+    /**
+     * Create the root XML element to use with a request
+     *
+     * @param Operation $operation Operation object
+     *
+     * @return \XMLWriter
+     */
+    protected function createRootElement(Operation $operation)
+    {
+        static $defaultRoot = ['name' => 'Request'];
+        // If no root element was specified, then just wrap the XML in 'Request'
+        $root = $operation->getData('xmlRoot') ?: $defaultRoot;
+        // Allow the XML declaration to be customized with xmlEncoding
+        $encoding = $operation->getData('xmlEncoding');
+        $writer = $this->startDocument($encoding);
+        $writer->startElement($root['name']);
+
+        // Create the wrapping element with no namespaces if no namespaces were present
+        if (!empty($root['namespaces'])) {
+            // Create the wrapping element with an array of one or more namespaces
+            foreach ((array) $root['namespaces'] as $prefix => $uri) {
+                $nsLabel = 'xmlns';
+                if (!is_numeric($prefix)) {
+                    $nsLabel .= ':'.$prefix;
+                }
+                $writer->writeAttribute($nsLabel, $uri);
+            }
+        }
+
+        return $writer;
+    }
+
+    /**
+     * Recursively build the XML body
+     *
+     * @param \XMLWriter $writer XML to modify
+     * @param Parameter  $param     API Parameter
+     * @param mixed      $value     Value to add
+     */
+    protected function addXml(\XMLWriter $writer, Parameter $param, $value)
+    {
+        $value = $param->filter($value);
+        $type = $param->getType();
+        $name = $param->getWireName();
+        $prefix = null;
+        $namespace = $param->getData('xmlNamespace');
+        if (false !== strpos($name, ':')) {
+            list($prefix, $name) = explode(':', $name, 2);
+        }
+
+        if ($type == 'object' || $type == 'array') {
+            if (!$param->getData('xmlFlattened')) {
+                if ($namespace) {
+                    $writer->startElementNS(null, $name, $namespace);
+                } else {
+                    $writer->startElement($name);
+                }
+            }
+            if ($param->getType() == 'array') {
+                $this->addXmlArray($writer, $param, $value);
+            } elseif ($param->getType() == 'object') {
+                $this->addXmlObject($writer, $param, $value);
+            }
+            if (!$param->getData('xmlFlattened')) {
+                $writer->endElement();
+            }
+            return;
+        }
+        if ($param->getData('xmlAttribute')) {
+            $this->writeAttribute($writer, $prefix, $name, $namespace, $value);
+        } else {
+            $this->writeElement($writer, $prefix, $name, $namespace, $value);
+        }
+    }
+
+    /**
+     * Write an attribute with namespace if used
+     *
+     * @param  \XMLWriter $writer XMLWriter instance
+     * @param  string     $prefix    Namespace prefix if any
+     * @param  string     $name      Attribute name
+     * @param  string     $namespace The uri of the namespace
+     * @param  string     $value     The attribute content
+     */
+    protected function writeAttribute($writer, $prefix, $name, $namespace, $value)
+    {
+        if ($namespace) {
+            $writer->writeAttributeNS($prefix, $name, $namespace, $value);
+        } else {
+            $writer->writeAttribute($name, $value);
+        }
+    }
+
+    /**
+     * Write an element with namespace if used
+     *
+     * @param  \XMLWriter $writer XML writer resource
+     * @param  string     $prefix    Namespace prefix if any
+     * @param  string     $name      Element name
+     * @param  string     $namespace The uri of the namespace
+     * @param  string     $value     The element content
+     */
+    protected function writeElement(\XMLWriter $writer, $prefix, $name, $namespace, $value)
+    {
+        if ($namespace) {
+            $writer->startElementNS($prefix, $name, $namespace);
+        } else {
+            $writer->startElement($name);
+        }
+        if (strpbrk($value, '<>&')) {
+            $writer->writeCData($value);
+        } else {
+            $writer->writeRaw($value);
+        }
+        $writer->endElement();
+    }
+
+    /**
+     * Create a new xml writer and start a document
+     *
+     * @param  string $encoding document encoding
+     *
+     * @return \XMLWriter the writer resource
+     * @throws \RuntimeException if the document cannot be started
+     */
+    protected function startDocument($encoding)
+    {
+        $this->writer = new \XMLWriter();
+        if (!$this->writer->openMemory()) {
+            throw new \RuntimeException('Unable to open XML document in memory');
+        }
+        if (!$this->writer->startDocument('1.0', $encoding)) {
+            throw new \RuntimeException('Unable to start XML document');
+        }
+
+        return $this->writer;
+    }
+
+    /**
+     * End the document and return the output
+     *
+     * @param \XMLWriter $writer
+     *
+     * @return string the writer resource
+     */
+    protected function finishDocument($writer)
+    {
+        $writer->endDocument();
+
+        return $writer->outputMemory();
+    }
+
+    /**
+     * Add an array to the XML
+     *
+     * @param \XMLWriter $writer
+     * @param Parameter $param
+     * @param $value
+     */
+    protected function addXmlArray(\XMLWriter $writer, Parameter $param, &$value)
+    {
+        if ($items = $param->getItems()) {
+            foreach ($value as $v) {
+                $this->addXml($writer, $items, $v);
+            }
+        }
+    }
+
+    /**
+     * Add an object to the XML
+     *
+     * @param \XMLWriter $writer
+     * @param Parameter $param
+     * @param $value
+     */
+    protected function addXmlObject(\XMLWriter $writer, Parameter $param, &$value)
+    {
+        $noAttributes = [];
+
+        // add values which have attributes
+        foreach ($value as $name => $v) {
+            if ($property = $param->getProperty($name)) {
+                if ($property->getData('xmlAttribute')) {
+                    $this->addXml($writer, $property, $v);
+                } else {
+                    $noAttributes[] = ['value' => $v, 'property' => $property];
+                }
+            }
+        }
+
+        // now add values with no attributes
+        foreach ($noAttributes as $element) {
+            $this->addXml($writer, $element['property'], $element['value']);
+        }
+    }
+
+    /**
+     * @param $value
+     * @param Parameter $param
+     * @param Operation $operation
+     */
+    private function visitWithValue(
+        $value,
+        Parameter $param,
+        Operation $operation
+    ) {
+        if (!$this->writer) {
+            $this->createRootElement($operation);
+        }
+
+        $this->addXml($this->writer, $param, $value);
+    }
+}

+ 69 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/AbstractLocation.php

@@ -0,0 +1,69 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Class AbstractLocation
+ *
+ * @package GuzzleHttp\Command\Guzzle\ResponseLocation
+ */
+abstract class AbstractLocation implements ResponseLocationInterface
+{
+    /** @var string $locationName */
+    protected $locationName;
+
+    /**
+     * Set the name of the location
+     *
+     * @param $locationName
+     */
+    public function __construct($locationName)
+    {
+        $this->locationName = $locationName;
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $model
+     * @return ResultInterface
+     */
+    public function before(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    ) {
+        return $result;
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $model
+     * @return ResultInterface
+     */
+    public function after(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    ) {
+        return $result;
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $param
+     * @return ResultInterface
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    ) {
+        return $result;
+    }
+}

+ 39 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/BodyLocation.php

@@ -0,0 +1,39 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Extracts the body of a response into a result field
+ */
+class BodyLocation extends AbstractLocation
+{
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'body')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $param
+     * @return ResultInterface
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    ) {
+        $result[$param->getName()] = $param->filter($response->getBody());
+
+        return $result;
+    }
+}

+ 47 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/HeaderLocation.php

@@ -0,0 +1,47 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Extracts headers from the response into a result fields
+ */
+class HeaderLocation extends AbstractLocation
+{
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'header')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param ResultInterface   $result
+     * @param ResponseInterface $response
+     * @param Parameter         $param
+     *
+     * @return ResultInterface
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    ) {
+        // Retrieving a single header by name
+        $name = $param->getName();
+        if ($header = $response->getHeader($param->getWireName())) {
+            if (is_array($header)) {
+                $header = array_shift($header);
+            }
+            $result[$name] = $param->filter($header);
+        }
+
+        return $result;
+    }
+}

+ 176 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/JsonLocation.php

@@ -0,0 +1,176 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\Result;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Extracts elements from a JSON document.
+ */
+class JsonLocation extends AbstractLocation
+{
+    /** @var array The JSON document being visited */
+    private $json = [];
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'json')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param \GuzzleHttp\Command\ResultInterface  $result
+     * @param \Psr\Http\Message\ResponseInterface  $response
+     * @param \GuzzleHttp\Command\Guzzle\Parameter $model
+     *
+     * @return \GuzzleHttp\Command\ResultInterface
+     */
+    public function before(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    ) {
+        $body = (string) $response->getBody();
+        $body = $body ?: "{}";
+        $this->json = \GuzzleHttp\json_decode($body, true);
+        // relocate named arrays, so that they have the same structure as
+        //  arrays nested in objects and visit can work on them in the same way
+        if ($model->getType() === 'array' && ($name = $model->getName())) {
+            $this->json = [$name => $this->json];
+        }
+
+        return $result;
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $model
+     * @return ResultInterface
+     */
+    public function after(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    ) {
+        // Handle additional, undefined properties
+        $additional = $model->getAdditionalProperties();
+        if (!($additional instanceof Parameter)) {
+            return $result;
+        }
+
+        // Use the model location as the default if one is not set on additional
+        $addLocation = $additional->getLocation() ?: $model->getLocation();
+        if ($addLocation == $this->locationName) {
+            foreach ($this->json as $prop => $val) {
+                if (!isset($result[$prop])) {
+                    // Only recurse if there is a type specified
+                    $result[$prop] = $additional->getType()
+                        ? $this->recurse($additional, $val)
+                        : $val;
+                }
+            }
+        }
+
+        $this->json = [];
+
+        return $result;
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $param
+     * @return Result|ResultInterface
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    ) {
+        $name = $param->getName();
+        $key = $param->getWireName();
+
+        // Check if the result should be treated as a list
+        if ($param->getType() == 'array') {
+            // Treat as javascript array
+            if ($name) {
+                // name provided, store it under a key in the array
+                $subArray = isset($this->json[$key]) ? $this->json[$key] : null;
+                $result[$name] = $this->recurse($param, $subArray);
+            } else {
+                // top-level `array` or an empty name
+                $result = new Result(array_merge(
+                    $result->toArray(),
+                    $this->recurse($param, $this->json)
+                ));
+            }
+        } elseif (isset($this->json[$key])) {
+            $result[$name] = $this->recurse($param, $this->json[$key]);
+        }
+
+        return $result;
+    }
+
+    /**
+     * Recursively process a parameter while applying filters
+     *
+     * @param Parameter $param API parameter being validated
+     * @param mixed     $value Value to process.
+     * @return mixed|null
+     */
+    private function recurse(Parameter $param, $value)
+    {
+        if (!is_array($value)) {
+            return $param->filter($value);
+        }
+
+        $result = [];
+        $type = $param->getType();
+
+        if ($type == 'array') {
+            $items = $param->getItems();
+            foreach ($value as $val) {
+                $result[] = $this->recurse($items, $val);
+            }
+        } elseif ($type == 'object' && !isset($value[0])) {
+            // On the above line, we ensure that the array is associative and
+            // not numerically indexed
+            if ($properties = $param->getProperties()) {
+                foreach ($properties as $property) {
+                    $key = $property->getWireName();
+                    if (array_key_exists($key, $value)) {
+                        $result[$property->getName()] = $this->recurse(
+                            $property,
+                            $value[$key]
+                        );
+                        // Remove from the value so that AP can later be handled
+                        unset($value[$key]);
+                    }
+                }
+            }
+            // Only check additional properties if everything wasn't already
+            // handled
+            if ($value) {
+                $additional = $param->getAdditionalProperties();
+                if ($additional === null || $additional === true) {
+                    // Merge the JSON under the resulting array
+                    $result += $value;
+                } elseif ($additional instanceof Parameter) {
+                    // Process all child elements according to the given schema
+                    foreach ($value as $prop => $val) {
+                        $result[$prop] = $this->recurse($additional, $val);
+                    }
+                }
+            }
+        }
+
+        return $param->filter($result);
+    }
+}

+ 41 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/ReasonPhraseLocation.php

@@ -0,0 +1,41 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Extracts the reason phrase of a response into a result field
+ */
+class ReasonPhraseLocation extends AbstractLocation
+{
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'reasonPhrase')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $param
+     * @return ResultInterface
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    ) {
+        $result[$param->getName()] = $param->filter(
+            $response->getReasonPhrase()
+        );
+
+        return $result;
+    }
+}

+ 61 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/ResponseLocationInterface.php

@@ -0,0 +1,61 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Location visitor used to parse values out of a response into an associative
+ * array
+ */
+interface ResponseLocationInterface
+{
+    /**
+     * Called before visiting all parameters. This can be used for seeding the
+     * result of a command with default data (e.g. populating with JSON data in
+     * the response then adding to the parsed data).
+     *
+     * @param ResultInterface   $result   Result being created
+     * @param ResponseInterface $response Response being visited
+     * @param Parameter         $model    Response model
+     *
+     * @return ResultInterface Modified result
+     */
+    public function before(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    );
+
+    /**
+     * Called after visiting all parameters
+     *
+     * @param ResultInterface   $result   Result being created
+     * @param ResponseInterface $response Response being visited
+     * @param Parameter         $model    Response model
+     *
+     * @return ResultInterface Modified result
+     */
+    public function after(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    );
+
+    /**
+     * Called once for each parameter being visited that matches the location
+     * type.
+     *
+     * @param ResultInterface   $result   Result being created
+     * @param ResponseInterface $response Response being visited
+     * @param Parameter         $param    Parameter being visited
+     *
+     * @return ResultInterface Modified result
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    );
+}

+ 39 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/StatusCodeLocation.php

@@ -0,0 +1,39 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Extracts the status code of a response into a result field
+ */
+class StatusCodeLocation extends AbstractLocation
+{
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'statusCode')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $param
+     * @return ResultInterface
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    ) {
+        $result[$param->getName()] = $param->filter($response->getStatusCode());
+
+        return $result;
+    }
+}

+ 311 - 0
addons/cos/library/Guzzle/guzzle-services/src/ResponseLocation/XmlLocation.php

@@ -0,0 +1,311 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
+
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Command\Result;
+use GuzzleHttp\Command\ResultInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Extracts elements from an XML document
+ */
+class XmlLocation extends AbstractLocation
+{
+    /** @var \SimpleXMLElement XML document being visited */
+    private $xml;
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'xml')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $model
+     * @return ResultInterface
+     */
+    public function before(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    ) {
+        $this->xml = simplexml_load_string((string) $response->getBody());
+
+        return $result;
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $model
+     * @return Result|ResultInterface
+     */
+    public function after(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $model
+    ) {
+        // Handle additional, undefined properties
+        $additional = $model->getAdditionalProperties();
+        if ($additional instanceof Parameter &&
+            $additional->getLocation() == $this->locationName
+        ) {
+            $result = new Result(array_merge(
+                $result->toArray(),
+                self::xmlToArray($this->xml)
+            ));
+        }
+
+        $this->xml = null;
+
+        return $result;
+    }
+
+    /**
+     * @param ResultInterface $result
+     * @param ResponseInterface $response
+     * @param Parameter $param
+     * @return ResultInterface
+     */
+    public function visit(
+        ResultInterface $result,
+        ResponseInterface $response,
+        Parameter $param
+    ) {
+        $sentAs = $param->getWireName();
+        $ns = null;
+        if (strstr($sentAs, ':')) {
+            list($ns, $sentAs) = explode(':', $sentAs);
+        }
+
+        // Process the primary property
+        if (count($this->xml->children($ns, true)->{$sentAs})) {
+            $result[$param->getName()] = $this->recursiveProcess(
+                $param,
+                $this->xml->children($ns, true)->{$sentAs}
+            );
+        }
+
+        return $result;
+    }
+
+    /**
+     * Recursively process a parameter while applying filters
+     *
+     * @param Parameter         $param API parameter being processed
+     * @param \SimpleXMLElement $node  Node being processed
+     * @return array
+     */
+    private function recursiveProcess(
+        Parameter $param,
+        \SimpleXMLElement $node
+    ) {
+        $result = [];
+        $type = $param->getType();
+
+        if ($type == 'object') {
+            $result = $this->processObject($param, $node);
+        } elseif ($type == 'array') {
+            $result = $this->processArray($param, $node);
+        } else {
+            // We are probably handling a flat data node (i.e. string or
+            // integer), so let's check if it's childless, which indicates a
+            // node containing plain text.
+            if ($node->children()->count() == 0) {
+                // Retrieve text from node
+                $result = (string) $node;
+            }
+        }
+
+        // Filter out the value
+        if (isset($result)) {
+            $result = $param->filter($result);
+        }
+
+        return $result;
+    }
+
+    /**
+     * @param Parameter $param
+     * @param \SimpleXMLElement $node
+     * @return array
+     */
+    private function processArray(Parameter $param, \SimpleXMLElement $node)
+    {
+        // Cast to an array if the value was a string, but should be an array
+        $items = $param->getItems();
+        $sentAs = $items->getWireName();
+        $result = [];
+        $ns = null;
+
+        if (strstr($sentAs, ':')) {
+            // Get namespace from the wire name
+            list($ns, $sentAs) = explode(':', $sentAs);
+        } else {
+            // Get namespace from data
+            $ns = $items->getData('xmlNs');
+        }
+
+        if ($sentAs === null) {
+            // A general collection of nodes
+            foreach ($node as $child) {
+                $result[] = $this->recursiveProcess($items, $child);
+            }
+        } else {
+            // A collection of named, repeating nodes
+            // (i.e. <collection><foo></foo><foo></foo></collection>)
+            $children = $node->children($ns, true)->{$sentAs};
+            foreach ($children as $child) {
+                $result[] = $this->recursiveProcess($items, $child);
+            }
+        }
+
+        return $result;
+    }
+
+    /**
+     * Process an object
+     *
+     * @param Parameter         $param API parameter being parsed
+     * @param \SimpleXMLElement $node  Value to process
+     * @return array
+     */
+    private function processObject(Parameter $param, \SimpleXMLElement $node)
+    {
+        $result = $knownProps = $knownAttributes = [];
+
+        // Handle known properties
+        if ($properties = $param->getProperties()) {
+            foreach ($properties as $property) {
+                $name = $property->getName();
+                $sentAs = $property->getWireName();
+                $knownProps[$sentAs] = 1;
+                if (strpos($sentAs, ':')) {
+                    list($ns, $sentAs) = explode(':', $sentAs);
+                } else {
+                    $ns = $property->getData('xmlNs');
+                }
+
+                if ($property->getData('xmlAttribute')) {
+                    // Handle XML attributes
+                    $result[$name] = (string) $node->attributes($ns, true)->{$sentAs};
+                    $knownAttributes[$sentAs] = 1;
+                } elseif (count($node->children($ns, true)->{$sentAs})) {
+                    // Found a child node matching wire name
+                    $childNode = $node->children($ns, true)->{$sentAs};
+                    $result[$name] = $this->recursiveProcess(
+                        $property,
+                        $childNode
+                    );
+                }
+            }
+        }
+
+        // Handle additional, undefined properties
+        $additional = $param->getAdditionalProperties();
+        if ($additional instanceof Parameter) {
+            // Process all child elements according to the given schema
+            foreach ($node->children($additional->getData('xmlNs'), true) as $childNode) {
+                $sentAs = $childNode->getName();
+                if (!isset($knownProps[$sentAs])) {
+                    $result[$sentAs] = $this->recursiveProcess(
+                        $additional,
+                        $childNode
+                    );
+                }
+            }
+        } elseif ($additional === null || $additional === true) {
+            // Blindly transform the XML into an array preserving as much data
+            // as possible. Remove processed, aliased properties.
+            $array = array_diff_key(self::xmlToArray($node), $knownProps);
+            // Remove @attributes that were explicitly plucked from the
+            // attributes list.
+            if (isset($array['@attributes']) && $knownAttributes) {
+                $array['@attributes'] = array_diff_key($array['@attributes'], $knownProps);
+                if (!$array['@attributes']) {
+                    unset($array['@attributes']);
+                }
+            }
+
+            // Merge it together with the original result
+            $result = array_merge($array, $result);
+        }
+
+        return $result;
+    }
+
+    /**
+     * Convert an XML document to an array.
+     *
+     * @param \SimpleXMLElement $xml
+     * @param int               $nesting
+     * @param null              $ns
+     *
+     * @return array
+     */
+    private static function xmlToArray(
+        \SimpleXMLElement $xml,
+        $ns = null,
+        $nesting = 0
+    ) {
+        $result = [];
+        $children = $xml->children($ns, true);
+
+        foreach ($children as $name => $child) {
+            $attributes = (array) $child->attributes($ns, true);
+            if (!isset($result[$name])) {
+                $childArray = self::xmlToArray($child, $ns, $nesting + 1);
+                $result[$name] = $attributes
+                    ? array_merge($attributes, $childArray)
+                    : $childArray;
+                continue;
+            }
+            // A child element with this name exists so we're assuming
+            // that the node contains a list of elements
+            if (!is_array($result[$name])) {
+                $result[$name] = [$result[$name]];
+            } elseif (!isset($result[$name][0])) {
+                // Convert the first child into the first element of a numerically indexed array
+                $firstResult = $result[$name];
+                $result[$name] = [];
+                $result[$name][] = $firstResult;
+            }
+            $childArray = self::xmlToArray($child, $ns, $nesting + 1);
+            if ($attributes) {
+                $result[$name][] = array_merge($attributes, $childArray);
+            } else {
+                $result[$name][] = $childArray;
+            }
+        }
+
+        // Extract text from node
+        $text = trim((string) $xml);
+        if ($text === '') {
+            $text = null;
+        }
+
+        // Process attributes
+        $attributes = (array) $xml->attributes($ns, true);
+        if ($attributes) {
+            if ($text !== null) {
+                $result['value'] = $text;
+            }
+            $result = array_merge($attributes, $result);
+        } elseif ($text !== null) {
+            $result = $text;
+        }
+
+        // Make sure we're always returning an array
+        if ($nesting == 0 && !is_array($result)) {
+            $result = [$result];
+        }
+
+        return $result;
+    }
+}

+ 141 - 0
addons/cos/library/Guzzle/guzzle-services/src/SchemaFormatter.php

@@ -0,0 +1,141 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+/**
+ * JSON Schema formatter class
+ */
+class SchemaFormatter
+{
+    /**
+     * Format a value by a registered format name
+     *
+     * @param string $format Registered format used to format the value
+     * @param mixed  $value  Value being formatted
+     *
+     * @return mixed
+     */
+    public function format($format, $value)
+    {
+        switch ($format) {
+            case 'date-time':
+                return $this->formatDateTime($value);
+            case 'date-time-http':
+                return $this->formatDateTimeHttp($value);
+            case 'date':
+                return $this->formatDate($value);
+            case 'time':
+                return $this->formatTime($value);
+            case 'timestamp':
+                return $this->formatTimestamp($value);
+            case 'boolean-string':
+                return $this->formatBooleanAsString($value);
+            default:
+                return $value;
+        }
+    }
+
+    /**
+     * Perform the actual DateTime formatting
+     *
+     * @param int|string|\DateTime $dateTime Date time value
+     * @param string               $format   Format of the result
+     *
+     * @return string
+     * @throws \InvalidArgumentException
+     */
+    protected function dateFormatter($dateTime, $format)
+    {
+        if (is_numeric($dateTime)) {
+            return gmdate($format, (int) $dateTime);
+        }
+
+        if (is_string($dateTime)) {
+            $dateTime = new \DateTime($dateTime);
+        }
+
+        if ($dateTime instanceof \DateTimeInterface) {
+            static $utc;
+            if (!$utc) {
+                $utc = new \DateTimeZone('UTC');
+            }
+            return $dateTime->setTimezone($utc)->format($format);
+        }
+
+        throw new \InvalidArgumentException('Date/Time values must be either '
+            . 'be a string, integer, or DateTime object');
+    }
+
+    /**
+     * Create a ISO 8601 (YYYY-MM-DDThh:mm:ssZ) formatted date time value in
+     * UTC time.
+     *
+     * @param string|integer|\DateTime $value Date time value
+     *
+     * @return string
+     */
+    private function formatDateTime($value)
+    {
+        return $this->dateFormatter($value, 'Y-m-d\TH:i:s\Z');
+    }
+
+    /**
+     * Create an HTTP date (RFC 1123 / RFC 822) formatted UTC date-time string
+     *
+     * @param string|integer|\DateTime $value Date time value
+     *
+     * @return string
+     */
+    private function formatDateTimeHttp($value)
+    {
+        return $this->dateFormatter($value, 'D, d M Y H:i:s \G\M\T');
+    }
+
+    /**
+     * Create a YYYY-MM-DD formatted string
+     *
+     * @param string|integer|\DateTime $value Date time value
+     *
+     * @return string
+     */
+    private function formatDate($value)
+    {
+        return $this->dateFormatter($value, 'Y-m-d');
+    }
+
+    /**
+     * Create a hh:mm:ss formatted string
+     *
+     * @param string|integer|\DateTime $value Date time value
+     *
+     * @return string
+     */
+    private function formatTime($value)
+    {
+        return $this->dateFormatter($value, 'H:i:s');
+    }
+
+    /**
+     * Formats a boolean value as a string
+     *
+     * @param string|integer|bool $value Value to convert to a boolean
+     *                                   'true' / 'false' value
+     *
+     * @return string
+     */
+    private function formatBooleanAsString($value)
+    {
+        return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false';
+    }
+
+    /**
+     * Return a UNIX timestamp in the UTC timezone
+     *
+     * @param string|integer|\DateTime $value Time value
+     *
+     * @return int
+     */
+    private function formatTimestamp($value)
+    {
+        return (int) $this->dateFormatter($value, 'U');
+    }
+}

+ 297 - 0
addons/cos/library/Guzzle/guzzle-services/src/SchemaValidator.php

@@ -0,0 +1,297 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\Command\ToArrayInterface;
+
+/**
+ * Default parameter validator
+ */
+class SchemaValidator
+{
+    /**
+     * Whether or not integers are converted to strings when an integer is
+     * received for a string input
+     *
+     * @var bool
+     */
+    protected $castIntegerToStringType;
+
+    /** @var array Errors encountered while validating */
+    protected $errors;
+
+    /**
+     * @param bool $castIntegerToStringType Set to true to convert integers
+     *     into strings when a required type is a string and the input value is
+     *     an integer. Defaults to true.
+     */
+    public function __construct($castIntegerToStringType = true)
+    {
+        $this->castIntegerToStringType = $castIntegerToStringType;
+    }
+
+    /**
+     * @param Parameter $param
+     * @param $value
+     * @return bool
+     */
+    public function validate(Parameter $param, &$value)
+    {
+        $this->errors = [];
+        $this->recursiveProcess($param, $value);
+
+        if (empty($this->errors)) {
+            return true;
+        } else {
+            sort($this->errors);
+            return false;
+        }
+    }
+
+    /**
+     * Get the errors encountered while validating
+     *
+     * @return array
+     */
+    public function getErrors()
+    {
+        return $this->errors ?: [];
+    }
+
+    /**
+     * From the allowable types, determine the type that the variable matches
+     *
+     * @param string|array $type Parameter type
+     * @param mixed $value Value to determine the type
+     *
+     * @return string|false Returns the matching type on
+     */
+    protected function determineType($type, $value)
+    {
+        foreach ((array) $type as $t) {
+            if ($t == 'string'
+                && (is_string($value) || (is_object($value) && method_exists($value, '__toString')))
+            ) {
+                return 'string';
+            } elseif ($t == 'object' && (is_array($value) || is_object($value))) {
+                return 'object';
+            } elseif ($t == 'array' && is_array($value)) {
+                return 'array';
+            } elseif ($t == 'integer' && is_integer($value)) {
+                return 'integer';
+            } elseif ($t == 'boolean' && is_bool($value)) {
+                return 'boolean';
+            } elseif ($t == 'number' && is_numeric($value)) {
+                return 'number';
+            } elseif ($t == 'numeric' && is_numeric($value)) {
+                return 'numeric';
+            } elseif ($t == 'null' && !$value) {
+                return 'null';
+            } elseif ($t == 'any') {
+                return 'any';
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Recursively validate a parameter
+     *
+     * @param Parameter $param  API parameter being validated
+     * @param mixed     $value  Value to validate and validate. The value may
+     *                          change during this validate.
+     * @param string    $path   Current validation path (used for error reporting)
+     * @param int       $depth  Current depth in the validation validate
+     *
+     * @return bool Returns true if valid, or false if invalid
+     */
+    protected function recursiveProcess(
+        Parameter $param,
+        &$value,
+        $path = '',
+        $depth = 0
+    ) {
+        // Update the value by adding default or static values
+        $value = $param->getValue($value);
+
+        $required = $param->isRequired();
+        // if the value is null and the parameter is not required or is static,
+        // then skip any further recursion
+        if ((null === $value && !$required) || $param->isStatic()) {
+            return true;
+        }
+
+        $type = $param->getType();
+        // Attempt to limit the number of times is_array is called by tracking
+        // if the value is an array
+        $valueIsArray = is_array($value);
+        // If a name is set then update the path so that validation messages
+        // are more helpful
+        if ($name = $param->getName()) {
+            $path .= "[{$name}]";
+        }
+
+        if ($type == 'object') {
+            // Determine whether or not this "value" has properties and should
+            // be traversed
+            $traverse = $temporaryValue = false;
+
+            // Convert the value to an array
+            if (!$valueIsArray && $value instanceof ToArrayInterface) {
+                $value = $value->toArray();
+            }
+
+            if ($valueIsArray) {
+                // Ensure that the array is associative and not numerically
+                // indexed
+                if (isset($value[0])) {
+                    $this->errors[] = "{$path} must be an array of properties. Got a numerically indexed array.";
+                    return false;
+                }
+                $traverse = true;
+            } elseif ($value === null) {
+                // Attempt to let the contents be built up by default values if
+                // possible
+                $value = [];
+                $temporaryValue = $valueIsArray = $traverse = true;
+            }
+
+            if ($traverse) {
+                if ($properties = $param->getProperties()) {
+                    // if properties were found, validate each property
+                    foreach ($properties as $property) {
+                        $name = $property->getName();
+                        if (isset($value[$name])) {
+                            $this->recursiveProcess($property, $value[$name], $path, $depth + 1);
+                        } else {
+                            $current = null;
+                            $this->recursiveProcess($property, $current, $path, $depth + 1);
+                            // Only set the value if it was populated
+                            if (null !== $current) {
+                                $value[$name] = $current;
+                            }
+                        }
+                    }
+                }
+
+                $additional = $param->getAdditionalProperties();
+                if ($additional !== true) {
+                    // If additional properties were found, then validate each
+                    // against the additionalProperties attr.
+                    $keys = array_keys($value);
+                    // Determine the keys that were specified that were not
+                    // listed in the properties of the schema
+                    $diff = array_diff($keys, array_keys($properties));
+                    if (!empty($diff)) {
+                        // Determine which keys are not in the properties
+                        if ($additional instanceof Parameter) {
+                            foreach ($diff as $key) {
+                                $this->recursiveProcess($additional, $value[$key], "{$path}[{$key}]", $depth);
+                            }
+                        } else {
+                            // if additionalProperties is set to false and there
+                            // are additionalProperties in the values, then fail
+                            foreach ($diff as $prop) {
+                                $this->errors[] = sprintf('%s[%s] is not an allowed property', $path, $prop);
+                            }
+                        }
+                    }
+                }
+
+                // A temporary value will be used to traverse elements that
+                // have no corresponding input value. This allows nested
+                // required parameters with default values to bubble up into the
+                // input. Here we check if we used a temp value and nothing
+                // bubbled up, then we need to remote the value.
+                if ($temporaryValue && empty($value)) {
+                    $value = null;
+                    $valueIsArray = false;
+                }
+            }
+
+        } elseif ($type == 'array' && $valueIsArray && $param->getItems()) {
+            foreach ($value as $i => &$item) {
+                // Validate each item in an array against the items attribute of the schema
+                $this->recursiveProcess($param->getItems(), $item, $path . "[{$i}]", $depth + 1);
+            }
+        }
+
+        // If the value is required and the type is not null, then there is an
+        // error if the value is not set
+        if ($required && $value === null && $type != 'null') {
+            $message = "{$path} is " . ($param->getType()
+                ? ('a required ' . implode(' or ', (array) $param->getType()))
+                : 'required');
+            if ($param->has('description')) {
+                $message .= ': ' . $param->getDescription();
+            }
+            $this->errors[] = $message;
+            return false;
+        }
+
+        // Validate that the type is correct. If the type is string but an
+        // integer was passed, the class can be instructed to cast the integer
+        // to a string to pass validation. This is the default behavior.
+        if ($type && (!$type = $this->determineType($type, $value))) {
+            if ($this->castIntegerToStringType
+                && $param->getType() == 'string'
+                && is_integer($value)
+            ) {
+                $value = (string) $value;
+            } else {
+                $this->errors[] = "{$path} must be of type " . implode(' or ', (array) $param->getType());
+            }
+        }
+
+        // Perform type specific validation for strings, arrays, and integers
+        if ($type == 'string') {
+            // Strings can have enums which are a list of predefined values
+            if (($enum = $param->getEnum()) && !in_array($value, $enum)) {
+                $this->errors[] = "{$path} must be one of " . implode(' or ', array_map(function ($s) {
+                        return '"' . addslashes($s) . '"';
+                }, $enum));
+            }
+            // Strings can have a regex pattern that the value must match
+            if (($pattern  = $param->getPattern()) && !preg_match($pattern, $value)) {
+                $this->errors[] = "{$path} must match the following regular expression: {$pattern}";
+            }
+
+            $strLen = null;
+            if ($min = $param->getMinLength()) {
+                $strLen = strlen($value);
+                if ($strLen < $min) {
+                    $this->errors[] = "{$path} length must be greater than or equal to {$min}";
+                }
+            }
+            if ($max = $param->getMaxLength()) {
+                if (($strLen ?: strlen($value)) > $max) {
+                    $this->errors[] = "{$path} length must be less than or equal to {$max}";
+                }
+            }
+
+        } elseif ($type == 'array') {
+            $size = null;
+            if ($min = $param->getMinItems()) {
+                $size = count($value);
+                if ($size < $min) {
+                    $this->errors[] = "{$path} must contain {$min} or more elements";
+                }
+            }
+            if ($max = $param->getMaxItems()) {
+                if (($size ?: count($value)) > $max) {
+                    $this->errors[] = "{$path} must contain {$max} or fewer elements";
+                }
+            }
+
+        } elseif ($type == 'integer' || $type == 'number' || $type == 'numeric') {
+            if (($min = $param->getMinimum()) && $value < $min) {
+                $this->errors[] = "{$path} must be greater than or equal to {$min}";
+            }
+            if (($max = $param->getMaximum()) && $value > $max) {
+                $this->errors[] = "{$path} must be less than or equal to {$max}";
+            }
+        }
+
+        return empty($this->errors);
+    }
+}

+ 166 - 0
addons/cos/library/Guzzle/guzzle-services/src/Serializer.php

@@ -0,0 +1,166 @@
+<?php
+namespace GuzzleHttp\Command\Guzzle;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\RequestLocation\BodyLocation;
+use GuzzleHttp\Command\Guzzle\RequestLocation\FormParamLocation;
+use GuzzleHttp\Command\Guzzle\RequestLocation\HeaderLocation;
+use GuzzleHttp\Command\Guzzle\RequestLocation\JsonLocation;
+use GuzzleHttp\Command\Guzzle\RequestLocation\MultiPartLocation;
+use GuzzleHttp\Command\Guzzle\RequestLocation\QueryLocation;
+use GuzzleHttp\Command\Guzzle\RequestLocation\RequestLocationInterface;
+use GuzzleHttp\Command\Guzzle\RequestLocation\XmlLocation;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\Psr7\Uri;
+use GuzzleHttp\Psr7\UriResolver;
+use GuzzleHttp\UriTemplate\UriTemplate;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Serializes requests for a given command.
+ */
+class Serializer
+{
+    /** @var RequestLocationInterface[] */
+    private $locations;
+
+    /** @var DescriptionInterface */
+    private $description;
+
+    /**
+     * @param DescriptionInterface       $description
+     * @param RequestLocationInterface[] $requestLocations Extra request locations
+     */
+    public function __construct(
+        DescriptionInterface $description,
+        array $requestLocations = []
+    ) {
+        static $defaultRequestLocations;
+        if (!$defaultRequestLocations) {
+            $defaultRequestLocations = [
+                'body'      => new BodyLocation(),
+                'query'     => new QueryLocation(),
+                'header'    => new HeaderLocation(),
+                'json'      => new JsonLocation(),
+                'xml'       => new XmlLocation(),
+                'formParam' => new FormParamLocation(),
+                'multipart' => new MultiPartLocation(),
+            ];
+        }
+
+        $this->locations = $requestLocations + $defaultRequestLocations;
+        $this->description = $description;
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @return RequestInterface
+     */
+    public function __invoke(CommandInterface $command)
+    {
+        $request = $this->createRequest($command);
+        return $this->prepareRequest($command, $request);
+    }
+
+    /**
+     * Prepares a request for sending using location visitors
+     *
+     * @param CommandInterface $command
+     * @param RequestInterface $request Request being created
+     * @return RequestInterface
+     * @throws \RuntimeException If a location cannot be handled
+     */
+    protected function prepareRequest(
+        CommandInterface $command,
+        RequestInterface $request
+    ) {
+        $visitedLocations = [];
+        $operation = $this->description->getOperation($command->getName());
+
+        // Visit each actual parameter
+        foreach ($operation->getParams() as $name => $param) {
+            /* @var Parameter $param */
+            $location = $param->getLocation();
+            // Skip parameters that have not been set or are URI location
+            if ($location == 'uri' || !$command->hasParam($name)) {
+                continue;
+            }
+            if (!isset($this->locations[$location])) {
+                throw new \RuntimeException("No location registered for $name");
+            }
+            $visitedLocations[$location] = true;
+            $request = $this->locations[$location]->visit($command, $request, $param);
+        }
+
+        // Ensure that the after() method is invoked for additionalParameters
+        /** @var Parameter $additional */
+        if ($additional = $operation->getAdditionalParameters()) {
+            $visitedLocations[$additional->getLocation()] = true;
+        }
+
+        // Call the after() method for each visited location
+        foreach (array_keys($visitedLocations) as $location) {
+            $request = $this->locations[$location]->after($command, $request, $operation);
+        }
+
+        return $request;
+    }
+
+    /**
+     * Create a request for the command and operation
+     *
+     * @param CommandInterface $command
+     *
+     * @return RequestInterface
+     * @throws \RuntimeException
+     */
+    protected function createRequest(CommandInterface $command)
+    {
+        $operation = $this->description->getOperation($command->getName());
+
+        // If command does not specify a template, assume the client's base URL.
+        if (null === $operation->getUri()) {
+            return new Request(
+                $operation->getHttpMethod() ?: 'GET',
+                $this->description->getBaseUri()
+            );
+        }
+
+        return $this->createCommandWithUri($operation, $command);
+    }
+
+    /**
+     * Create a request for an operation with a uri merged onto a base URI
+     *
+     * @param \GuzzleHttp\Command\Guzzle\Operation $operation
+     * @param \GuzzleHttp\Command\CommandInterface $command
+     *
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    private function createCommandWithUri(
+        Operation $operation,
+        CommandInterface $command
+    ) {
+        // Get the path values and use the client config settings
+        $variables = [];
+        foreach ($operation->getParams() as $name => $arg) {
+            /* @var Parameter $arg */
+            if ($arg->getLocation() == 'uri') {
+                if (isset($command[$name])) {
+                    $variables[$name] = $arg->filter($command[$name]);
+                    if (!is_array($variables[$name])) {
+                        $variables[$name] = (string) $variables[$name];
+                    }
+                }
+            }
+        }
+
+        // Expand the URI template.
+        $uri = new Uri(UriTemplate::expand($operation->getUri(), $variables));
+
+        return new Request(
+            $operation->getHttpMethod() ?: 'GET',
+            UriResolver::resolve($this->description->getBaseUri(), $uri)
+        );
+    }
+}

+ 37 - 0
addons/cos/library/Guzzle/uri-template/CHANGELOG.md

@@ -0,0 +1,37 @@
+# Changelog
+
+All notable changes to `uri-template` will be documented in this file.
+
+Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
+
+## v1.0.1 - 2021-10-07
+
+### Changed
+- Officially support PHP 8.1
+
+## v1.0.0 - 2021-08-14
+
+### Changed
+- Dropped support for PHP 7.1
+
+## v0.2.0 - 2020-07-21
+
+### Added
+- Support PHP 7.1 and 8.0
+
+### Changed
+- Renamed `GuzzleHttp\Utility\` to `GuzzleHttp\UriTemplate\`
+
+### Fixed
+- Delegate RFC 3986 query string encoding to PHP
+- Fixed some bugs when parts ofs values are not strings
+
+## v0.1.1 - 2020-06-30
+
+### Fixed
+- Fixed an error due to strict_types [d47d1b0a8e78a3fac1cd0f69d675fc9e06771ac8](https://github.com/guzzle/uri-template/commit/d47d1b0a8e78a3fac1cd0f69d675fc9e06771ac8)
+
+## v0.1.0 - 2020-06-30
+
+### Added
+- Moved the `UriTemplate` class in this package

+ 23 - 0
addons/cos/library/Guzzle/uri-template/LICENSE

@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Michael Dowling <mtdowling@gmail.com>
+Copyright (c) 2020 George Mponos <gmponos@gmail.com>
+Copyright (c) 2020 Graham Campbell <hello@gjcampbell.co.uk>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 33 - 0
addons/cos/library/Guzzle/uri-template/README.md

@@ -0,0 +1,33 @@
+# uri-template
+
+## Install
+
+Via Composer
+
+``` bash
+$ composer require guzzlehttp/uri-template
+```
+
+## Change log
+
+Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
+
+## Testing
+
+``` bash
+$ make test
+```
+
+## Security
+
+If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/uri-template/security/policy) for more information.
+
+## License
+
+Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
+## For Enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-uri-template?utm_source=packagist-guzzlehttp-uri-template7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

+ 71 - 0
addons/cos/library/Guzzle/uri-template/composer.json

@@ -0,0 +1,71 @@
+{
+    "name": "guzzlehttp/uri-template",
+    "description": "A polyfill class for uri_template of PHP",
+    "keywords": [
+        "guzzlehttp",
+        "uri-template"
+    ],
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Graham Campbell",
+            "email": "hello@gjcampbell.co.uk",
+            "homepage": "https://github.com/GrahamCampbell"
+        },
+        {
+            "name": "Michael Dowling",
+            "email": "mtdowling@gmail.com",
+            "homepage": "https://github.com/mtdowling"
+        },
+        {
+            "name": "George Mponos",
+            "email": "gmponos@gmail.com",
+            "homepage": "https://github.com/gmponos"
+        },
+        {
+            "name": "Tobias Nyholm",
+            "email": "tobias.nyholm@gmail.com",
+            "homepage": "https://github.com/Nyholm"
+        }
+    ],
+    "repositories": [
+        {
+            "type": "package",
+            "package": {
+                "name": "uri-template/tests",
+                "version": "1.0.0",
+                "dist": {
+                    "url": "https://github.com/uri-templates/uritemplate-test/archive/520fdd8b0f78779d12178c357a986e0e727f4bd0.zip",
+                    "type": "zip"
+                }
+            }
+        }
+    ],
+    "require": {
+        "php" : "^7.2.5 || ^8.0",
+        "symfony/polyfill-php80": "^1.17"
+    },
+    "require-dev": {
+        "phpunit/phpunit" : "^8.5.19 || ^9.5.8",
+        "uri-template/tests": "1.0.0"
+    },
+    "autoload": {
+        "psr-4": {
+            "GuzzleHttp\\UriTemplate\\": "src"
+        }
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "GuzzleHttp\\UriTemplate\\Tests\\": "tests"
+        }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "1.0-dev"
+        }
+    },
+    "config": {
+        "preferred-install": "dist",
+        "sort-packages": true
+    }
+}

+ 297 - 0
addons/cos/library/Guzzle/uri-template/src/UriTemplate.php

@@ -0,0 +1,297 @@
+<?php
+
+declare(strict_types=1);
+
+namespace GuzzleHttp\UriTemplate;
+
+/**
+ * Expands URI templates. Userland implementation of PECL uri_template.
+ *
+ * @link http://tools.ietf.org/html/rfc6570
+ */
+final class UriTemplate
+{
+    /**
+     * @var array<string, array{prefix:string, joiner:string, query:bool}> Hash for quick operator lookups
+     */
+    private static $operatorHash = [
+        '' => ['prefix' => '', 'joiner' => ',', 'query' => false],
+        '+' => ['prefix' => '', 'joiner' => ',', 'query' => false],
+        '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false],
+        '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false],
+        '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false],
+        ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true],
+        '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true],
+        '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true],
+    ];
+
+    /**
+     * @var string[] Delimiters
+     */
+    private static $delims = [
+        ':',
+        '/',
+        '?',
+        '#',
+        '[',
+        ']',
+        '@',
+        '!',
+        '$',
+        '&',
+        '\'',
+        '(',
+        ')',
+        '*',
+        '+',
+        ',',
+        ';',
+        '=',
+    ];
+
+    /**
+     * @var string[] Percent encoded delimiters
+     */
+    private static $delimsPct = [
+        '%3A',
+        '%2F',
+        '%3F',
+        '%23',
+        '%5B',
+        '%5D',
+        '%40',
+        '%21',
+        '%24',
+        '%26',
+        '%27',
+        '%28',
+        '%29',
+        '%2A',
+        '%2B',
+        '%2C',
+        '%3B',
+        '%3D',
+    ];
+
+    /**
+     * @param array<string,mixed> $variables Variables to use in the template expansion
+     *
+     * @throws \RuntimeException
+     */
+    public static function expand(string $template, array $variables): string
+    {
+        if (false === \strpos($template, '{')) {
+            return $template;
+        }
+
+        /** @var string|null */
+        $result = \preg_replace_callback(
+            '/\{([^\}]+)\}/',
+            self::expandMatchCallback($variables),
+            $template
+        );
+
+        if (null === $result) {
+            throw new \RuntimeException(\sprintf('Unable to process template: %s', \preg_last_error_msg()));
+        }
+
+        return $result;
+    }
+
+    /**
+     * @param array<string,mixed> $variables Variables to use in the template expansion
+     *
+     * @return callable(string[]): string
+     */
+    private static function expandMatchCallback(array $variables): callable
+    {
+        return static function (array $matches) use ($variables): string {
+            return self::expandMatch($matches, $variables);
+        };
+    }
+
+    /**
+     * Process an expansion
+     *
+     * @param array<string,mixed> $variables Variables to use in the template expansion
+     * @param string[]            $matches   Matches met in the preg_replace_callback
+     *
+     * @return string Returns the replacement string
+     */
+    private static function expandMatch(array $matches, array $variables): string
+    {
+        $replacements = [];
+        $parsed = self::parseExpression($matches[1]);
+        $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
+        $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
+        $useQuery = self::$operatorHash[$parsed['operator']]['query'];
+        $allUndefined = true;
+
+        foreach ($parsed['values'] as $value) {
+            if (!isset($variables[$value['value']])) {
+                continue;
+            }
+
+            /** @var mixed */
+            $variable = $variables[$value['value']];
+            $actuallyUseQuery = $useQuery;
+            $expanded = '';
+
+            if (\is_array($variable)) {
+                $isAssoc = self::isAssoc($variable);
+                $kvp = [];
+                /** @var mixed $var */
+                foreach ($variable as $key => $var) {
+                    if ($isAssoc) {
+                        $key = \rawurlencode((string) $key);
+                        $isNestedArray = \is_array($var);
+                    } else {
+                        $isNestedArray = false;
+                    }
+
+                    if (!$isNestedArray) {
+                        $var = \rawurlencode((string) $var);
+                        if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
+                            $var = self::decodeReserved($var);
+                        }
+                    }
+
+                    if ($value['modifier'] === '*') {
+                        if ($isAssoc) {
+                            if ($isNestedArray) {
+                                // Nested arrays must allow for deeply nested structures.
+                                $var = \http_build_query([$key => $var], '', '&', \PHP_QUERY_RFC3986);
+                            } else {
+                                $var = \sprintf('%s=%s', (string) $key, (string) $var);
+                            }
+                        } elseif ($key > 0 && $actuallyUseQuery) {
+                            $var = \sprintf('%s=%s', $value['value'], (string) $var);
+                        }
+                    }
+
+                    /** @var string $var */
+
+                    $kvp[$key] = $var;
+                }
+
+                if (0 === \count($variable)) {
+                    $actuallyUseQuery = false;
+                } elseif ($value['modifier'] === '*') {
+                    $expanded = \implode($joiner, $kvp);
+                    if ($isAssoc) {
+                        // Don't prepend the value name when using the explode
+                        // modifier with an associative array.
+                        $actuallyUseQuery = false;
+                    }
+                } else {
+                    if ($isAssoc) {
+                        // When an associative array is encountered and the
+                        // explode modifier is not set, then the result must be
+                        // a comma separated list of keys followed by their
+                        // respective values.
+                        foreach ($kvp as $k => &$v) {
+                            $v = \sprintf('%s,%s', $k, $v);
+                        }
+                    }
+                    $expanded = \implode(',', $kvp);
+                }
+            } else {
+                $allUndefined = false;
+                if ($value['modifier'] === ':' && isset($value['position'])) {
+                    $variable = \substr((string) $variable, 0, $value['position']);
+                }
+                $expanded = \rawurlencode((string) $variable);
+                if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
+                    $expanded = self::decodeReserved($expanded);
+                }
+            }
+
+            if ($actuallyUseQuery) {
+                if (!$expanded && $joiner !== '&') {
+                    $expanded = $value['value'];
+                } else {
+                    $expanded = \sprintf('%s=%s', $value['value'], $expanded);
+                }
+            }
+
+            $replacements[] = $expanded;
+        }
+
+        $ret = \implode($joiner, $replacements);
+
+        if ('' === $ret) {
+            // Spec section 3.2.4 and 3.2.5
+            if (false === $allUndefined && ('#' === $prefix || '.' === $prefix)) {
+                return $prefix;
+            }
+        } else {
+            if ('' !== $prefix) {
+                return \sprintf('%s%s', $prefix, $ret);
+            }
+        }
+
+        return $ret;
+    }
+
+    /**
+     * Parse an expression into parts
+     *
+     * @param string $expression Expression to parse
+     *
+     * @return array{operator:string, values:array<array{value:string, modifier:(''|'*'|':'), position?:int}>}
+     */
+    private static function parseExpression(string $expression): array
+    {
+        $result = [];
+
+        if (isset(self::$operatorHash[$expression[0]])) {
+            $result['operator'] = $expression[0];
+            /** @var string */
+            $expression = \substr($expression, 1);
+        } else {
+            $result['operator'] = '';
+        }
+
+        $result['values'] = [];
+        foreach (\explode(',', $expression) as $value) {
+            $value = \trim($value);
+            $varspec = [];
+            if ($colonPos = \strpos($value, ':')) {
+                $varspec['value'] = (string) \substr($value, 0, $colonPos);
+                $varspec['modifier'] = ':';
+                $varspec['position'] = (int) \substr($value, $colonPos + 1);
+            } elseif (\substr($value, -1) === '*') {
+                $varspec['modifier'] = '*';
+                $varspec['value'] = (string) \substr($value, 0, -1);
+            } else {
+                $varspec['value'] = $value;
+                $varspec['modifier'] = '';
+            }
+            $result['values'][] = $varspec;
+        }
+
+        return $result;
+    }
+
+    /**
+     * Determines if an array is associative.
+     *
+     * This makes the assumption that input arrays are sequences or hashes.
+     * This assumption is a tradeoff for accuracy in favor of speed, but it
+     * should work in almost every case where input is supplied for a URI
+     * template.
+     */
+    private static function isAssoc(array $array): bool
+    {
+        return $array && \array_keys($array)[0] !== 0;
+    }
+
+    /**
+     * Removes percent encoding on reserved characters (used with + and #
+     * modifiers).
+     */
+    private static function decodeReserved(string $string): string
+    {
+        return \str_replace(self::$delimsPct, self::$delims, $string);
+    }
+}

+ 569 - 0
addons/cos/library/Qcloud/Cos/Client.php

@@ -0,0 +1,569 @@
+<?php
+
+namespace Qcloud\Cos;
+
+include("Common.php");
+
+use GuzzleHttp\Client as HttpClient;
+use GuzzleHttp\HandlerStack;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use GuzzleHttp\Command\Guzzle\Description;
+use GuzzleHttp\Command\Guzzle\GuzzleClient;
+use GuzzleHttp\Command\Guzzle\Deserializer;
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Middleware;
+use GuzzleHttp\Psr7;
+
+/**
+ * @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 CreateMediaJobs(array $args) 媒体任务
+ * @method object DescribeMediaJob(array $args) 查询指定的媒体任务
+ * @method object DescribeMediaJobs(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) 拉取符合条件的文档转码任务
+ * @method object DetectImage(array $args) 图片审核
+ * @method object DetectImages(array $args) 图片审核-批量
+ * @method object DetectVirus(array $args) 云查毒
+ * @method object GetDetectVirusResult(array $args) 查询病毒检测任务结果
+ * @method object GetDetectImageResult(array $args) 主动获取图片审核结果
+ * @method object CreateMediaVoiceSeparateJobs(array $args) 提交人声分离任务
+ * @method object DescribeMediaVoiceSeparateJob(array $args) 查询指定的人声分离任务
+ * @method object DetectWebpage(array $args) 提交网页审核任务
+ * @method object GetDetectWebpageResult(array $args) 查询网页审核任务结果
+ * @method object DescribeMediaBuckets(array $args) 查询媒体处理开通状态
+ * @method object GetPrivateM3U8(array $args) 获取私有 M3U8 ts 资源的下载授权
+ * @method object DescribeMediaQueues(array $args) 搜索媒体处理队列
+ * @method object UpdateMediaQueue(array $args) 更新媒体处理队列
+ * @method object CreateMediaSmartCoverJobs(array $args) 提交智能封面任务
+ * @method object CreateMediaVideoProcessJobs(array $args) 提交视频增强任务
+ * @method object CreateMediaVideoMontageJobs(array $args) 提交精彩集锦任务
+ * @method object CreateMediaAnimationJobs(array $args) 提交动图任务
+ * @method object CreateMediaPicProcessJobs(array $args) 提交图片处理任务
+ * @method object CreateMediaSegmentJobs(array $args) 提交转封装任务
+ * @method object CreateMediaVideoTagJobs(array $args) 提交视频标签任务
+ * @method object CreateMediaSuperResolutionJobs(array $args) 提交超分辨率任务
+ * @method object CreateMediaSDRtoHDRJobs(array $args) 提交 SDR to HDR 任务
+ * @method object CreateMediaDigitalWatermarkJobs(array $args) 嵌入数字水印任务(添加水印)
+ * @method object CreateMediaExtractDigitalWatermarkJobs(array $args) 提取数字水印任务(提取水印)
+ * @method object DetectLiveVideo(array $args) 直播流审核
+ * @method object CancelLiveVideoAuditing(array $args) 取消直播流审核
+ * @method object OpticalOcrRecognition(array $args) 通用文字识别
+ * @method object TriggerWorkflow(array $args) 手动触发工作流
+ * @method object GetWorkflowInstances(array $args) 获取工作流实例列表
+ * @method object GetWorkflowInstance(array $args) 获取工作流实例详情
+ * @method object CreateMediaSnapshotTemplate(array $args) 新增截图模板
+ * @method object UpdateMediaSnapshotTemplate(array $args) 更新截图模板
+ * @method object CreateMediaTranscodeTemplate(array $args) 新增转码模板
+ * @method object UpdateMediaTranscodeTemplate(array $args) 更新转码模板
+ * @method object CreateMediaHighSpeedHdTemplate(array $args) 新增极速高清转码模板
+ * @method object UpdateMediaHighSpeedHdTemplate(array $args) 更新极速高清转码模板
+ * @method object CreateMediaAnimationTemplate(array $args) 新增动图模板
+ * @method object UpdateMediaAnimationTemplate(array $args) 更新动图模板
+ * @method object CreateMediaConcatTemplate(array $args) 新增拼接模板
+ * @method object UpdateMediaConcatTemplate(array $args) 更新拼接模板
+ * @method object CreateMediaVideoProcessTemplate(array $args) 新增视频增强模板
+ * @method object UpdateMediaVideoProcessTemplate(array $args) 更新视频增强模板
+ * @method object CreateMediaVideoMontageTemplate(array $args) 新增精彩集锦模板
+ * @method object UpdateMediaVideoMontageTemplate(array $args) 更新精彩集锦模板
+ * @method object CreateMediaVoiceSeparateTemplate(array $args) 新增人声分离模板
+ * @method object UpdateMediaVoiceSeparateTemplate(array $args) 更新人声分离模板
+ * @method object CreateMediaSuperResolutionTemplate(array $args) 新增超分辨率模板
+ * @method object UpdateMediaSuperResolutionTemplate(array $args) 更新超分辨率模板
+ * @method object CreateMediaPicProcessTemplate(array $args) 新增图片处理模板
+ * @method object UpdateMediaPicProcessTemplate(array $args) 更新图片处理模板
+ * @method object CreateMediaWatermarkTemplate(array $args) 新增水印模板
+ * @method object UpdateMediaWatermarkTemplate(array $args) 更新水印模板
+ * @method object DescribeMediaTemplates(array $args) 查询模板列表
+ * @method object DescribeWorkflow(array $args) 搜索工作流
+ * @method object DeleteWorkflow(array $args) 删除工作流
+ * @method object CreateInventoryTriggerJob(array $args) 触发批量存量任务
+ * @method object DescribeInventoryTriggerJobs(array $args) 批量拉取存量任务
+ * @method object DescribeInventoryTriggerJob(array $args) 查询存量任务
+ * @method object CancelInventoryTriggerJob(array $args) 取消存量任务
+ * @method object CreateMediaNoiseReductionJobs(array $args) 提交音频降噪任务
+ * @method object ImageRepairProcess(array $args) 图片水印修复
+ * @method object ImageDetectCarProcess(array $args) 车辆车牌检测
+ * @method object ImageAssessQualityProcess(array $args) 图片质量评估
+ * @method object ImageSearchOpen(array $args) 开通以图搜图
+ * @method object ImageSearchAdd(array $args) 添加图库图片
+ * @method object ImageSearch(array $args) 图片搜索接口
+ * @method object ImageSearchDelete(array $args) 图片搜索接口
+ * @method object BindCiService(array $args) 绑定数据万象服务
+ * @method object GetCiService(array $args) 查询数据万象服务
+ * @method object UnBindCiService(array $args) 解绑数据万象服务
+ * @method object GetHotLink(array $args) 查询防盗链
+ * @method object AddHotLink(array $args) 查询防盗链
+ * @method object OpenOriginProtect(array $args) 开通原图保护
+ * @method object GetOriginProtect(array $args) 查询原图保护状态
+ * @method object CloseOriginProtect(array $args) 关闭原图保护
+ * @method object ImageDetectFace(array $args) 人脸检测
+ * @method object ImageFaceEffect(array $args) 人脸特效
+ * @method object IDCardOCR(array $args) 身份证识别
+ * @method object IDCardOCRByUpload(array $args) 身份证识别-上传时处理
+ * @method object GetLiveCode(array $args) 获取数字验证码
+ * @method object GetActionSequence(array $args) 获取动作顺序
+ * @method object DescribeDocProcessBuckets(array $args) 查询文档预览开通状态
+ * @method object UpdateDocProcessQueue(array $args) 更新文档转码队列
+ * @method object CreateMediaQualityEstimateJobs(array $args) 提交视频质量评分任务
+ * @method object CreateMediaStreamExtractJobs(array $args) 提交音视频流分离任务
+ * @see \Qcloud\Cos\Service::getService()
+ */
+class Client extends GuzzleClient {
+    const VERSION = '2.6.0';
+
+    public $httpClient;
+
+    private $api;
+    private $desc;
+    private $action;
+    private $operation;
+    private $cosConfig;
+    private $signature;
+    private $rawCosConfig;
+
+    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;
+        $this->cosConfig['appId'] = isset($cosConfig['credentials']['appId']) ? $cosConfig['credentials']['appId'] : null;
+        $this->cosConfig['secretId'] = isset($cosConfig['credentials']['secretId']) ? trim($cosConfig['credentials']['secretId']) : '';
+        $this->cosConfig['secretKey'] = isset($cosConfig['credentials']['secretKey']) ? trim($cosConfig['credentials']['secretKey']) : '';
+        $this->cosConfig['anonymous'] = isset($cosConfig['credentials']['anonymous']) ? $cosConfig['credentials']['anonymous'] : false;
+        $this->cosConfig['token'] = isset($cosConfig['credentials']['token']) ? trim($cosConfig['credentials']['token']) : null;
+        $this->cosConfig['timeout'] = isset($cosConfig['timeout']) ? $cosConfig['timeout'] : 3600;
+        $this->cosConfig['connect_timeout'] = isset($cosConfig['connect_timeout']) ? $cosConfig['connect_timeout'] : 3600;
+        $this->cosConfig['ip'] = isset($cosConfig['ip']) ? $cosConfig['ip'] : null;
+        $this->cosConfig['port'] = isset($cosConfig['port']) ? $cosConfig['port'] : null;
+        $this->cosConfig['endpoint'] = isset($cosConfig['endpoint']) ? $cosConfig['endpoint'] : null;
+        $this->cosConfig['domain'] = isset($cosConfig['domain']) ? $cosConfig['domain'] : null;
+        $this->cosConfig['proxy'] = isset($cosConfig['proxy']) ? $cosConfig['proxy'] : null;
+        $this->cosConfig['retry'] = isset($cosConfig['retry']) ? $cosConfig['retry'] : 1;
+        $this->cosConfig['userAgent'] = isset($cosConfig['userAgent']) ? $cosConfig['userAgent'] : 'cos-php-sdk-v5.'. Client::VERSION;
+        $this->cosConfig['pathStyle'] = isset($cosConfig['pathStyle']) ? $cosConfig['pathStyle'] : false;
+        $this->cosConfig['signHost'] = isset($cosConfig['signHost']) ? $cosConfig['signHost'] : true;
+        $this->cosConfig['allow_redirects'] = isset($cosConfig['allow_redirects']) ? $cosConfig['allow_redirects'] : false;
+        $this->cosConfig['allow_accelerate'] = isset($cosConfig['allow_accelerate']) ? $cosConfig['allow_accelerate'] : false;
+
+        // check config
+        $this->inputCheck();
+
+        $service = Service::getService();
+        $handler = HandlerStack::create();
+        $handler->push(Middleware::retry($this->retryDecide(), $this->retryDelay()));
+		$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
+			return $request->withHeader('User-Agent', $this->cosConfig['userAgent']);
+        }));
+        if ($this->cosConfig['anonymous'] != true) {
+            $handler->push($this::handleSignature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig));
+        }
+        if ($this->cosConfig['token'] != null) {
+            $handler->push(Middleware::mapRequest(function (RequestInterface $request) {
+                return $request->withHeader('x-cos-security-token', $this->cosConfig['token']);
+            }));
+        }
+        $handler->push($this::handleErrors());
+        $this->signature = new Signature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig, $this->cosConfig['token']);
+        $area = $this->cosConfig['allow_accelerate'] ? 'accelerate' : $this->cosConfig['region'];
+        $this->httpClient = new HttpClient([
+            'base_uri' => "{$this->cosConfig['schema']}://cos.{$area}.myqcloud.com/",
+            'timeout' => $this->cosConfig['timeout'],
+            'handler' => $handler,
+            'proxy' => $this->cosConfig['proxy'],
+            'allow_redirects' => $this->cosConfig['allow_redirects']
+        ]);
+        $this->desc = new Description($service);
+        $this->api = (array) $this->desc->getOperations();
+        parent::__construct($this->httpClient, $this->desc, [$this,
+        'commandToRequestTransformer'], [$this, 'responseToResultTransformer'],
+        null);
+    }
+
+    public function inputCheck() {
+        $message = null;
+        //检查Region
+        if (empty($this->cosConfig['region'])   &&
+            empty($this->cosConfig['domain'])   &&
+            empty($this->cosConfig['endpoint']) &&
+            empty($this->cosConfig['ip'])       &&
+            !$this->cosConfig['allow_accelerate']) {
+            $message = 'Region is empty';
+        }
+        //检查Secret
+        if (empty($this->cosConfig['secretId']) || empty($this->cosConfig['secretKey'])) {
+            $message = 'Secret is empty';
+        }
+        if ($message !== null) {
+            $e = new Exception\CosException($message);
+            $e->setExceptionCode('Invalid Argument');
+            throw $e;
+        }
+    }
+
+
+    public function retryDecide() {
+      return function (
+        $retries,
+        RequestInterface $request,
+        ResponseInterface $response = null,
+        \Exception $exception = null
+      ) {
+        if ($retries >= $this->cosConfig['retry']) {
+          return false;
+        }
+        if ($response != null && $response->getStatusCode() >= 400 ) {
+            return true;
+        }
+        if ($exception instanceof Exception\ServiceResponseException) {
+            if ($exception->getStatusCode() >= 400) {
+                return true;
+            }
+        }
+
+        if ($exception instanceof ConnectException) {
+          return true;
+        }
+
+        return false;
+      };
+    }
+
+    public function retryDelay() {
+        return function ($numberOfRetries) {
+            return 1000 * $numberOfRetries;
+        };
+    }
+
+    public function commandToRequestTransformer(CommandInterface $command)
+    {
+        $this->action = $command->GetName();
+        $this->operation = $this->api[$this->action];
+        $transformer = new CommandToRequestTransformer($this->cosConfig, $this->operation);
+        $seri = new Serializer($this->desc);
+        $request = $seri($command);
+        $request = $transformer->bucketStyleTransformer($command, $request);
+        $request = $transformer->uploadBodyTransformer($command, $request);
+        $request = $transformer->metadataTransformer($command, $request);
+        $request = $transformer->queryStringTransformer($command, $request);
+        $request = $transformer->headerTransformer($command, $request);
+        $request = $transformer->md5Transformer($command, $request);
+        $request = $transformer->specialParamTransformer($command, $request);
+        $request = $transformer->ciParamTransformer($command, $request);
+        $request = $transformer->cosDomain2CiTransformer($command, $request);
+        return $request;
+    }
+
+    public function responseToResultTransformer(ResponseInterface $response, RequestInterface $request, CommandInterface $command)
+    {
+        $transformer = new ResultTransformer($this->cosConfig, $this->operation);
+        $transformer->writeDataToLocal($command, $request, $response);
+        $deseri = new Deserializer($this->desc, true);
+        $result = $deseri($response, $request, $command);
+
+        $result = $transformer->metaDataTransformer($command, $response, $result);
+        $result = $transformer->extraHeadersTransformer($command, $request, $result);
+        $result = $transformer->selectContentTransformer($command, $result);
+        $result = $transformer->ciContentInfoTransformer($command, $result);
+        return $result;
+    }
+
+    public function __destruct() {
+    }
+
+    public function __call($method, array $args) {
+        try {
+            $rt = parent::__call(ucfirst($method), $args);
+            return $rt;
+        } catch (\Exception $e) {
+            $previous = $e->getPrevious();
+            if ($previous !== null) {
+                throw $previous;
+            } else {
+                throw $e;
+            }
+        }
+    }
+
+    public function getApi() {
+        return $this->api;
+    }
+
+    private function getCosConfig() {
+        return $this->cosConfig;
+    }
+
+    private function createPresignedUrl(RequestInterface $request, $expires) {
+        return $this->signature->createPresignedUrl($request, $expires);
+    }
+
+    public function getPresignedUrl($method, $args, $expires = "+30 minutes") {
+        $command = $this->getCommand($method, $args);
+        $request = $this->commandToRequestTransformer($command);
+        return $this->createPresignedUrl($request, $expires);
+    }
+
+
+    public function getObjectUrl($bucket, $key, $expires = "+30 minutes", array $args = array()) {
+        $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key));
+        $request = $this->commandToRequestTransformer($command);
+        return $this->createPresignedUrl($request, $expires)->__toString();
+    }
+
+    public function getObjectUrlWithoutSign($bucket, $key, array $args = array()) {
+        $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key));
+        $request = $this->commandToRequestTransformer($command);
+        return $request->getUri()-> __toString();
+    }
+
+    public function upload($bucket, $key, $body, $options = array()) {
+        $body = Psr7\Utils::streamFor($body);
+        $options['Retry'] = $this->cosConfig['retry'];
+        $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::DEFAULT_PART_SIZE;
+        if ($body->getSize() < $options['PartSize']) {
+            $rt = $this->putObject(array(
+                    'Bucket' => $bucket,
+                    'Key'    => $key,
+                    'Body'   => $body,
+                ) + $options);
+        }
+        else {
+            $multipartUpload = new MultipartUpload($this, $body, array(
+                    'Bucket' => $bucket,
+                    'Key' => $key,
+                ) + $options);
+
+            $rt = $multipartUpload->performUploading();
+        }
+        return $rt;
+    }
+
+    public function download($bucket, $key, $saveAs, $options = array()) {
+        $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : RangeDownload::DEFAULT_PART_SIZE;
+        $contentLength = 0;
+        $versionId = isset($options['VersionId']) ? $options['VersionId'] : '';
+
+        $rt = $this->headObject(array(
+                'Bucket'=>$bucket,
+                'Key'=>$key,
+                'VersionId'=>$versionId,
+            )
+        );
+        $contentLength = $rt['ContentLength'];
+        $resumableJson = [
+            'LastModified' => $rt['LastModified'],
+            'ContentLength' => $rt['ContentLength'],
+            'ETag' => $rt['ETag'],
+            'Crc64ecma' => $rt['Crc64ecma']
+        ];
+        $options['ResumableJson'] = $resumableJson;
+
+        if ($contentLength < $options['PartSize']) {
+            $rt = $this->getObject(array(
+                    'Bucket' => $bucket,
+                    'Key'    => $key,
+                    'SaveAs'   => $saveAs,
+                ) + $options);
+        } else {
+            $rangeDownload = new RangeDownload($this, $contentLength, $saveAs, array(
+                    'Bucket' => $bucket,
+                    'Key' => $key,
+                ) + $options);
+
+            $rt = $rangeDownload->performDownloading();
+        }
+        return $rt;
+    }
+
+    public function resumeUpload($bucket, $key, $body, $uploadId, $options = array()) {
+        $body = Psr7\Utils::streamFor($body);
+        $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::DEFAULT_PART_SIZE;
+        $multipartUpload = new MultipartUpload($this, $body, array(
+                'Bucket' => $bucket,
+                'Key' => $key,
+                'UploadId' => $uploadId,
+            ) + $options);
+
+        $rt = $multipartUpload->resumeUploading();
+        return $rt;
+    }
+
+    public function copy($bucket, $key, $copySource, $options = array()) {
+
+        $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : Copy::DEFAULT_PART_SIZE;
+
+        // set copysource client
+        $sourceConfig = $this->rawCosConfig;
+        $sourceConfig['region'] = $copySource['Region'];
+        $cosSourceClient = new Client($sourceConfig);
+        $copySource['VersionId'] = isset($copySource['VersionId']) ? $copySource['VersionId'] : '';
+
+        $rt = $cosSourceClient->headObject(
+            array('Bucket'=>$copySource['Bucket'],
+                'Key'=>$copySource['Key'],
+                'VersionId'=>$copySource['VersionId'],
+            )
+        );
+
+        $contentLength = $rt['ContentLength'];
+        // sample copy
+        if ($contentLength < $options['PartSize']) {
+            $rt = $this->copyObject(array(
+                    'Bucket' => $bucket,
+                    'Key'    => $key,
+                    'CopySource'   => "{$copySource['Bucket']}.cos.{$copySource['Region']}.myqcloud.com/". urlencode("{$copySource['Key']}")."?versionId={$copySource['VersionId']}",
+                ) + $options
+            );
+            return $rt;
+        }
+        // multi part copy
+        $copySource['ContentLength'] = $contentLength;
+        $copy = new Copy($this, $copySource, array(
+                'Bucket' => $bucket,
+                'Key'    => $key
+            ) + $options
+        );
+        return $copy->copy();
+    }
+
+    public function doesBucketExist($bucket, array $options = array())
+    {
+        try {
+            $this->HeadBucket(array(
+                'Bucket' => $bucket));
+            return true;
+        } catch (\Exception $e){
+            return false;
+        }
+    }
+
+    public function doesObjectExist($bucket, $key, array $options = array())
+    {
+        try {
+            $this->HeadObject(array(
+                'Bucket' => $bucket,
+                'Key' => $key));
+            return true;
+        } catch (\Exception $e){
+            return false;
+        }
+    }
+
+    public static function explodeKey($key) {
+        // Remove a leading slash if one is found
+        $split_key = explode('/', $key && $key[0] == '/' ? substr($key, 1) : $key);
+        // Remove empty element
+        $split_key = array_filter($split_key, function($var) {
+            return !($var == '' || $var == null);
+        });
+        $final_key = implode("/", $split_key);
+        if (substr($key, -1)  == '/') {
+            $final_key = $final_key . '/';
+        }
+        return $final_key;
+    }
+
+
+    public static function handleSignature($secretId, $secretKey, $options) {
+            return function (callable $handler) use ($secretId, $secretKey, $options) {
+                    return new SignatureMiddleware($handler, $secretId, $secretKey, $options);
+            };
+    }
+
+    public static function handleErrors() {
+            return function (callable $handler) {
+                    return new ExceptionMiddleware($handler);
+            };
+    }
+}

+ 370 - 0
addons/cos/library/Qcloud/Cos/CommandToRequestTransformer.php

@@ -0,0 +1,370 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Psr\Http\Message\RequestInterface;
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Psr7\Uri;
+use InvalidArgumentException;
+use Psr\Http\Message\UriInterface;
+
+class CommandToRequestTransformer {
+    private $config;
+    private $operation;
+
+    public function __construct( $config, $operation ) {
+        $this->config = $config;
+        $this->operation = $operation;
+    }
+
+    // format bucket style
+
+    public function bucketStyleTransformer( CommandInterface $command, RequestInterface $request ) {
+        $action = $command->getName();
+        if ($action == 'ListBuckets') {
+            $uri = "service.cos.myqcloud.com";
+    
+            if ($this->config['endpoint'] != null) {
+                $uri = $this->config['endpoint'];
+            }   
+            if ($this->config['domain'] != null) {
+                $uri = $this->config['domain'];
+            }   
+            if ($this->config['ip'] != null) {
+                $uri = $this->config['ip'];
+                if ($this->config['port'] != null) {
+                    $uri = $this->config['ip'] . ":" . $this->config['port'];
+                }   
+            }
+            return $request->withUri(new Uri($this->config['schema']."://". $uri. "/"));
+        }
+        $operation = $this->operation;
+        $bucketname = $command['Bucket'];
+
+        $appId = $this->config['appId'];
+        if ( $appId != null && endWith( $bucketname, '-'.$appId ) == false ) {
+            $bucketname = $bucketname.'-'.$appId;
+        }
+        $command['Bucket'] = $bucketname;
+
+        $uri = $operation['uri'];
+
+        // Hoststyle is used by default
+        // Pathstyle
+        if ( $this->config['pathStyle'] != true ) {
+            if ( isset( $operation['parameters']['Bucket'] ) && $command->hasParam( 'Bucket' ) ) {
+                $uri = str_replace( '{Bucket}', '', $uri );
+            }
+
+            if ( isset( $operation['parameters']['Key'] ) && $command->hasParam( 'Key' ) ) {
+                $uri = str_replace( '{/Key*}', encodeKey( $command['Key'] ), $uri );
+            }
+        }
+
+        if ($this->config['endpoint'] == null) {
+            $this->config['endpoint'] = "myqcloud.com";
+        }
+
+        $domain_type = '.cos.';
+        if ($action == 'PutBucketImageStyle' || $action == 'GetBucketImageStyle' || $action == 'DeleteBucketImageStyle'
+            || $action == 'PutBucketGuetzli' || $action == 'GetBucketGuetzli' || $action == 'DeleteBucketGuetzli'
+            || $action == 'BindCiService' || $action == 'GetCiService' || $action == 'UnBindCiService'
+            || $action == 'GetHotLink' || $action == 'AddHotLink'
+            || $action == 'OpenOriginProtect' || $action == 'GetOriginProtect' || $action == 'CloseOriginProtect') {
+            $domain_type = '.pic.';
+        }
+
+        $origin_host = $this->config['allow_accelerate'] ?
+            $bucketname . $domain_type . 'accelerate' . '.' . $this->config['endpoint'] :
+            $bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint'];
+
+        // domain
+        if ( $this->config['domain'] != null ) {
+            $origin_host = $this->config['domain'];
+        }
+        $host = $origin_host;
+        if ( $this->config['ip'] != null ) {
+            $host = $this->config['ip'];
+            if ( $this->config['port'] != null ) {
+                $host = $this->config['ip'] . ':' . $this->config['port'];
+            }
+        }
+
+        $path = $this->config['schema'].'://'. $host . $uri;
+        $uri = new Uri( $path );
+        $query = $request->getUri()->getQuery();
+        if ( $uri->getQuery() != $query && $uri->getQuery() != '' ) {
+            $query = $uri->getQuery() . '&' . $request->getUri()->getQuery();
+        }
+        $uri = $uri->withQuery( $query );
+        $request = $request->withUri( $uri );
+        $request = $request->withHeader( 'Host', $origin_host );
+        return $request;
+    }
+
+    // format upload body
+
+    public function uploadBodyTransformer( CommandInterface $command, $request, $bodyParameter = 'Body', $sourceParameter = 'SourceFile' ) {
+
+        $operation = $this->operation;
+        if ( !isset( $operation['parameters']['Body'] ) ) {
+            return $request;
+        }
+        $source = isset( $command[$sourceParameter] ) ? $command[$sourceParameter] : null;
+        $body = isset( $command[$bodyParameter] ) ? $command[$bodyParameter] : null;
+        // If a file path is passed in then get the file handle
+        if ( is_string( $source ) && file_exists( $source ) ) {
+            $body = fopen( $source, 'rb' );
+        }
+        // Prepare the body parameter and remove the source file parameter
+        if ( null !== $body ) {
+            return $request;
+        } else {
+            throw new InvalidArgumentException(
+                "You must specify a non-null value for the {$bodyParameter} or {$sourceParameter} parameters." );
+            }
+        }
+
+        // update md5
+
+        public function md5Transformer( CommandInterface $command, $request ) {
+            $operation = $this->operation;
+            if ( isset( $operation['data']['contentMd5'] ) ) {
+                $request = $this->addMd5( $request );
+            }
+            if ( isset( $operation['parameters']['ContentMD5'] ) &&
+            isset( $command['ContentMD5'] ) ) {
+                $value = $command['ContentMD5'];
+                if ( $value != false ) {
+                    $request = $this->addMd5( $request );
+                }
+            }
+
+            return $request;
+        }
+
+        // add Query string
+
+        public function queryStringTransformer( CommandInterface $command, $request ) {
+            $operation = $this->operation;
+            if ( isset( $command['Params'] ) ) {
+                $params = $command['Params'];
+                foreach ( $params as $key => $value ) {
+                    $uri = $request->getUri();
+                    $query = $uri->getQuery();
+                    $uri = $uri->withQuery($query. "&" . urlencode($key) . "=" . $value );
+                    $request = $request->withUri( $uri );
+                }
+            }
+
+            return $request;
+        }
+
+        // add Header string
+
+        public function headerTransformer( CommandInterface $command, $request ) {
+            $operation = $this->operation;
+            if ( isset( $command['Headers'] ) ) {
+                $headers = $command['Headers'];
+                foreach ( $headers as $key => $value ) {
+                    $request = $request->withHeader( $key, $value);
+                }
+            }
+            return $request;
+        }
+
+        // add meta
+
+        public function metadataTransformer( CommandInterface $command, $request ) {
+            $operation = $this->operation;
+            if ( isset( $command['Metadata'] ) ) {
+                $meta = $command['Metadata'];
+                foreach ( $meta as $key => $value ) {
+                    $request = $request->withHeader( 'x-cos-meta-' . $key, $value );
+                }
+            }
+            $request = headersMap( $command, $request );
+
+            return $request;
+        }
+
+        // count md5
+
+        private function addMd5( $request ) {
+            $body = $request->getBody();
+            if ( $body && $body->getSize() > 0 ) {
+                $md5 = base64_encode( md5( $body, true ) );
+                return $request->withHeader( 'Content-MD5', $md5 );
+            }
+            return $request;
+        }
+
+        // inventoryId
+
+        public function specialParamTransformer( CommandInterface $command, $request ) {
+            $action = $command->getName();
+            if ( $action == 'PutBucketInventory' ) {
+                $id = $command['Id'];
+                $uri = $request->getUri();
+                $query = $uri->getQuery();
+                $uri = $uri->withQuery( $query . '&Id='.$id );
+                return $request->withUri( $uri );
+            }
+            return $request;
+        }
+
+        public function ciParamTransformer( CommandInterface $command, $request ) {
+            $action = $command->getName();
+            if ( $action == 'GetObject' ) {
+                if(str_contains($uri = $request->getUri(), '%21') ) {
+                    $uri = new Uri( str_replace('%21', '!', $uri) );
+                    $request = $request->withUri( $uri );
+                }
+                if(isset($command['ImageHandleParam']) && $command['ImageHandleParam']){
+                    $uri = $request->getUri();
+                    $query = $uri->getQuery();
+                    if($query){
+                        $query .= "&" . urlencode($command['ImageHandleParam']);
+                    }else{
+                        $query .= urlencode($command['ImageHandleParam']);
+                    }
+                    $uri = $uri->withQuery($query);
+                    $request = $request->withUri( $uri );
+                }
+            }
+            return $request;
+        }
+
+        public function cosDomain2CiTransformer(CommandInterface $command, $request) {
+            $action = $command->getName();
+            if(key_exists($action, array(
+                'DescribeMediaBuckets' => 1,
+                'DescribeDocProcessBuckets' =>1,
+            ))) {
+                $origin_host = "ci.{$this->config['region']}.myqcloud.com";
+                $host = $origin_host;
+                if ($this->config['ip'] != null) {
+                    $host = $this->config['ip'];
+                    if ($this->config['port'] != null) {
+                        $host = $this->config['ip'] . ":" . $this->config['port'];
+                    }
+                }
+
+                $path = $this->config['schema'].'://'. $host . $request->getUri()->getPath();
+                $uri = new Uri( $path );
+                $query = $request->getUri()->getQuery();
+                $uri = $uri->withQuery( $query );
+                $request = $request->withUri( $uri );
+                $request = $request->withHeader( 'Host', $origin_host );
+                return $request;
+            }
+            $ciActions = array(
+                'DetectText' => 1,
+                'CreateMediaTranscodeJobs' => 1,
+                'CreateMediaJobs' => 1,
+                'DescribeMediaJob' => 1,
+                'DescribeMediaJobs' => 1,
+                'CreateMediaSnapshotJobs' => 1,
+                'CreateMediaConcatJobs' => 1,
+                'DetectAudio' => 1,
+                'GetDetectAudioResult' => 1,
+                'GetDetectTextResult' => 1,
+                'DetectVideo' => 1,
+                'GetDetectVideoResult' => 1,
+                'DetectDocument' => 1,
+                'GetDetectDocumentResult' => 1,
+                'CreateDocProcessJobs' => 1,
+                'DescribeDocProcessQueues' => 1,
+                'DescribeDocProcessJob' => 1,
+                'GetDescribeDocProcessJobs' => 1,
+                'DetectImages' => 1,
+                'GetDetectImageResult' => 1,
+                'DetectVirus' => 1,
+                'GetDetectVirusResult' => 1,
+                'CreateMediaVoiceSeparateJobs' => 1,
+                'DescribeMediaVoiceSeparateJob' => 1,
+                'DetectWebpage' => 1,
+                'GetDetectWebpageResult' => 1,
+                'DescribeMediaQueues' => 1,
+                'UpdateMediaQueue' => 1,
+                'CreateMediaSmartCoverJobs' => 1,
+                'CreateMediaVideoProcessJobs' => 1,
+                'CreateMediaVideoMontageJobs' => 1,
+                'CreateMediaAnimationJobs' => 1,
+                'CreateMediaPicProcessJobs' => 1,
+                'CreateMediaSegmentJobs' => 1,
+                'CreateMediaVideoTagJobs' => 1,
+                'CreateMediaSuperResolutionJobs' => 1,
+                'CreateMediaSDRtoHDRJobs' => 1,
+                'CreateMediaDigitalWatermarkJobs' => 1,
+                'CreateMediaExtractDigitalWatermarkJobs' => 1,
+                'DetectLiveVideo' => 1,
+                'CancelLiveVideoAuditing' => 1,
+                'TriggerWorkflow' => 1,
+                'GetWorkflowInstances' => 1,
+                'GetWorkflowInstance' => 1,
+                'CreateMediaSnapshotTemplate' => 1,
+                'UpdateMediaSnapshotTemplate' => 1,
+                'CreateMediaTranscodeTemplate' => 1,
+                'UpdateMediaTranscodeTemplate' => 1,
+                'CreateMediaHighSpeedHdTemplate' => 1,
+                'UpdateMediaHighSpeedHdTemplate' => 1,
+                'CreateMediaAnimationTemplate' => 1,
+                'UpdateMediaAnimationTemplate' => 1,
+                'CreateMediaConcatTemplate' => 1,
+                'UpdateMediaConcatTemplate' => 1,
+                'CreateMediaVideoProcessTemplate' => 1,
+                'UpdateMediaVideoProcessTemplate' => 1,
+                'CreateMediaVideoMontageTemplate' => 1,
+                'UpdateMediaVideoMontageTemplate' => 1,
+                'CreateMediaVoiceSeparateTemplate' => 1,
+                'UpdateMediaVoiceSeparateTemplate' => 1,
+                'CreateMediaSuperResolutionTemplate' => 1,
+                'UpdateMediaSuperResolutionTemplate' => 1,
+                'CreateMediaPicProcessTemplate' => 1,
+                'UpdateMediaPicProcessTemplate' => 1,
+                'CreateMediaWatermarkTemplate' => 1,
+                'UpdateMediaWatermarkTemplate' => 1,
+                'DescribeMediaTemplates' => 1,
+                'DescribeWorkflow' => 1,
+                'DeleteWorkflow' => 1,
+                'CreateInventoryTriggerJob' => 1,
+                'DescribeInventoryTriggerJobs' => 1,
+                'DescribeInventoryTriggerJob' => 1,
+                'CancelInventoryTriggerJob' => 1,
+                'CreateMediaNoiseReductionJobs' => 1,
+                'ImageSearchOpen' => 1,
+                'UpdateDocProcessQueue' => 1,
+                'CreateMediaQualityEstimateJobs' => 1,
+                'CreateMediaStreamExtractJobs' => 1,
+            );
+            if (key_exists($action, $ciActions)) {
+                $bucketname = $command['Bucket'];
+                $appId = $this->config['appId'];
+                if ( $appId != null && endWith( $bucketname, '-'.$appId ) == false ) {
+                    $bucketname = $bucketname.'-'.$appId;
+                }
+                $command['Bucket'] = $bucketname;
+                $domain_type = '.ci.';
+                $origin_host = $bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint'];
+                $host = $origin_host;
+                if ( $this->config['ip'] != null ) {
+                    $host = $this->config['ip'];
+                    if ( $this->config['port'] != null ) {
+                        $host = $this->config['ip'] . ':' . $this->config['port'];
+                    }
+                }
+                $path = $this->config['schema'].'://'. $host . $request->getUri()->getPath();
+                $uri = new Uri( $path );
+                $query = $request->getUri()->getQuery();
+                $uri = $uri->withQuery( $query );
+                $request = $request->withUri( $uri );
+                $request = $request->withHeader( 'Host', $origin_host );
+            }
+            return $request;
+        }
+
+        public function __destruct() {
+        }
+
+    }

+ 69 - 0
addons/cos/library/Qcloud/Cos/Common.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace Qcloud\Cos;
+
+function region_map($region)
+{
+    $regionmap = array(
+        'cn-east' => 'ap-shanghai',
+        'cn-south' => 'ap-guangzhou',
+        'cn-north' => 'ap-beijing-1',
+        'cn-south-2' => 'ap-guangzhou-2',
+        'cn-southwest' => 'ap-chengdu',
+        'sg' => 'ap-singapore',
+        'tj' => 'ap-beijing-1',
+        'bj' => 'ap-beijing',
+        'sh' => 'ap-shanghai',
+        'gz' => 'ap-guangzhou',
+        'cd' => 'ap-chengdu',
+        'sgp' => 'ap-singapore'
+    );
+    if (isset($regionmap[$region])) {
+        return $regionmap[$region];
+    }
+    return $region;
+}
+
+function encodeKey($key)
+{
+    return str_replace('%2F', '/', rawurlencode($key));
+}
+
+function endWith($haystack, $needle)
+{
+    $length = strlen($needle);
+    if ($length == 0) {
+        return true;
+    }
+    return (substr($haystack, -$length) === $needle);
+}
+
+function startWith($haystack, $needle)
+{
+    $length = strlen($needle);
+    if ($length == 0) {
+        return true;
+    }
+    return (substr($haystack, 0, $length) === $needle);
+}
+
+function headersMap($command, $request)
+{
+    $headermap = array(
+        'TransferEncoding' => 'Transfer-Encoding',
+        'ChannelId' => 'x-cos-channel-id'
+    );
+    foreach ($headermap as $key => $value) {
+        if (isset($command[$key])) {
+            $request = $request->withHeader($value, $command[$key]);
+        }
+    }
+    return $request;
+}
+
+if (!function_exists('str_contains')) {
+    function str_contains($haystack, $needle)
+    {
+        return strpos($haystack, $needle) !== false;
+    }
+}

+ 140 - 0
addons/cos/library/Qcloud/Cos/Copy.php

@@ -0,0 +1,140 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use GuzzleHttp\Pool;
+
+class Copy {
+    const MIN_PART_SIZE = 1048576;
+    const MAX_PART_SIZE = 5368709120;
+    const DEFAULT_PART_SIZE = 52428800;
+    const MAX_PARTS     = 10000;
+
+    private $client;
+    private $copySource;
+    private $options;
+    private $partSize;
+    private $parts;
+    private $size;
+    private $commandList = [];
+    private $requestList = [];
+
+    public function __construct($client, $source, $options = array()) {
+        $minPartSize = $options['PartSize'];
+        unset($options['PartSize']);
+        $this->client = $client;
+        $this->copySource = $source;
+        $this->options = $options;
+        $this->size = $source['ContentLength'];
+        unset($source['ContentLength']);
+        $this->partSize = $this->calculatePartSize($minPartSize);
+        $this->concurrency = isset($options['Concurrency']) ? $options['Concurrency'] : 10;
+        $this->retry = isset($options['Retry']) ? $options['Retry'] : 5;
+    }
+    public function copy() {
+        $uploadId= $this->initiateMultipartUpload();
+        for ($i = 0; $i < $this->retry; $i += 1) {
+            $rt = $this->uploadParts($uploadId);
+            if ($rt == 0) {
+                break;
+            }
+            sleep(1 << $i);
+        }
+        foreach ( $this->parts as $key => $row ){
+            $num1[$key] = $row ['PartNumber'];
+            $num2[$key] = $row ['ETag'];
+        }
+        array_multisort($num1, SORT_ASC, $num2, SORT_ASC, $this->parts);
+        return $this->client->completeMultipartUpload(array(
+            'Bucket' => $this->options['Bucket'],
+            'Key' => $this->options['Key'],
+            'UploadId' => $uploadId,
+            'Parts' => $this->parts)
+        );
+
+    }
+    public function uploadParts($uploadId) {
+        $copyRequests = function ($uploadId) {
+            $offset = 0;
+            $partNumber = 1;
+            $partSize = $this->partSize;
+            $finishedNum = 0;
+            $this->parts = array();
+            for ($index = 1; ; $index ++) {
+                if ($offset + $partSize  >= $this->size)
+                {
+                    $partSize = $this->size - $offset;
+                }
+                $copySourcePath = $this->copySource['Bucket']. '.cos.'. $this->copySource['Region'].
+                    ".myqcloud.com/". $this->copySource['Key']. "?versionId=". $this->copySource['VersionId'];
+                $params = array(
+                    'Bucket' => $this->options['Bucket'],
+                    'Key' => $this->options['Key'],
+                    'UploadId' => $uploadId,
+                    'PartNumber' => $partNumber,
+                    'CopySource'=> $copySourcePath,
+                    'CopySourceRange' => 'bytes='.((string)$offset).'-'.(string)($offset+$partSize - 1),
+                );
+                if(!isset($this->parts[$partNumber])) {
+                    $command = $this->client->getCommand('uploadPartCopy', $params);
+                    $request = $this->client->commandToRequestTransformer($command);
+                    $this->commandList[$index] = $command;
+                    $this->requestList[$index] = $request;
+                    yield $request;
+                }
+                ++$partNumber;
+                $offset += $partSize;
+                if ($this->size == $offset) {
+                    break;
+                }
+            }
+        };
+        $pool = new Pool($this->client->httpClient, $copyRequests($uploadId), [
+            'concurrency' => $this->concurrency,
+            'fulfilled' => function ($response, $index) {
+                $index = $index + 1;
+                $response = $this->client->responseToResultTransformer($response, $this->requestList[$index], $this->commandList[$index]);
+                $part = array('PartNumber' => $index, 'ETag' => $response['ETag']);
+                $this->parts[$index] = $part;
+            },
+           
+            'rejected' => function ($reason, $index) { 
+                $index = $index += 1;
+                $retry = 2;
+                for ($i = 1; $i <= $retry; $i++) {
+                    try {
+                        $rt =$this->client->execute($this->commandList[$index]);
+                        $part = array('PartNumber' => $index, 'ETag' => $rt['ETag']);
+                        $this->parts[$index] = $part;
+                    } catch(\Exception $e) {
+                        if ($i == $retry) {
+                            throw($e);
+                        }
+                    }
+                }
+            },
+        ]);
+        
+        // Initiate the transfers and create a promise
+        $promise = $pool->promise();
+        
+        // Force the pool of requests to complete.
+        $promise->wait();
+    }
+
+
+    private function calculatePartSize($minPartSize)
+    {
+        $partSize = intval(ceil(($this->size / self::MAX_PARTS)));
+        $partSize = max($minPartSize, $partSize);
+        $partSize = min($partSize, self::MAX_PART_SIZE);
+        $partSize = max($partSize, self::MIN_PART_SIZE);
+        return $partSize;
+    }
+
+    private function initiateMultipartUpload() {
+        $result = $this->client->createMultipartUpload($this->options);
+        return $result['UploadId'];
+    }
+
+}

+ 11918 - 0
addons/cos/library/Qcloud/Cos/Descriptions.php

@@ -0,0 +1,11918 @@
+<?php
+
+namespace Qcloud\Cos;
+
+/**
+ * 为 src/Qcloud/Cos/Service.php 服务,视觉上区分各方法的参数\输出描述
+ * 原service的参数描述可不改动
+ * Class Descriptions
+ * @package Qcloud\Cos
+ */
+class Descriptions {
+    /**
+     * 视频转码
+     * @return array
+     */
+    public static function CreateMediaTranscodeJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaTranscodeJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Tag' => array('location' => 'xml', 'type' => 'string', ),
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'WatermarkTemplateId' => array(
+                            'type' => 'array', 
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'WatermarkTemplateId',
+                                'type' => 'string',
+                                'location' => 'xml',
+                                'sentAs' => 'WatermarkTemplateId',
+                            ),
+                        ),
+                        'Transcode' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Container' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Video' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TimeInterval' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Audio' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TransConfig' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsEncrypt' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Watermark' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'Watermark',
+                                'type' => 'object',
+                                'sentAs' => 'Watermark',
+                                'properties' => array(
+                                    'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Pos' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'LocMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Image' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Background' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'Text' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'FontSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'FontType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'FontColor' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                ),
+                            )
+                        ),
+                        'RemoveWatermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'DigitalWatermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Message' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Version' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IgnoreError' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaTranscodeJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'data' => array(
+                        'xmlFlattened' => true,
+                    ),
+                    'items' => array(
+                        'name' => 'Operation',
+                        'type' => 'object',
+                        'sentAs' => 'Operation',
+                        'properties' => array(
+                            'Tag' => array('location' => 'xml', 'type' => 'string', ),
+                            'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'TranscodeTemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'VideoProcess' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ColorEnhance' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Contrast' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Correction' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Saturation' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'MsSharpen' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SharpenLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'VideoMontage' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Container' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'Video' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'Audio' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'Animation' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Container' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'Video' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'AnimateOnlyKeepKeyFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'AnimateTimeIntervalOfFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'AnimateFramesPerSecond' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Quality' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'TimeInterval' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'Snapshot' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                            'VoiceSeparate' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'AudioMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'AudioConfig' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'Segment' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                            'SDRtoHDR' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'HdrMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                            'SuperResolution' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Resolution' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'EnableScaleUp' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                            'WatermarkTemplateId' => array(
+                                'type' => 'array', 
+                                'location' => 'xml',
+                                'data' => array(
+                                    'xmlFlattened' => true,
+                                ),
+                                'items' => array(
+                                    'name' => 'WatermarkTemplateId',
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                    'sentAs' => 'WatermarkTemplateId',
+                                ),
+                            ),
+                            'Transcode' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Container' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'Video' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'TimeInterval' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'Audio' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                    'TransConfig' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'HlsEncrypt' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                    'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'Watermark' => array(
+                                'type' => 'array',
+                                'location' => 'xml',
+                                'data' => array(
+                                    'xmlFlattened' => true,
+                                ),
+                                'items' => array(
+                                    'name' => 'Watermark',
+                                    'type' => 'object',
+                                    'sentAs' => 'Watermark',
+                                    'properties' => array(
+                                        'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Pos' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'LocMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Image' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'Background' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                        ),
+                                        'Text' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'FontSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'FontType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'FontColor' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                        ),
+                                    ),
+                                )
+                            ),
+                            'RemoveWatermark' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                            'Output' => array(
+                                'required' => true,
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Region' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                                    'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                                    'Object' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ),
+                                    'AuObject' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ),
+                                    'SpriteObject' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeMediaJob() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}jobs/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeMediaJobOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function DescribeMediaJobOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeMediaJobs() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeMediaJobsOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Tag' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'tag',
+                ),
+                'QueueId' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'queueId',
+                ),
+                'OrderByTime' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'orderByTime',
+                ),
+                'NextToken' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'nextToken',
+                ),
+                'Size' => array(
+                    'type' => 'integer',
+                    'location' => 'query',
+                    'sentAs' => 'size',
+                ),
+                'States' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'states',
+                ),
+                'StartCreationTime' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'startCreationTime',
+                ),
+                'EndCreationTime' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'endCreationTime',
+                ),
+            ),
+        );
+    }
+    public static function DescribeMediaJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSnapshotJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaSnapshotJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Output' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SpriteObject' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Snapshot' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSnapshotJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaConcatJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaConcatJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true, 
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' =>false, 'type' => 'string', 'location' => 'xml', ), // 拼接任务Input可以为空,完全用数组内的元素拼接
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Output' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'ConcatTemplate' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Audio' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Index' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'DirectConcat' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'ConcatFragments' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'data' => array(
+                                        'xmlFlattened' => true,
+                                    ),
+                                    'items' => array(
+                                        'name' => 'ConcatFragment',
+                                        'type' => 'object',
+                                        'sentAs' => 'ConcatFragment',
+                                        'properties' => array(
+                                            'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            // 'Mode' => array( 'type' => 'string', 'location' => 'xml', ), 拼接接口不需要Mode参数
+                                        ),
+                                    ),
+                                ),
+                                'Video' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Container' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaConcatJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DetectAudio() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}audio/auditing',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectAudioOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Input' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Url' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Object' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'DataId' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'UserInfo' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Conf' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'DetectType' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Callback' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'BizType' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'CallbackVersion' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'CallbackType' => array(
+                            'type' => 'integer',
+                            'location' => 'xml',
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function DetectAudioOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectAudioResult() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}audio/auditing/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDetectAudioResultOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectAudioResultOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Message' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'BucketId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Result' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'ForbidState' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'AudioText' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'PornInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'TerrorismInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'PoliticsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'AdsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'TeenagerInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Section' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'OffsetTime' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                    'Duration' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                    'Result' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                    'PornInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'SpeakerResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                            'RecognitionResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'TerrorismInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'SpeakerResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                            'RecognitionResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'PoliticsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'SpeakerResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                            'RecognitionResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'AdsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'SpeakerResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                            'RecognitionResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'TeenagerInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'SpeakerResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                            'RecognitionResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'LanguageResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                'StartTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                'EndTime' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'UserInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                        'ListInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ListResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'CosHeaders' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectTextResult() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}text/auditing/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDetectTextResultOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function GetDetectTextResultOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Message' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Content' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SectionCount' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Result' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'PornInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'TerrorismInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'PoliticsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'AdsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'IllegalInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'AbuseInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Section' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'StartByte' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                    'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Result' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                    'PornInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Keywords' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'TerrorismInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Keywords' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'PoliticsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Keywords' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'AdsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Keywords' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'IllegalInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Keywords' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'AbuseInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                            'Keywords' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'UserInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                        'ListInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ListResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function DetectVideo() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}video/auditing',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectVideoOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Input' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserInfo' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Conf' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'DetectType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Callback' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'BizType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CallbackVersion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DetectContent' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'CallbackType' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'Snapshot' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'TimeInterval' => array( 'type' => 'numeric', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function DetectVideoOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectVideoResult() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}video/auditing/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDetectVideoResultOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function GetDetectVideoResultOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array('type' => 'string', 'location' => 'xml',),
+                        'Message' => array('type' => 'string', 'location' => 'xml',),
+                        'DataId' => array('type' => 'string', 'location' => 'xml',),
+                        'JobId' => array('type' => 'string', 'location' => 'xml',),
+                        'State' => array('type' => 'string', 'location' => 'xml',),
+                        'CreationTime' => array('type' => 'string', 'location' => 'xml',),
+                        'Object' => array('type' => 'string', 'location' => 'xml',),
+                        'Url' => array('type' => 'string', 'location' => 'xml',),
+                        'SnapshotCount' => array('type' => 'string', 'location' => 'xml',),
+                        'Label' => array('type' => 'string', 'location' => 'xml',),
+                        'Result' => array('type' => 'integer', 'location' => 'xml',),
+                        'PornInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                'Count' => array('type' => 'integer', 'location' => 'xml',),
+                            )
+                        ),
+                        'TerrorismInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                'Count' => array('type' => 'integer', 'location' => 'xml',),
+                            )
+                        ),
+                        'PoliticsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                'Count' => array('type' => 'integer', 'location' => 'xml',),
+                            )
+                        ),
+                        'AdsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                'Count' => array('type' => 'integer', 'location' => 'xml',),
+                            )
+                        ),
+                        'TeenagerInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                'Count' => array('type' => 'integer', 'location' => 'xml',),
+                            )
+                        ),
+                        'Snapshot' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Url' => array('type' => 'string', 'location' => 'xml',),
+                                    'SnapshotTime' => array('type' => 'integer', 'location' => 'xml',),
+                                    'Text' => array('type' => 'string', 'location' => 'xml',),
+                                    'Label' => array('type' => 'string', 'location' => 'xml',),
+                                    'Result' => array('type' => 'integer', 'location' => 'xml',),
+                                    'PornInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Label' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                            'OcrResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Text' => array('type' => 'integer', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array('type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'ObjectResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'TerrorismInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Label' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                            'OcrResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Text' => array('type' => 'integer', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array('type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'ObjectResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'PoliticsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Label' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                            'OcrResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Text' => array('type' => 'integer', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array('type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'ObjectResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'AdsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Label' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                            'OcrResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Text' => array('type' => 'integer', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array('type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'ObjectResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'TeenagerInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Label' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                            'OcrResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Text' => array('type' => 'integer', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array('type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'ObjectResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                        'Location' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                            )
+                                                        ),
+                                                    )
+                                                ),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                )
+                            ),
+                        ),
+                        'AudioSection' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Url' => array('type' => 'string', 'location' => 'xml',),
+                                    'Text' => array('type' => 'string', 'location' => 'xml',),
+                                    'OffsetTime' => array('type' => 'integer', 'location' => 'xml',),
+                                    'Duration' => array('type' => 'integer', 'location' => 'xml',),
+                                    'Label' => array('type' => 'string', 'location' => 'xml',),
+                                    'Result' => array('type' => 'integer', 'location' => 'xml',),
+                                    'PornInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'string', 'location' => 'xml',),
+                                            'Score' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array('type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'TerrorismInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'string', 'location' => 'xml',),
+                                            'Score' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array('type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'PoliticsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'string', 'location' => 'xml',),
+                                            'Score' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array('type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'AdsInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'string', 'location' => 'xml',),
+                                            'Score' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array('type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                    'TeenagerInfo' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'HitFlag' => array('type' => 'string', 'location' => 'xml',),
+                                            'Score' => array('type' => 'string', 'location' => 'xml',),
+                                            'Category' => array('type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array('type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'LibResults' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                        'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        'Keywords' => array(
+                                                            'type' => 'array',
+                                                            'location' => 'xml',
+                                                            'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        )
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'UserInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                        'ListInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ListResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    )
+                ),
+                'NonExistJobIds' => array('type' => 'string', 'location' => 'xml',)
+            ),
+        );
+    }
+
+    public static function DetectDocument() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}document/auditing',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectDocumentOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Input' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserInfo' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Conf' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'DetectType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Callback' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'BizType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CallbackType' => array( 'type' => 'integer', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function DetectDocumentOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectDocumentResult() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}document/auditing/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDetectDocumentResultOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function GetDetectDocumentResultOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array('type' => 'string', 'location' => 'xml',),
+                        'Message' => array('type' => 'string', 'location' => 'xml',),
+                        'DataId' => array('type' => 'string', 'location' => 'xml',),
+                        'JobId' => array('type' => 'string', 'location' => 'xml',),
+                        'State' => array('type' => 'string', 'location' => 'xml',),
+                        'Suggestion' => array('type' => 'integer', 'location' => 'xml',),
+                        'Label' => array('type' => 'string', 'location' => 'xml',),
+                        'CreationTime' => array('type' => 'string', 'location' => 'xml',),
+                        'Object' => array('type' => 'string', 'location' => 'xml',),
+                        'Url' => array('type' => 'string', 'location' => 'xml',),
+                        'PageCount' => array('type' => 'integer', 'location' => 'xml',),
+                        'Labels' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'PornInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'TerrorismInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'PoliticsInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'AdsInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'PageSegment' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Results' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Url' => array('type' => 'string', 'location' => 'xml',),
+                                            'Text' => array('type' => 'string', 'location' => 'xml',),
+                                            'PageNumber' => array('type' => 'integer', 'location' => 'xml',),
+                                            'SheetNumber' => array('type' => 'integer', 'location' => 'xml',),
+                                            'Label' => array('type' => 'string', 'location' => 'xml',),
+                                            'Suggestion' => array('type' => 'integer', 'location' => 'xml',),
+                                            'PornInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array('type' => 'string', 'location' => 'xml',)
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'TerrorismInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array('type' => 'string', 'location' => 'xml',)
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'PoliticsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array('type' => 'string', 'location' => 'xml',)
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'AdsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array('type' => 'string', 'location' => 'xml',)
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array('type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array('type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'UserInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                        'ListInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ListResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateDocProcessJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}doc_jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateDocProcessJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Tag' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'xml',
+                ),
+                'QueueId' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'xml',
+                ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Output' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array(
+                                    'type' => 'string','required' => true,'location' => 'xml',
+                                ),
+                                'Bucket' => array(
+                                    'type' => 'string','required' => true,'location' => 'xml',
+                                ),
+                                'Object' => array(
+                                    'type' => 'string','required' => true,'location' => 'xml',
+                                ),
+                            ),
+                        ),
+                        'DocProcess' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'SrcType' => array(
+                                    'type' => 'string',
+                                ),
+                                'TgtType' => array(
+                                    'type' => 'string',
+                                ),
+                                'SheetId' => array(
+                                    'type' => 'integer',
+                                ),
+                                'StartPage' => array(
+                                    'type' => 'integer',
+                                ),
+                                'EndPage' => array(
+                                    'type' => 'integer',
+                                ),
+                                'ImageParams' => array(
+                                    'type' => 'string',
+                                ),
+                                'DocPassword' => array(
+                                    'type' => 'string',
+                                ),
+                                'Comments' => array(
+                                    'type' => 'integer',
+                                ),
+                                'PaperDirection' => array(
+                                    'type' => 'integer',
+                                ),
+                                'Quality' => array(
+                                    'type' => 'integer',
+                                ),
+                                'Zoom' => array(
+                                    'type' => 'integer',
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateDocProcessJobsOutput()
+    {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id',),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'EndTime' => array('type' => 'string', 'location' => 'xml',),
+                        'StartTime' => array('type' => 'string', 'location' => 'xml',),
+                        'Code' => array('type' => 'string', 'location' => 'xml',),
+                        'Message' => array('type' => 'string', 'location' => 'xml',),
+                        'JobId' => array('type' => 'string', 'location' => 'xml',),
+                        'Tag' => array('type' => 'string', 'location' => 'xml',),
+                        'State' => array('type' => 'string', 'location' => 'xml',),
+                        'CreationTime' => array('type' => 'string', 'location' => 'xml',),
+                        'QueueId' => array('type' => 'string', 'location' => 'xml',),
+                        'Input' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Object' => array('type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                        'Operation' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Output' => array(
+                                    'required' => true,
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Region' => array(
+                                            'type' => 'string','location' => 'xml',
+                                        ),
+                                        'Bucket' => array(
+                                            'type' => 'string','location' => 'xml',
+                                        ),
+                                        'Object' => array(
+                                            'type' => 'string','location' => 'xml',
+                                        ),
+                                    ),
+                                ),
+                                'DocProcess' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'SrcType' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'TgtType' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'SheetId' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'StartPage' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'EndPage' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'ImageParams' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'DocPassword' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Comments' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'PaperDirection' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'Quality' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'Zoom' => array(
+                                            'type' => 'integer',
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function DescribeDocProcessQueues() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}docqueue',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeDocProcessQueuesOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'queueIds' => array(
+                    'type' => 'string',
+                    'location' => 'xml',
+                ),
+                'state' => array(
+                    'type' => 'string',
+                    'location' => 'xml',
+                ),
+                'pageNumber' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                ),
+                'pageSize' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                ),
+            ),
+        );
+    }
+    public static function DescribeDocProcessQueuesOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array('type' => 'string', 'location' => 'xml',),
+                'TotalCount' => array('type' => 'integer', 'location' => 'xml',),
+                'PageNumber' => array('type' => 'integer', 'location' => 'xml',),
+                'PageSize' => array('type' => 'integer',  'location' => 'xml',),
+                'QueueList' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'State' => array('type' => 'string', 'location' => 'xml',),
+                        'Name' => array('type' => 'string', 'location' => 'xml',),
+                        'MaxSize' => array('type' => 'integer', 'location' => 'xml',),
+                        'MaxConcurrent' => array('type' => 'integer', 'location' => 'xml',),
+                        'CreateTime' => array('type' => 'string', 'location' => 'xml',),
+                        'UpdateTime' => array('type' => 'string', 'location' => 'xml',),
+                        'BucketId' => array('type' => 'string', 'location' => 'xml',),
+                        'Category' => array('type' => 'string', 'location' => 'xml',),
+                        'QueueId' => array('type' => 'string', 'location' => 'xml',),
+                        'NotifyConfig' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Url' => array('type' => 'string', 'location' => 'xml',),
+                                'Event' => array('type' => 'string', 'location' => 'xml',),
+                                'Type' => array('type' => 'string', 'location' => 'xml',),
+                                'State' => array('type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeDocProcessJob() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}doc_jobs/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeDocProcessJobOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeDocProcessJobOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array(
+                            'type' => 'string',
+                        ),
+                        'Message' => array(
+                            'type' => 'string',
+                        ),
+                        'JobId' => array(
+                            'type' => 'string',
+                        ),
+                        'State' => array(
+                            'type' => 'string',
+                        ),
+                        'CreationTime' => array(
+                            'type' => 'string',
+                        ),
+                        'QueueId' => array(
+                            'type' => 'string',
+                        ),
+                        'Tag' => array(
+                            'type' => 'string',
+                        ),
+                        'EndTime' => array(
+                            'type' => 'string',
+                        ),
+                        'Input' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Object' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'Operation' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'DocProcess' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'SrcType' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'TgtType' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'SheetId' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'StartPage' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'EndPage' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'ImageParams' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'DocPassword' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Comments' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'PaperDirection' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'Quality' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'Zoom' => array(
+                                                'type' => 'integer',
+                                            ),
+                                        ),
+                                    ),
+                                    'DocProcessResult' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'PageInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'PageNo' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                    'TgtUri' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'PicIndex' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                    'PicNum' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                    'X-SheetPics' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                ),
+                                            ),
+                                            'SuccPageCount' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'FailPageCount' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'TaskId' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'TgtType' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'TotalPageCount' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'TotalSheetCount' => array(
+                                                'type' => 'integer',
+                                            ),
+                                        ),
+                                    ),
+                                    'Output' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Bucket' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Object' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Region' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDescribeDocProcessJobs() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}doc_jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDescribeDocProcessJobsOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Tag' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'tag',
+                ),
+                'QueueId' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'queueId',
+                ),
+                'OrderByTime' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'orderByTime',
+                ),
+                'NextToken' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'nextToken',
+                ),
+                'Size' => array(
+                    'type' => 'integer',
+                    'location' => 'query',
+                    'sentAs' => 'size',
+                ),
+                'States' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'states',
+                ),
+                'StartCreationTime' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'startCreationTime',
+                ),
+                'EndCreationTime' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'endCreationTime',
+                ),
+            ),
+        );
+    }
+
+    public static function GetDescribeDocProcessJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id',),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'NextToken' => array('type' => 'string','location' => 'xml',),
+                'JobsDetail' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'data' => array(
+                        'xmlFlattened' => true,
+                    ),
+                    'items' => array(
+                        'type' => 'object',
+                        'properties' => array(
+                            'Code' => array('type' => 'string', 'location' => 'xml',),
+                            'Message' => array('type' => 'string', 'location' => 'xml',),
+                            'JobId' => array('type' => 'string', 'location' => 'xml',),
+                            'Tag' => array('type' => 'string', 'location' => 'xml',),
+                            'State' => array('type' => 'string', 'location' => 'xml',),
+                            'CreationTime' => array('type' => 'string', 'location' => 'xml',),
+                            'QueueId' => array('type' => 'string', 'location' => 'xml',),
+                            'Input' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Object' => array('type' => 'string', 'location' => 'xml',),
+                                ),
+                            ),
+                            'Operation' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Output' => array(
+                                        'required' => true,
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Region' => array(
+                                                'type' => 'string','location' => 'xml',
+                                            ),
+                                            'Bucket' => array(
+                                                'type' => 'string','location' => 'xml',
+                                            ),
+                                            'Object' => array(
+                                                'type' => 'string','location' => 'xml',
+                                            ),
+                                        ),
+                                    ),
+                                    'DocProcess' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'SrcType' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'TgtType' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'SheetId' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'StartPage' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'EndPage' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'ImageParams' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'DocPassword' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Comments' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'PaperDirection' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'Quality' => array(
+                                                'type' => 'integer',
+                                            ),
+                                            'Zoom' => array(
+                                                'type' => 'integer',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function DetectImage() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectImageOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                    'minLength' => 1,
+                    'filters' => array(
+                        'Qcloud\\Cos\\Client::explodeKey'
+                    )
+                ),
+                'ci-process' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query'
+                ),
+                'DetectType' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'detect-type'
+                ),
+                'DetectUrl' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'detect-url'
+                ),
+                'Interval' => array(
+                    'type' => 'integer',
+                    'location' => 'query',
+                    'sentAs' => 'interval'
+                ),
+                'MaxFrames' => array(
+                    'type' => 'integer',
+                    'location' => 'query',
+                    'sentAs' => 'max-frames'
+                ),
+                'BizType' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'biz-type'
+                ),
+                'LargeImageDetect' => array(
+                    'type' => 'integer',
+                    'location' => 'query',
+                    'sentAs' => 'large-image-detect'
+                ),
+                'DataId' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'dataid'
+                ),
+                'Async' => array(
+                    'type' => 'integer',
+                    'location' => 'query',
+                    'sentAs' => 'async'
+                ),
+                'Callback' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                    'sentAs' => 'callback'
+                ),
+            ),
+        );
+    }
+
+    public static function DetectImageOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'Result' => array('type' => 'integer', 'location' => 'xml',),
+                'Label' => array('type' => 'string', 'location' => 'xml',),
+                'Category' => array('type' => 'string', 'location' => 'xml',),
+                'JobId' => array('type' => 'string', 'location' => 'xml',),
+                'CompressionResult' => array('type' => 'integer', 'location' => 'xml',),
+                'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                'Score' => array('type' => 'integer', 'location' => 'xml',),
+                'Text' => array('type' => 'string', 'location' => 'xml',),
+                'DataId' => array('type' => 'string', 'location' => 'xml',),
+                'PornInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                        'OcrResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Keywords' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                    ),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ObjectResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'LibResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'TerroristInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                        'OcrResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Keywords' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                    ),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ObjectResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'LibResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'TerrorismInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                        'OcrResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Keywords' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                    ),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ObjectResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'LibResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'PoliticsInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                        'OcrResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Keywords' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                    ),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ObjectResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'LibResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'AdsInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                        'OcrResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Keywords' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                    ),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ObjectResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'LibResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'TeenagerInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                        'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                        'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                        'OcrResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Keywords' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                    ),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ObjectResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Location' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                            'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'LibResults' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            )
+        );
+    }
+
+    public static function DetectImages() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}image/auditing',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectImagesOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Inputs' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'data' => array(
+                        'xmlFlattened' => true,
+                    ),
+                    'items' => array(
+                        'name' => 'Input',
+                        'type' => 'object',
+                        'location' => 'xml',
+                        'sentAs' => 'Input',
+                        'properties' => array(
+                            'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'Content' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'Interval' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            'MaxFrames' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'LargeImageDetect' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            'UserInfo' => array(
+                                'location' => 'xml',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'TokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Nickname' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'DeviceId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'AppId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Room' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'IP' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Gender' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Level' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Role' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Conf' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'DetectType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'BizType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Async' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'Callback' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function DetectImagesOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'JobsDetail' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                        'properties' => array(
+                            'Code' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Message' => array( 'type' => 'string', 'location' => 'xml',),
+                            'JobId' => array( 'type' => 'string', 'location' => 'xml',),
+                            'DataId' => array( 'type' => 'string', 'location' => 'xml',),
+                            'CompressionResult' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Result' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                            'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Object' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Url' => array( 'type' => 'string', 'location' => 'xml',),
+                            'PornInfo' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'OcrResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Keywords' => array(
+                                                    'type' => 'array',
+                                                    'location' => 'xml',
+                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                ),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'ObjectResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'LibResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'TerrorismInfo' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'OcrResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Keywords' => array(
+                                                    'type' => 'array',
+                                                    'location' => 'xml',
+                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                ),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'ObjectResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'LibResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'PoliticsInfo' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'OcrResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Keywords' => array(
+                                                    'type' => 'array',
+                                                    'location' => 'xml',
+                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                ),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'ObjectResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'LibResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'AdsInfo' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'OcrResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Keywords' => array(
+                                                    'type' => 'array',
+                                                    'location' => 'xml',
+                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                ),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'ObjectResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'LibResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'TeenagerInfo' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Code' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Msg' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Category' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'OcrResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Keywords' => array(
+                                                    'type' => 'array',
+                                                    'location' => 'xml',
+                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                ),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'ObjectResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Location' => array(
+                                                    'type' => 'object',
+                                                    'location' => 'xml',
+                                                    'properties' => array(
+                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'LibResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                            'UserInfo' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                                ),
+                            ),
+                            'ListInfo' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'ListResults' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            )
+        );
+    }
+
+    public static function DetectVirus() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}virus/detect',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectVirusOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Input' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Conf' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'DetectType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Callback' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function DetectVirusOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectVirusResult() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}virus/detect/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDetectVirusResultOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function GetDetectVirusResultOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array('type' => 'string', 'location' => 'xml',),
+                        'Message' => array('type' => 'string', 'location' => 'xml',),
+                        'JobId' => array('type' => 'string', 'location' => 'xml',),
+                        'State' => array('type' => 'string', 'location' => 'xml',),
+                        'CreationTime' => array('type' => 'string', 'location' => 'xml',),
+                        'Object' => array('type' => 'string', 'location' => 'xml',),
+                        'Url' => array('type' => 'string', 'location' => 'xml',),
+                        'Suggestion' => array('type' => 'string', 'location' => 'xml',),
+                        'DetectDetail' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'location' => 'xml',
+                                'properties' => array(
+                                    'Result' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'FileName' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'VirusName' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectImageResult() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}image/auditing/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDetectImageResultOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function GetDetectImageResultOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array('type' => 'string', 'location' => 'xml',),
+                        'Message' => array('type' => 'string', 'location' => 'xml',),
+                        'JobId' => array('type' => 'string', 'location' => 'xml',),
+                        'State' => array('type' => 'string', 'location' => 'xml',),
+                        'CreationTime' => array('type' => 'string', 'location' => 'xml',),
+                        'Object' => array('type' => 'string', 'location' => 'xml',),
+                        'Url' => array('type' => 'string', 'location' => 'xml',),
+                        'CompressionResult' => array('type' => 'integer', 'location' => 'xml',),
+                        'Text' => array('type' => 'string', 'location' => 'xml',),
+                        'Label' => array('type' => 'string', 'location' => 'xml',),
+                        'Category' => array('type' => 'string', 'location' => 'xml',),
+                        'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                        'Result' => array('type' => 'integer', 'location' => 'xml',),
+                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                        'PornInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'OcrResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'ObjectResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'LibResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'AdsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'OcrResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'ObjectResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'LibResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'PoliticsInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'OcrResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'ObjectResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'LibResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'TerrorismInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'OcrResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'ObjectResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'LibResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'TeenagerInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Score' => array( 'type' => 'integer', 'location' => 'xml', ),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Category' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'OcrResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Keywords' => array(
+                                                'type' => 'array',
+                                                'location' => 'xml',
+                                                'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                            ),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'ObjectResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Location' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                    'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'LibResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'UserInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                        'ListInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ListResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVoiceSeparateJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaVoiceSeparateJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'VoiceSeparate' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'AudioMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'AudioConfig' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array('type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array('type' => 'string', 'location' => 'xml', ),
+                                'Object' => array('type' => 'string', 'location' => 'xml', ),
+                                'AuObject' => array('type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVoiceSeparateJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeMediaVoiceSeparateJob() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}jobs/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeMediaVoiceSeparateJobOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function DescribeMediaVoiceSeparateJobOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DetectWebpage() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}webpage/auditing',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectWebpageOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Input' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserInfo' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Conf' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'DetectType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Callback' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ReturnHighlightHtml' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CallbackType' => array( 'type' => 'integer', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function DetectWebpageOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetDetectWebpageResult() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}webpage/auditing/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetDetectWebpageResultOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function GetDetectWebpageResultOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Code' => array('type' => 'string', 'location' => 'xml',),
+                        'Message' => array('type' => 'string', 'location' => 'xml',),
+                        'DataId' => array('type' => 'string', 'location' => 'xml',),
+                        'JobId' => array('type' => 'string', 'location' => 'xml',),
+                        'State' => array('type' => 'string', 'location' => 'xml',),
+                        'CreationTime' => array('type' => 'string', 'location' => 'xml',),
+                        'Url' => array('type' => 'string', 'location' => 'xml',),
+                        'Suggestion' => array('type' => 'integer', 'location' => 'xml',),
+                        'Label' => array('type' => 'string', 'location' => 'xml',),
+                        'PageCount' => array('type' => 'integer', 'location' => 'xml',),
+                        'HighlightHtml' => array('type' => 'string', 'location' => 'xml',),
+                        'Labels' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'PornInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'AdsInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'PoliticsInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'TerrorismInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                        'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ImageResults' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Results' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Url' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Suggestion' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'PornInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'AdsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'PoliticsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'TerrorismInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Category' => array('type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array('type' => 'string', 'location' => 'xml',),
+                                                    'OcrResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'ObjectResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Location' => array(
+                                                                    'type' => 'object',
+                                                                    'location' => 'xml',
+                                                                    'properties' => array(
+                                                                        'X' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Width' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Height' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                        'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',),
+                                                                    ),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'ImageId' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'TextResults' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Results' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Text' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Suggestion' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'PornInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array('type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'AdsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array('type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'PoliticsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array('type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'TerrorismInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array('type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array('type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'UserInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                            ),
+                        ),
+                        'ListInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ListResults' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeMediaBuckets() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/mediabucket',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeMediaBucketsOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Regions' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'regions' ),
+                'BucketNames' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'bucketNames' ),
+                'BucketName' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'bucketName' ),
+                'PageNumber' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageNumber' ),
+                'PageSize' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageSize' ),
+            ),
+        );
+    }
+    public static function DescribeMediaBucketsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'TotalCount' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'PageNumber' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'PageSize' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'MediaBucketList' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                        'properties' => array(
+                            'BucketId' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Region' => array( 'type' => 'string', 'location' => 'xml',),
+                            'CreateTime' => array( 'type' => 'string', 'location' => 'xml',),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetPrivateM3U8() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetPrivateM3U8Output',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'ci-process' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query'
+                ),
+                'expires' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query'
+                )
+            ),
+        );
+    }
+    public static function GetPrivateM3U8Output() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeMediaQueues() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}queue',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeMediaQueuesOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'QueueIds' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'queueIds' ),
+                'State' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'state' ),
+                'PageNumber' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageNumber' ),
+                'PageSize' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageSize' ),
+            ),
+        );
+    }
+    public static function DescribeMediaQueuesOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'TotalCount' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'PageNumber' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'PageSize' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'QueueList' => array(
+                    'type' => 'array', 'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object', 'location' => 'xml',
+                        'properties' => array(
+                            'QueueId' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                            'State' => array( 'type' => 'string', 'location' => 'xml',),
+                            'MaxSize' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'MaxConcurrent' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'UpdateTime' => array( 'type' => 'string', 'location' => 'xml',),
+                            'CreateTime' => array( 'type' => 'string', 'location' => 'xml',),
+                            'NotifyConfig' => array(
+                                'type' => 'object', 'location' => 'xml',
+                                'properties' => array(
+                                    'Url' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'State' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                    'Event' => array( 'type' => 'string', 'location' => 'xml',),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'NonExistPIDs' => array(
+                    'type' => 'array', 'location' => 'xml',
+                    'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaQueue() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}queue/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaQueueOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueID' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'State' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'NotifyConfig' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Url' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ),
+                        'Type' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ),
+                        'Event' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaQueueOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSmartCoverJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaSmartCoverJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'location' => 'xml', 'type' => 'string', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SmartCover' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'DeleteDuplicates' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaSmartCoverJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVideoProcessJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaVideoProcessJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'TranscodeTemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'WatermarkTemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'VideoProcess' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ColorEnhance' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Contrast' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Correction' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Saturation' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'MsSharpen' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SharpenLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Transcode' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Tag' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Name' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Container' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Video' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TimeInterval' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Audio' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TransConfig' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsEncrypt' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Watermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Pos' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'LocMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Image' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Background' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Text' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'FontSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'FontType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'FontColor' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'DigitalWatermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Message' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Version' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IgnoreError' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaVideoProcessJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVideoMontageJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaVideoMontageJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'VideoMontage' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Container' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Video' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Rotate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Audio' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'AudioMix' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'AudioSource' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'MixMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Replace' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'EffectConfig' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'EnableStartFadein' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                    'StartFadeinTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                    'EnableEndFadeout' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                    'EndFadeoutTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                    'EnableBgmFade' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                    'BgmFadeTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaVideoMontageJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaAnimationJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaAnimationJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Animation' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Container' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Video' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AnimateOnlyKeepKeyFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AnimateTimeIntervalOfFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AnimateFramesPerSecond' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Quality' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TimeInterval' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaAnimationJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaPicProcessJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}pic_jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaPicProcessJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'PicProcess' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'IsPicInfo' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'ProcessRule' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaPicProcessJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSegmentJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaSegmentJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Segment' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'HlsEncrypt' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaSegmentJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVideoTagJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaVideoTagJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'VideoTag' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Scenario' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaVideoTagJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSuperResolutionJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaSuperResolutionJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'TranscodeTemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'WatermarkTemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SuperResolution' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Resolution' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'EnableScaleUp' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Transcode' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Tag' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Name' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Container' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Video' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TimeInterval' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Audio' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TransConfig' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsEncrypt' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Watermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Pos' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'LocMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Image' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Background' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Text' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'FontSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'FontType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'FontColor' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'DigitalWatermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Message' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Version' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IgnoreError' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaSuperResolutionJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSDRtoHDRJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaSDRtoHDRJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'TranscodeTemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'WatermarkTemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SDRtoHDR' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HdrMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Transcode' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Tag' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Name' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Container' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Video' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TimeInterval' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Audio' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'TransConfig' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'HlsEncrypt' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                                'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Watermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Pos' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'LocMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Image' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Background' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                                'Text' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'FontSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'FontType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'FontColor' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaSDRtoHDRJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaDigitalWatermarkJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaDigitalWatermarkJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DigitalWatermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Message' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Version' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaDigitalWatermarkJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaExtractDigitalWatermarkJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaExtractDigitalWatermarkJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ExtractDigitalWatermark' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Version' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaExtractDigitalWatermarkJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DetectLiveVideo() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}video/auditing',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DetectLiveVideoOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                'Input' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UserInfo' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'TokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Nickname' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'DeviceId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'AppId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Room' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'IP' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Gender' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Level' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Role' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Conf' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Callback' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'BizType' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CallbackType' => array( 'type' => 'integer', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function DetectLiveVideoOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CancelLiveVideoAuditing() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}video/cancel_auditing/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CancelLiveVideoAuditingOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function CancelLiveVideoAuditingOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'JobsDetail' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'DataId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function OpticalOcrRecognition() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'OpticalOcrRecognitionOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'CiProcess' => array( 'required' => true, 'type' => 'string', 'location' => 'query', 'sentAs' => 'ci-process' ),
+                'Type' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'type' ),
+                'LanguageType' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'language-type' ),
+                'IsPDF' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'ispdf' ),
+                'PdfPageNumber' => array( 'type' => 'integer', 'location' => 'query', 'sentAs' => 'pdf-pagenumber' ),
+                'IsWord' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'isword' ),
+                'EnableWordPolygon' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'enable-word-polygon' ),
+            ),
+        );
+    }
+    public static function OpticalOcrRecognitionOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function TriggerWorkflow() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}triggerworkflow',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'TriggerWorkflowOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'workflowId' => array( 'required' => true, 'type' => 'string', 'location' => 'query', ),
+                'object' => array( 'required' => true, 'type' => 'string', 'location' => 'query', ),
+                'name' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+            ),
+        );
+    }
+    public static function TriggerWorkflowOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'InstanceId' => array( 'type' => 'string', 'location' => 'xml', ),
+            ),
+        );
+    }
+
+    public static function GetWorkflowInstances() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}workflowexecution',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetWorkflowInstancesOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'workflowId' => array( 'required' => true, 'type' => 'string', 'location' => 'query', ),
+                'name' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+                'orderByTime' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+                'size' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+                'states' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+                'startCreationTime' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+                'endCreationTime' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+                'nextToken' => array( 'required' => false, 'type' => 'string', 'location' => 'query', ),
+            ),
+        );
+    }
+    public static function GetWorkflowInstancesOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'NextToken' => array( 'type' => 'string', 'location' => 'xml', ),
+                'WorkflowExecutionList' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                        'properties' => array(
+                            'RunId' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'WorkflowId' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'CreateTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                            'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function GetWorkflowInstance() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}workflowexecution/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetWorkflowInstanceOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function GetWorkflowInstanceOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSnapshotTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaSnapshotTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Snapshot' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaSnapshotTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'Template' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Tag' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Name' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UpdateTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreateTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Snapshot' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaSnapshotTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaSnapshotTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Snapshot' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaSnapshotTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'Template' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Tag' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Name' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UpdateTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreateTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Snapshot' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Count' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaTranscodeTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaTranscodeTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ClipConfig' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Rotate' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TimeInterval' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Audio' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TransConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'HlsEncrypt' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaTranscodeTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaTranscodeTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaTranscodeTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ClipConfig' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Rotate' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TimeInterval' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Audio' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TransConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'HlsEncrypt' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'UriKey' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaTranscodeTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaHighSpeedHdTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaHighSpeedHdTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TimeInterval' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Audio' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TransConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaHighSpeedHdTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaHighSpeedHdTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaHighSpeedHdTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Profile' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Gop' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Preset' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TimeInterval' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Audio' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TransConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaHighSpeedHdTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaAnimationTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaAnimationTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AnimateOnlyKeepKeyFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AnimateTimeIntervalOfFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AnimateFramesPerSecond' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Quality' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TimeInterval' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaAnimationTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaAnimationTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaAnimationTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AnimateOnlyKeepKeyFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AnimateTimeIntervalOfFrame' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'AnimateFramesPerSecond' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Quality' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'TimeInterval' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Duration' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaAnimationTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaConcatTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaConcatTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'ConcatTemplate' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'ConcatFragments' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'ConcatFragment',
+                                'type' => 'object',
+                                'sentAs' => 'ConcatFragment',
+                                'properties' => array(
+                                    'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                        ),
+                        'Audio' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Video' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Container' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaConcatTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaConcatTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaConcatTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'ConcatTemplate' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'ConcatFragments' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'ConcatFragment',
+                                'type' => 'object',
+                                'sentAs' => 'ConcatFragment',
+                                'properties' => array(
+                                    'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                ),
+                            ),
+                        ),
+                        'Audio' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Video' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Container' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaConcatTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVideoProcessTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaVideoProcessTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'ColorEnhance' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Contrast' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Correction' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Saturation' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'MsSharpen' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SharpenLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaVideoProcessTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaVideoProcessTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaVideoProcessTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'ColorEnhance' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Contrast' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Correction' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Saturation' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'MsSharpen' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Enable' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'SharpenLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaVideoProcessTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVideoMontageTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaVideoMontageTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Duration' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Audio' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'AudioMix' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'AudioSource' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MixMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Replace' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaVideoMontageTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaVideoMontageTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaVideoMontageTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Duration' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Container' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Format' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Video' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Fps' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Crf' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Audio' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Remove' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'AudioMix' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'AudioSource' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MixMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Replace' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaVideoMontageTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaVoiceSeparateTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaVoiceSeparateTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'AudioMode' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'AudioConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaVoiceSeparateTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaVoiceSeparateTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaVoiceSeparateTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'AudioMode' => array( 'location' => 'xml', 'type' => 'string', ),
+                'AudioConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Codec' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Channels' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaVoiceSeparateTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaSuperResolutionTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaSuperResolutionTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Resolution' => array( 'location' => 'xml', 'type' => 'string', ),
+                'EnableScaleUp' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Version' => array( 'location' => 'xml', 'type' => 'string', ),
+            ),
+        );
+    }
+    public static function CreateMediaSuperResolutionTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaSuperResolutionTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaSuperResolutionTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Resolution' => array( 'location' => 'xml', 'type' => 'string', ),
+                'EnableScaleUp' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Version' => array( 'location' => 'xml', 'type' => 'string', ),
+            ),
+        );
+    }
+    public static function UpdateMediaSuperResolutionTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaPicProcessTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaPicProcessTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'PicProcess' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'IsPicInfo' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ProcessRule' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaPicProcessTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaPicProcessTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaPicProcessTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'PicProcess' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'IsPicInfo' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'ProcessRule' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaPicProcessTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaWatermarkTemplate() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaWatermarkTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Watermark' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Pos' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'LocMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Image' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Background' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Text' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'FontSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'FontType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'FontColor' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaWatermarkTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateMediaWatermarkTemplate() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}template/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateMediaWatermarkTemplateOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Name' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Watermark' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Pos' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'LocMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Dx' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Dy' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'StartTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'EndTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Image' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Mode' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Width' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Height' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Background' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'Text' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'FontSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'FontType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'FontColor' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Transparency' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Text' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateMediaWatermarkTemplateOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeMediaTemplates() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}template',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeMediaTemplatesOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Tag' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'tag' ),
+                'Category' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'category' ),
+                'Ids' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'ids' ),
+                'Name' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'name' ),
+                'PageNumber' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageNumber' ),
+                'PageSize' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageSize' ),
+            ),
+        );
+    }
+    public static function DescribeMediaTemplatesOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'TotalCount' => array( 'type' => 'string', 'location' => 'xml', ),
+                'PageNumber' => array( 'type' => 'string', 'location' => 'xml', ),
+                'PageSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                'TemplateList' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeWorkflow() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}workflow',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeWorkflowOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Ids' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'ids' ),
+                'Name' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'name' ),
+                'PageNumber' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageNumber' ),
+                'PageSize' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageSize' ),
+            ),
+        );
+    }
+    public static function DescribeWorkflowOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'TotalCount' => array( 'type' => 'string', 'location' => 'xml', ),
+                'PageNumber' => array( 'type' => 'string', 'location' => 'xml', ),
+                'PageSize' => array( 'type' => 'string', 'location' => 'xml', ),
+                'MediaWorkflowList' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function DeleteWorkflow() {
+        return array(
+            'httpMethod' => 'DELETE',
+            'uri' => '/{Bucket}workflow/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DeleteWorkflowOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function DeleteWorkflowOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'WorkflowId' => array( 'type' => 'string', 'location' => 'xml' ),
+            ),
+        );
+    }
+
+    public static function CreateInventoryTriggerJob() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}inventorytriggerjob',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateInventoryTriggerJobOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Name' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Manifest' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UrlFile' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Prefix' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'WorkflowIds' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'TimeInterval' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Start' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'End' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateInventoryTriggerJobOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeInventoryTriggerJobs() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}inventorytriggerjob',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeInventoryTriggerJobsOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'NextToken' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'nextToken' ),
+                'Size' => array( 'type' => 'integer', 'location' => 'query', 'sentAs' => 'size' ),
+                'OrderByTime' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'orderByTime' ),
+                'States' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'states' ),
+                'StartCreationTime' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'startCreationTime' ),
+                'EndCreationTime' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'endCreationTime' ),
+                'WorkflowId' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'workflowId' ),
+                'JobId' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'jobId' ),
+                'Name' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'name' ),
+            ),
+        );
+    }
+    public static function DescribeInventoryTriggerJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function DescribeInventoryTriggerJob() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}inventorytriggerjob/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeInventoryTriggerJobOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function DescribeInventoryTriggerJobOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CancelInventoryTriggerJob() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}inventorytriggerjob/{/Key*}?cancel',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CancelInventoryTriggerJobOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function CancelInventoryTriggerJobOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaNoiseReductionJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaNoiseReductionJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaNoiseReductionJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function ImageRepairProcess() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageRepairProcessOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'ci-process' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'query'
+                ),
+                'MaskPic' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                ),
+                'MaskPoly' => array(
+                    'type' => 'string',
+                    'location' => 'query',
+                ),
+            ),
+        );
+    }
+    public static function ImageRepairProcessOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function ImageDetectCarProcess() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}?ci-process=DetectCar',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageDetectCarProcessOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function ImageDetectCarProcessOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'CarTags' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Serial' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Brand' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Color' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Confidence' => array( 'type' => 'numeric', 'location' => 'xml', ),
+                        'Year' => array( 'type' => 'numeric', 'location' => 'xml', ),
+                        'CarLocation' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'X' => array( 'type' => 'numeric', 'location' => 'xml', ),
+                                'Y' => array( 'type' => 'numeric', 'location' => 'xml', ),
+                            ),
+                        ),
+                        'PlateContent' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Plate' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Color' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'PlateLocation' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'X' => array( 'type' => 'numeric', 'location' => 'xml', ),
+                                        'Y' => array( 'type' => 'numeric', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function ImageAssessQualityProcess() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}?ci-process=AssessQuality',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageAssessQualityProcessOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+                'Key' => array(
+                    'required' => true,
+                    'type' => 'string',
+                    'location' => 'uri',
+                ),
+            ),
+        );
+    }
+    public static function ImageAssessQualityProcessOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+                'LongImage' => array( 'type' => 'string', 'location' => 'xml', ),
+                'BlackAndWhite' => array( 'type' => 'string', 'location' => 'xml', ),
+                'SmallImage' => array( 'type' => 'string', 'location' => 'xml', ),
+                'BigImage' => array( 'type' => 'string', 'location' => 'xml', ),
+                'PureImage' => array( 'type' => 'string', 'location' => 'xml', ),
+                'ClarityScore' => array( 'type' => 'string', 'location' => 'xml', ),
+                'AestheticScore' => array( 'type' => 'string', 'location' => 'xml', ),
+            ),
+        );
+    }
+
+    public static function ImageSearchOpen() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}ImageSearchBucket',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageSearchOpenOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'MaxCapacity' => array( 'location' => 'xml', 'type' => 'integer', ),
+                'MaxQps' => array( 'location' => 'xml', 'type' => 'integer', ),
+            ),
+        );
+    }
+    public static function ImageSearchOpenOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function ImageSearchAdd() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}{/Key*}?ci-process=ImageSearch&action=AddImage',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageSearchAddOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'EntityId' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CustomContent' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Tags' => array( 'location' => 'xml', 'type' => 'string', ),
+            ),
+        );
+    }
+    public static function ImageSearchAddOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function ImageSearch() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}?ci-process=ImageSearch&action=SearchImage',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageSearchOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'MatchThreshold' => array( 'type' => 'integer', 'location' => 'query' ),
+                'Offset' => array( 'type' => 'integer', 'location' => 'query' ),
+                'Limit' => array( 'type' => 'integer', 'location' => 'query' ),
+                'Filter' => array( 'type' => 'string', 'location' => 'query' ),
+            ),
+        );
+    }
+    public static function ImageSearchOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'Count' => array('type' => 'integer', 'location' => 'xml',),
+                'ImageInfos' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                        'properties' => array(
+                            'EntityId' => array( 'type' => 'string', 'location' => 'xml',),
+                            'CustomContent' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Tags' => array( 'type' => 'string', 'location' => 'xml',),
+                            'PicName' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                        ),
+                    ),
+                ),
+            )
+        );
+    }
+
+    public static function ImageSearchDelete() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}{/Key*}?ci-process=ImageSearch&action=DeleteImage',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageSearchDeleteOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'EntityId' => array( 'location' => 'xml', 'type' => 'string', ),
+            ),
+        );
+    }
+    public static function ImageSearchDeleteOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function BindCiService() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'BindCiServiceOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function BindCiServiceOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function GetCiService() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetCiServiceOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function GetCiServiceOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function UnBindCiService() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}?unbind',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UnBindCiServiceOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function UnBindCiServiceOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function GetHotLink() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}?hotlink',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetHotLinkOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function GetHotLinkOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function AddHotLink() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}?hotlink',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'AddHotLinkOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Hotlink',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Type' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Urls' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'data' => array(
+                        'xmlFlattened' => true,
+                    ),
+                    'items' => array( 'name' => 'Url', 'type' => 'string', 'location' => 'xml', 'sentAs' => 'Url', ),
+                ),
+            ),
+        );
+    }
+    public static function AddHotLinkOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function OpenOriginProtect() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}?origin-protect',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'OpenOriginProtectOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function OpenOriginProtectOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function GetOriginProtect() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}?origin-protect',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetOriginProtectOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function GetOriginProtectOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CloseOriginProtect() {
+        return array(
+            'httpMethod' => 'DELETE',
+            'uri' => '/{Bucket}?origin-protect',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CloseOriginProtectOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function CloseOriginProtectOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-cos-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function ImageDetectFace() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}?ci-process=DetectFace',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageDetectFaceOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'MaxFaceNum' => array( 'type' => 'integer', 'location' => 'query', 'sentAs' => 'max-face-num' ),
+            ),
+        );
+    }
+    public static function ImageDetectFaceOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'ImageWidth' => array('type' => 'integer', 'location' => 'xml',),
+                'ImageHeight' => array('type' => 'integer', 'location' => 'xml',),
+                'FaceModelVersion' => array('type' => 'string', 'location' => 'xml',),
+                'FaceInfos' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                        'properties' => array(
+                            'X' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'Y' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'Width' => array( 'type' => 'integer', 'location' => 'xml',),
+                            'Height' => array( 'type' => 'integer', 'location' => 'xml',),
+                        ),
+                    ),
+                ),
+            )
+        );
+    }
+
+    public static function ImageFaceEffect() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}?ci-process=face-effect',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'ImageFaceEffectOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'type' => array( 'type' => 'string', 'location' => 'query', ),
+                'whitening' => array( 'type' => 'integer', 'location' => 'query', ),
+                'smoothing' => array( 'type' => 'integer', 'location' => 'query', ),
+                'faceLifting' => array( 'type' => 'integer', 'location' => 'query', ),
+                'eyeEnlarging' => array( 'type' => 'integer', 'location' => 'query', ),
+                'gender' => array( 'type' => 'integer', 'location' => 'query', ),
+                'age' => array( 'type' => 'integer', 'location' => 'query', ),
+            ),
+        );
+    }
+    public static function ImageFaceEffectOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'ResultImage' => array('type' => 'string', 'location' => 'xml',),
+                'ResultMask' => array('type' => 'string', 'location' => 'xml',),
+            )
+        );
+    }
+
+    public static function IDCardOCR() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}{/Key*}?ci-process=IDCardOCR',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'IDCardOCROutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'CardSide' => array( 'type' => 'string', 'location' => 'query', ),
+                'Config' => array( 'type' => 'string', 'location' => 'query', ),
+            ),
+        );
+    }
+    public static function IDCardOCROutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'ResultImage' => array('type' => 'string', 'location' => 'xml',),
+                'IdInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Sex' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Nation' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Birth' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Address' => array( 'type' => 'string', 'location' => 'xml',),
+                        'IdNum' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Authority' => array( 'type' => 'string', 'location' => 'xml',),
+                        'ValidDate' => array( 'type' => 'string', 'location' => 'xml',),
+                    ),
+                ),
+                'AdvancedInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'IdCard' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Portrait' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Quality' => array( 'type' => 'string', 'location' => 'xml',),
+                        'BorderCodeValue' => array( 'type' => 'string', 'location' => 'xml',),
+                        'WarnInfos' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                        ),
+                    ),
+                ),
+            )
+        );
+    }
+
+    public static function IDCardOCRByUpload() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}{/Key*}?ci-process=IDCardOCR',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'IDCardOCRByUploadOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'CardSide' => array( 'type' => 'string', 'location' => 'query', ),
+                'Config' => array( 'type' => 'string', 'location' => 'query', ),
+                'Body' => array(
+                    'required' => true,
+                    'type' => array( 'any' ),
+                    'location' => 'body'
+                ),
+            ),
+        );
+    }
+    public static function IDCardOCRByUploadOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'ResultImage' => array('type' => 'string', 'location' => 'xml',),
+                'IdInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Sex' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Nation' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Birth' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Address' => array( 'type' => 'string', 'location' => 'xml',),
+                        'IdNum' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Authority' => array( 'type' => 'string', 'location' => 'xml',),
+                        'ValidDate' => array( 'type' => 'string', 'location' => 'xml',),
+                    ),
+                ),
+                'AdvancedInfo' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'IdCard' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Portrait' => array( 'type' => 'string', 'location' => 'xml',),
+                        'Quality' => array( 'type' => 'string', 'location' => 'xml',),
+                        'BorderCodeValue' => array( 'type' => 'string', 'location' => 'xml',),
+                        'WarnInfos' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array( 'type' => 'string', 'location' => 'xml', ),
+                        ),
+                    ),
+                ),
+            )
+        );
+    }
+
+    public static function GetLiveCode() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}?ci-process=GetLiveCode',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetLiveCodeOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function GetLiveCodeOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'LiveCode' => array('type' => 'string', 'location' => 'xml',),
+            )
+        );
+    }
+
+    public static function GetActionSequence() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/{Bucket}?ci-process=GetActionSequence',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'GetActionSequenceOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+            ),
+        );
+    }
+    public static function GetActionSequenceOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ),
+                'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',),
+                'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',),
+                'ActionSequence' => array('type' => 'string', 'location' => 'xml',),
+            )
+        );
+    }
+
+    public static function DescribeDocProcessBuckets() {
+        return array(
+            'httpMethod' => 'GET',
+            'uri' => '/docbucket',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'DescribeDocProcessBucketsOutput',
+            'responseType' => 'model',
+            'parameters' => array(
+                'Regions' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'regions' ),
+                'BucketNames' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'bucketNames' ),
+                'BucketName' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'bucketName' ),
+                'PageNumber' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageNumber' ),
+                'PageSize' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'pageSize' ),
+            ),
+        );
+    }
+    public static function DescribeDocProcessBucketsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'TotalCount' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'PageNumber' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'PageSize' => array( 'type' => 'integer', 'location' => 'xml', ),
+                'DocBucketList' => array(
+                    'type' => 'array',
+                    'location' => 'xml',
+                    'items' => array(
+                        'type' => 'object',
+                        'location' => 'xml',
+                        'properties' => array(
+                            'BucketId' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Name' => array( 'type' => 'string', 'location' => 'xml',),
+                            'Region' => array( 'type' => 'string', 'location' => 'xml',),
+                            'CreateTime' => array( 'type' => 'string', 'location' => 'xml',),
+                            'AliasBucketId' => array( 'type' => 'string', 'location' => 'xml',),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function UpdateDocProcessQueue() {
+        return array(
+            'httpMethod' => 'PUT',
+            'uri' => '/{Bucket}docqueue/{/Key*}',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'UpdateDocProcessQueueOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Name' => array( 'type' => 'string', 'location' => 'xml', ),
+                'QueueID' => array( 'type' => 'string', 'location' => 'xml', ),
+                'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                'NotifyConfig' => array(
+                    'location' => 'xml',
+                    'type' => 'object',
+                    'properties' => array(
+                        'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Event' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function UpdateDocProcessQueueOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ),
+                'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ),
+                'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ),
+                'Queue' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'QueueId' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Name' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'CreateTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'UpdateTime' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MaxSize' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'MaxConcurrent' => array( 'type' => 'integer', 'location' => 'xml', ),
+                        'NotifyConfig' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Url' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'State' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Event' => array( 'type' => 'string', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaQualityEstimateJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaQualityEstimateJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaQualityEstimateJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+    public static function CreateMediaStreamExtractJobs() {
+        return array(
+            'httpMethod' => 'POST',
+            'uri' => '/{Bucket}jobs',
+            'class' => 'Qcloud\\Cos\\Command',
+            'responseClass' => 'CreateMediaStreamExtractJobsOutput',
+            'responseType' => 'model',
+            'data' => array(
+                'xmlRoot' => array(
+                    'name' => 'Request',
+                ),
+            ),
+            'parameters' => array(
+                'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ),
+                'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ),
+                'CallBack' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ),
+                'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ),
+                'Input' => array(
+                    'required' => true,
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+                'Operation' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'UserData' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'JobLevel' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'Output' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Bucket' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Region' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'StreamExtracts' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'data' => array(
+                                        'xmlFlattened' => true,
+                                    ),
+                                    'items' => array(
+                                        'name' => 'StreamExtract',
+                                        'type' => 'object',
+                                        'sentAs' => 'StreamExtract',
+                                        'properties' => array(
+                                            'Index' => array( 'type' => 'string', 'location' => 'xml', ),
+                                            'Object' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CallBackMqConfig' => array(
+                    'type' => 'object',
+                    'location' => 'xml',
+                    'properties' => array(
+                        'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqMode' => array( 'type' => 'string', 'location' => 'xml', ),
+                        'MqName' => array( 'type' => 'string', 'location' => 'xml', ),
+                    ),
+                ),
+            ),
+        );
+    }
+    public static function CreateMediaStreamExtractJobsOutput() {
+        return array(
+            'type' => 'object',
+            'additionalProperties' => true,
+            'properties' => array(
+                'Body' => array(
+                    'type' => 'string',
+                    'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                    'location' => 'body',
+                ),
+                'RequestId' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'x-ci-request-id',
+                ),
+                'ContentType' => array(
+                    'type' => 'string',
+                    'location' => 'header',
+                    'sentAs' => 'Content-Type',
+                ),
+                'ContentLength' => array(
+                    'type' => 'numeric',
+                    'minimum'=> 0,
+                    'location' => 'header',
+                    'sentAs' => 'Content-Length',
+                ),
+            ),
+        );
+    }
+
+}

+ 5 - 0
addons/cos/library/Qcloud/Cos/Exception/CosException.php

@@ -0,0 +1,5 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+class CosException extends ServiceResponseException {}

+ 189 - 0
addons/cos/library/Qcloud/Cos/Exception/ServiceResponseException.php

@@ -0,0 +1,189 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+class ServiceResponseException extends \RuntimeException {
+
+    /**
+     * @var Response Response
+     */
+    protected $response;
+
+    /**
+     * @var RequestInterface Request
+     */
+    protected $request;
+
+    /**
+     * @var string Request ID
+     */
+    protected $requestId;
+
+    /**
+     * @var string Exception type (client / server)
+     */
+    protected $exceptionType;
+
+    /**
+     * @var string Exception code
+     */
+    protected $exceptionCode;
+
+    /**
+     * Set the exception code
+     *
+     * @param string $code Exception code
+     */
+    public function setExceptionCode($code) {
+        $this->exceptionCode = $code;
+    }
+
+    /**
+     * Get the exception code
+     *
+     * @return string|null
+     */
+    public function getExceptionCode() {
+        return $this->exceptionCode;
+    }
+
+    /**
+     * Set the exception type
+     *
+     * @param string $type Exception type
+     */
+    public function setExceptionType($type) {
+        $this->exceptionType = $type;
+    }
+
+    /**
+     * Get the exception type (one of client or server)
+     *
+     * @return string|null
+     */
+    public function getExceptionType() {
+        return $this->exceptionType;
+    }
+
+    /**
+     * Set the request ID
+     *
+     * @param string $id Request ID
+     */
+    public function setRequestId($id) {
+        $this->requestId = $id;
+    }
+
+    /**
+     * Get the Request ID
+     *
+     * @return string|null
+     */
+    public function getRequestId() {
+        return $this->requestId;
+    }
+
+    /**
+     * Set the associated response
+     *
+     * @param Response $response
+     */
+    public function setResponse(ResponseInterface $response) {
+        $this->response = $response;
+    }
+
+    /**
+     * Get the associated response object
+     *
+     * @return Response|null
+     */
+    public function getResponse() {
+        return $this->response;
+    }
+
+    /**
+     * Set the associated request
+     *
+     * @param RequestInterface $request
+     */
+    public function setRequest(RequestInterface $request) {
+        $this->request = $request;
+    }
+
+    /**
+     * Get the associated request object
+     *
+     * @return RequestInterface|null
+     */
+    public function getRequest() {
+        return $this->request;
+    }
+
+    /**
+     * Get the status code of the response
+     *
+     * @return int|null
+     */
+    public function getStatusCode() {
+        return $this->response ? $this->response->getStatusCode() : null;
+    }
+
+    /**
+     * Cast to a string
+     *
+     * @return string
+     */
+    public function __toString() {
+        $message = get_class($this) . ': '
+            . 'Cos Error Code: ' . $this->getExceptionCode() . ', '
+            . 'Status Code: ' . $this->getStatusCode() . ', '
+            . 'Cos Request ID: ' . $this->getRequestId() . ', '
+            . 'Cos Error Type: ' . $this->getExceptionType() . ', '
+            . 'Cos Error Message: ' . $this->getMessage();
+
+        // Add the User-Agent if available
+        if ($this->request) {
+            $message .= ', ' . 'User-Agent: ' . $this->request->getHeader('User-Agent')[0];
+        }
+
+        return $message;
+    }
+
+    /**
+     * Get the request ID of the error. This value is only present if a
+     * response was received, and is not present in the event of a networking
+     * error.
+     *
+     * Same as `getRequestId()` method, but matches the interface for SDKv3.
+     *
+     * @return string|null Returns null if no response was received
+     */
+    public function getCosRequestId() {
+        return $this->requestId;
+    }
+
+    /**
+     * Get the Cos error type.
+     *
+     * Same as `getExceptionType()` method, but matches the interface for SDKv3.
+     *
+     * @return string|null Returns null if no response was received
+     */
+    public function getCosErrorType() {
+        return $this->exceptionType;
+    }
+
+    /**
+     * Get the Cos error code.
+     *
+     * Same as `getExceptionCode()` method, but matches the interface for SDKv3.
+     *
+     * @return string|null Returns null if no response was received
+     */
+    public function getCosErrorCode() {
+        return $this->exceptionCode;
+    }
+}

+ 71 - 0
addons/cos/library/Qcloud/Cos/ExceptionMiddleware.php

@@ -0,0 +1,71 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Qcloud\Cos\Exception\ServiceResponseException;
+use GuzzleHttp\Promise\PromiseInterface;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use GuzzleHttp\Exception\RequestException;
+
+class ExceptionMiddleware {
+    private $nextHandler;
+    protected $parser;
+    protected $defaultException;
+
+    /**
+     * @param callable $nextHandler Next handler to invoke.
+     */
+    public function __construct(callable $nextHandler) {
+        $this->nextHandler = $nextHandler;
+        $this->parser = new ExceptionParser();
+        $this->defaultException = 'Qcloud\Cos\Exception\ServiceResponseException';
+    }
+
+    /**
+     * @param RequestInterface $request
+     * @param array            $options
+     *
+     * @return PromiseInterface
+     */
+    public function __invoke(RequestInterface $request, array $options) {
+        $fn = $this->nextHandler;
+        return $fn($request, $options)->then(
+                    function (ResponseInterface $response) use ($request) {
+						return $this->handle($request, $response);
+                    }
+		);
+	}
+
+	public function handle(RequestInterface $request, ResponseInterface $response) {
+		$code = $response->getStatusCode();
+		if ($code < 400) {
+			return $response;
+		}
+
+		//throw RequestException::create($request, $response);
+        $parts = $this->parser->parse($request, $response);
+
+        $className = 'Qcloud\\Cos\\Exception\\' . $parts['code'];
+        if (substr($className, -9) !== 'Exception') {
+            $className .= 'Exception';
+        }
+
+        $className = class_exists($className) ? $className : $this->defaultException;
+
+        throw $this->createException($className, $request, $response, $parts);
+	}
+
+    protected function createException($className, RequestInterface $request, ResponseInterface $response, array $parts) {
+        $class = new $className($parts['message']);
+
+        if ($class instanceof ServiceResponseException) {
+            $class->setExceptionCode($parts['code']);
+            $class->setExceptionType($parts['type']);
+            $class->setResponse($response);
+            $class->setRequest($request);
+            $class->setRequestId($parts['request_id']);
+        }
+        return $class;
+    }
+}

+ 112 - 0
addons/cos/library/Qcloud/Cos/ExceptionParser.php

@@ -0,0 +1,112 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Parses default XML exception responses
+ */
+class ExceptionParser {
+
+    public function parse(RequestInterface $request, ResponseInterface $response) {
+        $data = array(
+            'code'       => null,
+            'message'    => null,
+            //'type'       => $response->isClientError() ? 'client' : 'server',
+            'type'       => 'client',
+            'request_id' => null,
+            'parsed'     => null
+        );
+
+		$body = strval($response->getBody());
+
+        if (empty($body)) {
+            $this->parseHeaders($request, $response, $data);
+            return $data;
+        }
+
+        try {
+            $xml = new \SimpleXMLElement(utf8_encode($body));
+            $this->parseBody($xml, $data);
+            return $data;
+        } catch (\Exception $e) {
+            $data['code'] = 'PhpInternalXmlParseError';
+            $data['message'] = 'A non-XML response was received';
+            return $data;
+        }
+    }
+
+    /**
+     * Parses additional exception information from the response headers
+     *
+     * @param RequestInterface $request  Request that was issued
+     * @param Response         $response The response from the request
+     * @param array            $data     The current set of exception data
+     */
+    protected function parseHeaders(RequestInterface $request, ResponseInterface $response, array &$data) {
+        $data['message'] = $response->getStatusCode() . ' ' . $response->getReasonPhrase();
+        $requestId = $response->getHeader('x-cos-request-id');
+        if (isset($requestId[0])) {
+            $requestId = $requestId[0];
+            $data['request_id'] = $requestId;
+            $data['message'] .= " (Request-ID: $requestId)";
+        }
+
+        // Get the request
+        $status  = $response->getStatusCode();
+        $method  = $request->getMethod();
+
+        // Attempt to determine code for 403s and 404s
+        if ($status === 403) {
+            $data['code'] = 'AccessDenied';
+        } elseif ($method === 'HEAD' && $status === 404) {
+            $path   = explode('/', trim($request->getUri()->getPath(), '/'));
+            $host   = explode('.', $request->getUri()->getHost());
+            $bucket = (count($host) >= 4) ? $host[0] : array_shift($path);
+            $object = array_shift($path);
+
+            if ($bucket && $object) {
+                $data['code'] = 'NoSuchKey';
+            } elseif ($bucket) {
+                $data['code'] = 'NoSuchBucket';
+            }
+        }
+    }
+
+    /**
+     * Parses additional exception information from the response body
+     *
+     * @param \SimpleXMLElement $body The response body as XML
+     * @param array             $data The current set of exception data
+     */
+    protected function parseBody(\SimpleXMLElement $body, array &$data) {
+        $data['parsed'] = $body;
+
+        $namespaces = $body->getDocNamespaces();
+        if (isset($namespaces[''])) {
+            // Account for the default namespace being defined and PHP not being able to handle it :(
+            $body->registerXPathNamespace('ns', $namespaces['']);
+            $prefix = 'ns:';
+        } else {
+            $prefix = '';
+        }
+
+        if ($tempXml = $body->xpath("//{$prefix}Code[1]")) {
+            $data['code'] = (string) $tempXml[0];
+        }
+
+        if ($tempXml = $body->xpath("//{$prefix}Message[1]")) {
+            $data['message'] = (string) $tempXml[0];
+        }
+
+        $tempXml = $body->xpath("//{$prefix}RequestId[1]");
+        if (empty($tempXml)) {
+            $tempXml = $body->xpath("//{$prefix}RequestID[1]");
+        }
+        if (isset($tempXml[0])) {
+            $data['request_id'] = (string) $tempXml[0];
+        }
+    }
+}

+ 87 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/BlindWatermarkTemplate.php

@@ -0,0 +1,87 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+class BlindWatermarkTemplate extends ImageTemplate {
+    private $markType;
+    private $type;
+    private $image;
+    private $text;
+    private $level;
+
+    public function __construct() {
+        parent::__construct();
+        $this->markType = 3;
+        $this->type = "";
+        $this->image = "";
+        $this->text = "";
+        $this->level = "";
+
+    }
+
+    public function setPick() {
+        $this->markType = 4;
+    }
+
+    public function setType($value) {
+        $this->type = "/type/" . $value;
+    }
+
+    public function setImage($value) {
+        $this->image = "/image/" . $this->ciBase64($value);
+    }
+
+    public function setText($value) {
+        $this->text = "/text/" . $this->ciBase64($value);
+    }
+
+    public function setLevel($value) {
+        $this->level = "/level/" . $value;
+    }
+
+    public function getType() {
+        return $this->type;
+    }
+
+    public function getImage() {
+        return $this->image;
+    }
+
+    public function getText() {
+        return $this->text;
+    }
+
+    public function getLevel() {
+        return $this->level;
+    }
+
+
+    public function queryString() {
+        $head = "watermark/$this->markType";
+        $res = "";
+        if($this->type){
+            $res .= $this->type;
+        }
+        if($this->image){
+            $res .= $this->image;
+        }
+        if($this->text){
+            $res .= $this->text;
+        }
+        if($this->level){
+            $res .= $this->level;
+        }
+        if($res){
+            $res = $head . $res;
+        }
+        return $res;
+    }
+
+    public function resetRule() {
+        $this->markType = 3;
+        $this->type = "";
+        $this->image = "";
+        $this->text = "";
+        $this->level = "";
+    }
+}

+ 39 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/CIParamTransformation.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+class CIParamTransformation extends ImageTemplate{
+
+    private $tranParams;
+    private $tranString;
+    private $spilt;
+
+    public function __construct($spilt = "|") {
+        parent::__construct();
+        $this->spilt = $spilt;
+        $this->tranParams = array();
+        $this->tranString = "";
+    }
+
+    public function addRule(ImageTemplate $template) {
+        if($template->queryString()){
+            $this->tranParams[] = $template->queryString();
+        }
+    }
+
+    public function queryString() {
+        if($this->tranParams) {
+            $this->tranString = implode($this->spilt, $this->tranParams);
+        }
+        return $this->tranString;
+    }
+
+    public function resetRule() {
+        $this->tranParams = array();
+        $this->tranString = "";
+    }
+
+    public function defineRule($value) {
+        $this->tranParams[] = $value;
+    }
+}

+ 31 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/CIProcessTransformation.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+class CIProcessTransformation extends ImageTemplate{
+
+    private $tranParams = array();
+    private $tranString;
+
+    public function __construct($ciProcess) {
+        parent::__construct();
+        $this->tranParams['ci-process'] = $ciProcess;
+        $this->tranString = "";
+    }
+
+    public function addParam($name, $value, $base64 = false) {
+        if(is_string($name) && strlen($name) > 0){
+            if($base64) {
+                $value = $this->ciBase64($value);
+            }
+            $this->tranParams[$name] = $value;
+        }
+    }
+
+    public function queryString() {
+        if($this->tranParams) {
+            $this->tranString = http_build_query($this->tranParams);
+        }
+        return $this->tranString;
+    }
+}

+ 374 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageMogrTemplate.php

@@ -0,0 +1,374 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+/**
+ * Class ImageMogrTemplate imageMogr2 接口参数
+ * @package Qcloud\Cos\ImageParamTemplate
+ */
+class ImageMogrTemplate extends ImageTemplate
+{
+    private $tranParams;
+    private $tranString;
+
+    public function __construct() {
+        parent::__construct();
+        $this->tranParams = array();
+        $this->tranString = "";
+    }
+
+    /**
+     * 指定图片的宽高为原图的 Scale%
+     * @param $widthScale
+     */
+    public function thumbnailByScale($widthScale) {
+        $this->tranParams[] = "/thumbnail/!" . $widthScale . "p";
+    }
+
+    /**
+     * 指定图片的宽为原图的 Scale%,高度不变
+     * @param $heightScale
+     */
+    public function thumbnailByWidthScale($heightScale) {
+        $this->tranParams[] = "/thumbnail/!" . $heightScale . "px";
+    }
+
+    /**
+     * 指定图片的高为原图的 Scale%,宽度不变
+     * @param $scale
+     */
+    public function thumbnailByHeightScale($scale) {
+        $this->tranParams[] = "/thumbnail/!x" . $scale . "p";
+    }
+
+    /**
+     * 指定目标图片宽度为 Width,高度等比缩放
+     * @param $width
+     */
+    public function thumbnailByWidth($width) {
+        $this->tranParams[] = "/thumbnail/" . $width . "x";
+    }
+
+    /**
+     * 指定目标图片高度为 Height,宽度等比缩放
+     * @param $height
+     */
+    public function thumbnailByHeight($height) {
+        $this->tranParams[] = "/thumbnail/x" . $height;
+    }
+
+    /**
+     * 限定缩略图的宽度和高度的最大值分别为 Width 和 Height,进行等比缩放
+     * @param $maxW
+     * @param $maxH
+     */
+    public function thumbnailByMaxWH($maxW, $maxH) {
+        $this->tranParams[] = "/thumbnail/" . $maxW . "x" . $maxH;
+    }
+
+    /**
+     * 限定缩略图的宽度和高度的最小值分别为 Width 和 Height,进行等比缩放
+     * @param $minW
+     * @param $minH
+     */
+    public function thumbnailByMinWH($minW, $minH) {
+        $this->tranParams[] = "/thumbnail/!" . $minW . "x" . $minH . "r" ;
+    }
+
+    /**
+     * 忽略原图宽高比例,指定图片宽度为 Width,高度为 Height,强行缩放图片,可能导致目标图片变形
+     * @param $width
+     * @param $height
+     */
+    public function thumbnailByWH($width, $height) {
+        $this->tranParams[] = "/thumbnail/" . $width  . "x" . $height . "!";
+    }
+
+    /**
+     * 限定缩略图的宽度和高度的最大值分别为 Width 和 Height,进行等比缩小,比例值为宽缩放比和高缩放比的较小值,如果目标宽(高)都大于原图宽(高),则不变
+     * @param $width
+     * @param $height
+     */
+    public function thumbnailEqualRatioReduceByWH($width, $height) {
+        $this->tranParams[] = "/thumbnail/{$width}x{$height}>";
+    }
+
+    /**
+     * 限定缩略图的宽度和高度的最大值分别为 Width 和 Height,进行等比放大,比例值为宽缩放比和高缩放比的较小值。如果目标宽(高)小于原图宽(高),则不变
+     * @param $width
+     * @param $height
+     */
+    public function thumbnailEqualRatioEnlargeByWH($width, $height) {
+        $this->tranParams[] = "/thumbnail/{$width}x{$height}<";
+    }
+
+    /**
+     * 等比缩放图片,缩放后的图像,总像素数量不超过 $pixel
+     * @param $pixel
+     */
+    public function thumbnailByPixel($pixel) {
+        $this->tranParams[] = "/thumbnail/" . $pixel . "@";
+    }
+
+    /**
+     * 将原图缩放为指定 Width 和 Height 的矩形内的最大图片,之后使用 color 参数指定的颜色居中填充空白部分;取值0或1,0代表不使用 pad 模式,1代表使用 pad 模式
+     * @param $is
+     */
+    public function pad($is) {
+        $this->tranParams[] = "/pad/{$is}";
+    }
+
+    /**
+     * 填充颜色,缺省为白色,需设置为十六进制 RGB 格式(如 #FF0000),详情参考 RGB 编码表,需经过 URL 安全的 Base64 编码,默认值为 #3D3D3D
+     * @param $rgb
+     */
+    public function color($rgb) {
+        $rgb = $this->ciBase64($rgb);
+        $this->tranParams[] = "/color/{$rgb}";
+    }
+
+    /**
+     * 当处理参数中携带此参数时,针对文件过大、参数超限等导致处理失败的场景,会直接返回原图而不报错
+     */
+    public function ignoreError() {
+        $this->tranParams[] = "/ignore-error/1";
+    }
+
+    /**
+     * 普通裁剪参数说明 操作名称:cut
+     * @param $width
+     * @param $height
+     * @param $dx
+     * @param $dy
+     */
+    public function cut($width, $height, $dx, $dy) {
+        $this->tranParams[] = "/cut/" . $width . "x" . "$height" . "x" . $dx . "x" . $dy;
+    }
+
+    /**
+     * 指定目标图片宽度为 Width,高度不变。Width 取值范围应大于0,小于原图宽度
+     * @param $width
+     * @param string $gravity 指定操作的起点位置
+     */
+    public function cropByWidth($width, $gravity = "") {
+        $temp = "/crop/" . $width . "x";
+        if($gravity){
+            $temp .= "/gravity/" . $gravity;
+        }
+        $this->tranParams[] = $temp;
+    }
+
+    /**
+     * 指定目标图片高度为 Height,宽度不变。Height 取值范围应大于0,小于原图高度
+     * @param $height
+     * @param string $gravity 指定操作的起点位置
+     */
+    public function cropByHeight($height, $gravity = "") {
+        $temp = "/crop/x" . $height;
+        if($gravity){
+            $temp .= "/gravity/" . $gravity;
+        }
+        $this->tranParams[] = $temp;
+    }
+
+    /**
+     * 指定目标图片宽度为 Width,高度为 Height 。Width 和 Height 取值范围都应大于0,小于原图宽度/高度
+     * @param $width
+     * @param $height
+     * @param string $gravity 指定操作的起点位置
+     */
+    public function cropByWH($width, $height, $gravity = "") {
+        $temp = "/crop/" . $width . "x" . $height;
+        if($gravity){
+            $temp .= "/gravity/" . $gravity;
+        }
+        $this->tranParams[] = $temp;
+    }
+
+    /**
+     * 内切圆裁剪功能,radius 是内切圆的半径,取值范围为大于0且小于原图最小边一半的整数。内切圆的圆心为图片的中心。图片格式为 gif 时,不支持该参数。
+     * @param $radius
+     */
+    public function iradius($radius) {
+        $this->tranParams[] = "/iradius/" . $radius;
+    }
+
+    /**
+     * 圆角裁剪功能,radius 为图片圆角边缘的半径,取值范围为大于0且小于原图最小边一半的整数。圆角与原图边缘相切。图片格式为 gif 时,不支持该参数。
+     * @param $radius
+     */
+    public function rradius($radius) {
+        $this->tranParams[] = "/rradius/" . $radius;
+    }
+
+    /**
+     * 基于图片中的人脸位置进行缩放裁剪。目标图片的宽度为 Width、高度为 Height。
+     * @param $width
+     * @param $height
+     */
+    public function scrop($width, $height) {
+        $this->tranParams[] = "/scrop/" . $width . "x" . $height;
+    }
+
+    /**
+     * 普通旋转:图片顺时针旋转角度,取值范围0 - 360,默认不旋转。
+     * @param $degree
+     */
+    public function rotate($degree) {
+        $this->tranParams[] = "/rotate/" . $degree;
+    }
+
+    /**
+     * 自适应旋转:根据原图 EXIF 信息将图片自适应旋转回正。
+     */
+    public function autoOrient() {
+        $this->tranParams[] = "/auto-orient";
+    }
+
+    /**
+     * 镜像翻转:flip 值为 vertical 表示垂直翻转,horizontal 表示水平翻转
+     * @param $flip
+     */
+    public function flip($flip) {
+        $this->tranParams[] = "/flip/" . $flip;
+    }
+
+    /**
+     * 格式转换:目标缩略图的图片格式可为:jpg,bmp,gif,png,webp,yjpeg 等,其中 yjpeg 为数据万象针对 jpeg 格式进行的优化,本质为 jpg 格式;缺省为原图格式。
+     * @param $format
+     */
+    public function format($format) {
+        $this->tranParams[] = "/format/" . $format;
+    }
+
+    /**
+     * gif 格式优化:只针对原图为 gif 格式,对 gif 图片格式进行的优化,降帧降颜色。分为以下两种情况:
+     * FrameNumber=1,则按照默认帧数30处理,如果图片帧数大于该帧数则截取。
+     * FrameNumber 取值( 1,100 ],则将图片压缩到指定帧数 (FrameNumber)。
+     * @param $frameNumber
+     */
+    public function gifOptimization($frameNumber) {
+        $this->tranParams[] = "/cgif/" . $frameNumber;
+    }
+
+    /**
+     * 输出为渐进式 jpg 格式。Mode 可为0或1。0:表示不开启渐进式;1:表示开启渐进式。该参数仅在输出图片格式为 jpg 格式时有效。如果输出非 jpg 图片格式,会忽略该参数,默认值0。
+     * @param $mode
+     */
+    public function jpegInterlaceMode($mode) {
+        $this->tranParams[] = "/interlace/" . $mode;
+    }
+
+    /**
+     * 图片的绝对质量,取值范围0 - 100,默认值为原图质量;取原图质量和指定质量的最小值;<Quality>后面加“!”表示强制使用指定值,例如:90!。
+     * @param $value
+     * @param int $force
+     */
+    public function quality($value, $force = 0) {
+        $temp = "/quality/" . $value;
+        if($force){
+            $temp .= "!";
+        }
+        $this->tranParams[] = $temp;
+    }
+
+    /**
+     * 图片的最低质量,取值范围0 - 100,设置结果图的质量参数最小值。
+     * 例如原图质量为85,将 lquality 设置为80后,处理结果图的图片质量为85。
+     * 例如原图质量为60,将 lquality 设置为80后,处理结果图的图片质量会被提升至80。
+     * @param $value
+     */
+    public function lowestQuality($value) {
+        $this->tranParams[] = "/lquality/" . $value;
+    }
+
+    /**
+     * 图片的相对质量,取值范围0 - 100,数值以原图质量为标准。例如原图质量为80,将 rquality 设置为80后,得到处理结果图的图片质量为64(80x80%)。
+     * @param $value
+     */
+    public function relativelyQuality($value) {
+        $this->tranParams[] = "/rquality/" . $value;
+    }
+
+    /**
+     * 高斯模糊
+     * @param $radius integer|float 模糊半径,取值范围为1 - 50
+     * @param $sigma integer|float 正态分布的标准差,必须大于0
+     */
+    public function blur($radius, $sigma) {
+        $this->tranParams[] = "/blur/" . $radius . "x" . $sigma;
+    }
+
+    /**
+     * 图片亮度调节功能,value 为亮度参数值,取值范围为[-100, 100]的整数。
+     * 取值<0:降低图片亮度。
+     * 取值 = 0:不调整图片亮度。
+     * 取值>0:提高图片亮度。
+     * @param $value
+     */
+    public function bright($value) {
+        $this->tranParams[] = "/bright/" . $value;
+    }
+
+    /**
+     * 图片对比度调节功能,value 为对比度参数值,取值范围为[-100, 100]的整数。
+     * 取值<0:降低图片对比度。
+     * 取值 = 0:不调整图片对比度。
+     * 取值>0:提高图片对比度。
+     * @param $value
+     */
+    public function contrast($value) {
+        $this->tranParams[] = "/contrast/" . $value;
+    }
+
+    /**
+     * 图片锐化功能,value 为锐化参数值,取值范围为10 - 300间的整数(推荐使用70)。参数值越大,锐化效果越明显。
+     * @param $value
+     */
+    public function sharpen($value) {
+        $this->tranParams[] = "/sharpen/" . $value;
+    }
+
+    /**
+     * 将图片设置为灰度图。 value 取值为0表示不改变图片。 value 取值为1表示将图片变为灰度图。
+     * @param $value
+     */
+    public function grayscale($value) {
+        $this->tranParams[] = "/grayscale/" . $value;
+    }
+
+    /**
+     * 去除图片元信息,包括 exif 信息
+     */
+    public function strip() {
+        $this->tranParams[] = "/strip";
+    }
+
+    /**
+     * 限制图片转换后的大小,支持以兆字节(m)和千字节(k)为单位
+     * 1. 仅支持 JPG 格式的图片,可以用于限制处理后图片的大小
+     * 2. 若在尾部加上!,表示用处理后的图片大小与原图大小做比较,如果处理后的图片比原图小,则返回处理后的图片,否则返回原图。例如:examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/picture.jpg?imageMogr2/size-limit/15k!
+     * 3. 建议搭配strip参数使用,去除图片的一些冗余信息,会有更好的效果。例如:examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/picture.jpg?imageMogr2/strip/format/png/size-limit/15k!
+     * @param $value
+     * @param int $compare
+     */
+    public function sizeLimit($value, $compare = 0) {
+        $temp = "/size-limit/" . $value;
+        if($compare){
+            $temp .= "!";
+        }
+        $this->tranParams[] = $temp;
+    }
+
+    public function queryString() {
+        if($this->tranParams) {
+            $this->tranString = "imageMogr2" . implode("", $this->tranParams);
+        }
+        return $this->tranString;
+    }
+
+    public function resetRule() {
+        $this->tranString = "";
+        $this->tranParams = array();
+    }
+}

+ 37 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageQrcodeTemplate.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+class ImageQrcodeTemplate extends ImageTemplate
+{
+    private $mode;
+
+    public function __construct() {
+        parent::__construct();
+        $this->mode = "";
+    }
+
+    public function setMode($mode) {
+        $this->mode = "/cover/" . $mode;
+    }
+
+    public function getMode() {
+        return $this->mode;
+    }
+
+    public function queryString() {
+        $head = "QRcode";
+        $res = "";
+        if($this->mode) {
+            $res .= $this->mode;
+        }
+        if($res) {
+            $res = $head . $res;
+        }
+        return $res;
+    }
+
+    public function resetRule() {
+        $this->mode = "";
+    }
+}

+ 33 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageStyleTemplate.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+class ImageStyleTemplate extends ImageTemplate
+{
+    private $style;
+
+    public function __construct() {
+        parent::__construct();
+        $this->style = "";
+    }
+
+    public function setStyle($styleName) {
+        $this->style = "style/" . $styleName;
+    }
+
+    public function getStyle() {
+        return $this->style;
+    }
+
+    public function queryString() {
+        $res = "";
+        if($this->style) {
+            $res = $this->style;
+        }
+        return $res;
+    }
+
+    public function resetRule() {
+        $this->style = "";
+    }
+}

+ 18 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageTemplate.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+class ImageTemplate
+{
+
+    public function __construct() {
+    }
+
+    public function queryString() {
+        return "";
+    }
+
+    public function ciBase64($value) {
+        return  str_replace("/", "_", str_replace("+", "-", base64_encode($value)));
+    }
+}

+ 115 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageViewTemplate.php

@@ -0,0 +1,115 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+/**
+ * Parses default XML exception responses
+ */
+class ImageViewTemplate extends ImageTemplate
+{
+    private $mode;
+    private $width;
+    private $height;
+    private $format;
+    private $quality;
+    private $ignoreError;
+
+
+    public function __construct() {
+        parent::__construct();
+        $this->mode = "";
+        $this->width = "";
+        $this->height = "";
+        $this->format = "";
+        $this->quality = "";
+        $this->ignoreError = "";
+    }
+
+    public function setMode($value) {
+        $this->mode = "/" . $value;
+    }
+
+    public function setWidth($value) {
+        $this->width = "/w/" . $value;
+    }
+
+    public function setHeight($value) {
+        $this->height = "/h/" . $value;
+    }
+
+    public function setFormat($value) {
+        $this->format = "/format/" . $value;
+    }
+
+    public function setQuality($qualityType, $qualityValue, $force = 0) {
+        if($qualityType == 1){
+            $this->quality = "/q/$qualityValue" ;
+            if($force){
+                $this->quality .= "!";
+            }
+        }else if($qualityType == 2){
+            $this->quality = "/rq/$qualityValue" ;
+        }else if ($qualityType == 3){
+            $this->quality = "/lq/$qualityValue" ;
+        }
+    }
+
+    public function ignoreError() {
+        $this->ignoreError = '/ignore-error/1';
+    }
+
+    public function getMode() {
+        return $this->mode;
+    }
+
+    public function getWidth() {
+        return $this->width;
+    }
+
+    public function getHeight() {
+        return $this->height;
+    }
+
+    public function getFormat() {
+        return $this->format;
+    }
+
+    public function getQuality() {
+        return $this->quality;
+    }
+
+    public function queryString() {
+        $head = "imageView2";
+        $res = "";
+        if($this->mode) {
+            $res .= $this->mode;
+        }
+        if($this->width) {
+            $res .= $this->width;
+        }
+        if($this->height) {
+            $res .= $this->height;
+        }
+        if($this->format) {
+            $res .= $this->format;
+        }
+        if($this->quality) {
+            $res .= $this->quality;
+        }
+        if($this->ignoreError) {
+            $res .= $this->ignoreError;
+        }
+        if($res) {
+            $res = $head . $res;
+        }
+        return $res;
+    }
+
+    public function resetRule() {
+        $this->mode = "";
+        $this->width = "";
+        $this->height = "";
+        $this->format = "";
+        $this->quality = "";
+    }
+}

+ 212 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/ImageWatermarkTemplate.php

@@ -0,0 +1,212 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+class ImageWatermarkTemplate extends ImageTemplate
+{
+
+    private $image;
+    private $gravity;
+    private $dx;
+    private $dy;
+    private $blogo;
+    private $scatype;
+    private $spcent;
+    private $dissolve;
+    private $batch;
+    private $degree;
+
+    public function __construct() {
+        parent::__construct();
+        $this->image = "";
+        $this->gravity = "";
+        $this->dx = "";
+        $this->dy = "";
+        $this->blogo = "";
+        $this->scatype = "";
+        $this->spcent = "";
+        $this->dissolve = "";
+        $this->batch = "";
+        $this->degree = "";
+    }
+
+    /**
+     * 水印图片地址,需要经过 URL 安全的 Base64 编码。
+     * @param $value
+     */
+    public function setImage($value) {
+        $this->image = "/image/" . $this->ciBase64($value);
+    }
+
+    /**
+     * 图片水印位置,九宫格位置(参考九宫格方位图 ),默认值 SouthEast
+     * @param $value
+     */
+    public function setGravity($value) {
+        $this->gravity = "/gravity/" . $value;
+    }
+
+    /**
+     * 水平(横轴)边距,单位为像素,缺省值为0
+     * @param $value
+     */
+    public function setDx($value) {
+        $this->dx = "/dx/" . $value;
+    }
+
+    /**
+     * 垂直(纵轴)边距,单位为像素,默认值为0
+     * @param $value
+     */
+    public function setDy($value) {
+        $this->dy = "/dy/" . $value;
+    }
+
+    /**
+     * 水印图适配功能,适用于水印图尺寸过大的场景(如水印墙)。共有两种类型:
+     * 当 blogo 设置为1时,水印图会被缩放至与原图相似大小后添加
+     * 当 blogo 设置为2时,水印图会被直接裁剪至与原图相似大小后添加
+     * @param $value
+     */
+    public function setBlogo($value) {
+        $this->blogo = "/blogo/" . $value;
+    }
+
+    /**
+     * 根据原图的大小,缩放调整水印图的大小:
+     * 当 scatype 设置为1时,按原图的宽缩放
+     * 当 scatype 设置为2时,按原图的高缩放
+     * 当 scatype 设置为3时,按原图的整体面积缩放
+     * @param $value
+     */
+    public function setScatype($value) {
+        $this->scatype = "/scatype/" . $value;
+    }
+
+    /**
+     * 与 scatype 搭配使用:
+     * 当 scatype 设置为1时,该有效值为[1,1000],单位为千分比
+     * 当 scatype 设置为2时,该有效值为[1,1000],单位为千分比
+     * 当 scatype 设置为3时,该有效值为[1,250],单位为千分比。
+     * @param $value
+     */
+    public function setSpcent($value) {
+        $this->spcent = "/spcent/" . $value;
+    }
+
+    /**
+     * 图片水印的透明度,取值为1 - 100,默认90(90%不透明度)
+     * @param $value
+     */
+    public function setDissolve($value) {
+        $this->dissolve = "/dissolve/" . $value;
+    }
+
+    /**
+     * 平铺水印功能,可将图片水印平铺至整张图片。值为1时,表示开启平铺水印功能
+     * @param $value
+     */
+    public function setBatch($value) {
+        $this->batch = "/batch/" . $value;
+    }
+
+    /**
+     * 当 batch 值为1时生效。图片水印的旋转角度设置,取值范围为0 - 360,默认0
+     * @param $value
+     */
+    public function setDegree($value) {
+        $this->degree = "/degree/" . $value;
+    }
+
+    public function getImage() {
+        return $this->image;
+    }
+
+    public function getGravity() {
+        return $this->gravity;
+    }
+
+    public function getDx() {
+        return $this->dx;
+    }
+
+    public function getDy() {
+        return $this->dy;
+    }
+
+    public function getBlogo() {
+        return $this->blogo;
+    }
+
+    public function getScatype() {
+        return $this->scatype;
+    }
+
+    public function getSpcent() {
+        return $this->spcent;
+    }
+
+    public function getDissolve() {
+        return $this->dissolve;
+    }
+
+    public function getBatch() {
+        return $this->batch;
+    }
+
+    public function getDegree() {
+        return $this->degree;
+    }
+
+    public function queryString() {
+        $head = "watermark/1";
+        $res = "";
+        if($this->image) {
+            $res .= $this->image;
+        }
+        if($this->gravity) {
+            $res .= $this->gravity;
+        }
+        if($this->dx) {
+            $res .= $this->dx;
+        }
+        if($this->dy) {
+            $res .= $this->dy;
+        }
+        if($this->blogo) {
+            $res .= $this->blogo;
+        }
+        if($this->scatype) {
+            $res .= $this->scatype;
+        }
+        if($this->spcent) {
+            $res .= $this->spcent;
+        }
+        if($this->dissolve) {
+            $res .= $this->dissolve;
+        }
+        if($this->batch) {
+            $res .= $this->batch;
+        }
+        if($this->degree) {
+            $res .= $this->degree;
+        }
+        if($res) {
+            $res = $head . $res;
+        }
+        return $res;
+    }
+
+    public function resetRule() {
+        $this->image = "";
+        $this->gravity = "";
+        $this->dx = "";
+        $this->dy = "";
+        $this->blogo = "";
+        $this->scatype = "";
+        $this->spcent = "";
+        $this->dissolve = "";
+        $this->batch = "";
+        $this->degree = "";
+    }
+}

+ 64 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/PicOperationsTransformation.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+/**
+ * Class PicOperationsTransformation 图片处理参数 Pic-Operations
+ * @package Qcloud\Cos\ImageParamTemplate
+ */
+class PicOperationsTransformation {
+    private $isPicInfo;
+    private $rules;
+
+    public function __construct() {
+        $this->isPicInfo = 0;
+        $this->rules = array();
+    }
+
+    public function setIsPicInfo($value) {
+        $this->isPicInfo = $value;
+    }
+
+    public function addRule(ImageTemplate $template, $fileid = "", $bucket = "") {
+        $rule = $template->queryString();
+        if($rule){
+            $item = array();
+            $item['rule'] = $rule;
+            if($fileid){
+                $item['fileid'] = $fileid;
+            }
+            if($bucket) {
+                $item['bucket'] = $bucket;
+            }
+            $this->rules[] = $item;
+        }
+    }
+
+    public function getIsPicInfo() {
+        return $this->isPicInfo;
+    }
+
+    public function getRules() {
+        return $this->rules;
+    }
+
+    public function queryString() {
+        $res = "";
+        $picOperations = array();
+       if($this->isPicInfo){
+           $picOperations['is_pic_info'] = $this->isPicInfo;
+       }
+       if($this->rules){
+           $picOperations['rules'] = $this->rules;
+       }
+       if($picOperations){
+           $res = json_encode($picOperations);
+       }
+       return $res;
+    }
+
+    public function resetRule() {
+        $this->isPicInfo = 0;
+        $this->rules = array();
+    }
+}

+ 180 - 0
addons/cos/library/Qcloud/Cos/ImageParamTemplate/TextWatermarkTemplate.php

@@ -0,0 +1,180 @@
+<?php
+
+namespace Qcloud\Cos\ImageParamTemplate;
+
+/**
+ * Parses default XML exception responses
+ */
+class TextWatermarkTemplate extends ImageTemplate
+{
+    private $text;
+    private $font;
+    private $fontsize;
+    private $fill;
+    private $dissolve;
+    private $gravity;
+    private $dx;
+    private $dy;
+    private $batch;
+    private $degree;
+    private $shadow;
+
+    public function __construct() {
+        parent::__construct();
+        $this->text = "";
+        $this->font = "";
+        $this->fontsize = "";
+        $this->fill = "";
+        $this->dissolve = "";
+        $this->gravity = "";
+        $this->dx = "";
+        $this->dy = "";
+        $this->batch = "";
+        $this->degree = "";
+        $this->shadow = "";
+    }
+
+    public function setText($value) {
+        $this->text = "/text/" . $this->ciBase64($value);
+    }
+
+    public function setFont($value) {
+        $this->font = "/font/" . $this->ciBase64($value);
+    }
+
+    public function setFontsize($value) {
+        $this->fontsize = "/fontsize/" . $value;
+    }
+
+    public function setFill($value) {
+        $this->fill = "/fill/" . $this->ciBase64($value);
+    }
+
+    public function setDissolve($value) {
+        $this->dissolve = "/dissolve/" . $value;
+    }
+
+    public function setGravity($value) {
+        $this->gravity = "/gravity/" . $value;
+    }
+
+    public function setDx($value) {
+        $this->dx = "/dx/" . $value;
+    }
+
+    public function setDy($value) {
+        $this->dy = "/dy/" . $value;
+    }
+
+    public function setBatch($value) {
+        $this->batch = "/batch/" . $value;
+    }
+
+    public function setDegree($value) {
+        $this->degree = "/degree/" . $value;
+    }
+
+    public function setShadow($value) {
+        $this->shadow = "/shadow/" . $value;
+    }
+
+    public function getText() {
+        return $this->text;
+    }
+
+    public function getFont() {
+        return $this->font;
+    }
+
+    public function getFontsize() {
+        return $this->fontsize;
+    }
+
+    public function getFill() {
+        return $this->fill;
+    }
+
+    public function getDissolve() {
+        return $this->dissolve;
+    }
+
+    public function getGravity() {
+        return $this->gravity;
+    }
+
+    public function getDx() {
+        return $this->dx;
+    }
+
+    public function getDy() {
+        return $this->dy;
+    }
+
+    public function getBatch() {
+        return $this->batch;
+    }
+
+    public function getDegree() {
+        return $this->degree;
+    }
+
+    public function getShadow() {
+        return $this->shadow;
+    }
+
+    public function queryString() {
+        $head = "watermark/2";
+        $res = "";
+        if($this->text) {
+            $res .= $this->text;
+        }
+        if($this->font) {
+            $res .= $this->font;
+        }
+        if($this->fontsize) {
+            $res .= $this->fontsize;
+        }
+        if($this->fill) {
+            $res .= $this->fill;
+        }
+        if($this->dissolve) {
+            $res .= $this->dissolve;
+        }
+        if($this->gravity) {
+            $res .= $this->gravity;
+        }
+        if($this->dx) {
+            $res .= $this->dx;
+        }
+        if($this->dy) {
+            $res .= $this->dy;
+        }
+        if($this->batch) {
+            $res .= $this->batch;
+        }
+        if($this->degree) {
+            $res .= $this->degree;
+        }
+        if($this->shadow) {
+            $res .= $this->shadow;
+        }
+        if($res) {
+            $res = $head . $res;
+        }
+        return $res;
+    }
+
+    public function resetRule() {
+        $this->text = "";
+        $this->font = "";
+        $this->fontsize = "";
+        $this->fill = "";
+        $this->dissolve = "";
+        $this->gravity = "";
+        $this->dx = "";
+        $this->dy = "";
+        $this->batch = "";
+        $this->degree = "";
+        $this->shadow = "";
+    }
+}

+ 167 - 0
addons/cos/library/Qcloud/Cos/MultipartUpload.php

@@ -0,0 +1,167 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use GuzzleHttp\Pool;
+
+class MultipartUpload {
+    const MIN_PART_SIZE = 1048576;
+    const MAX_PART_SIZE = 5368709120;
+    const DEFAULT_PART_SIZE = 5242880;
+    const MAX_PARTS     = 10000;
+
+    private $client;
+    private $options;
+    private $partSize;
+    private $parts;
+    private $body;
+    private $progress;
+    private $totalSize;
+    private $uploadedSize;
+
+    public function __construct($client, $body, $options = array()) {
+        $minPartSize = $options['PartSize'];
+        unset($options['PartSize']);
+        $this->body = $body;
+        $this->client = $client;
+        $this->options = $options;
+        $this->partSize = $this->calculatePartSize($minPartSize);
+        $this->concurrency = isset($options['Concurrency']) ? $options['Concurrency'] : 10;
+        $this->progress = isset($options['Progress']) ? $options['Progress'] : function($totalSize, $uploadedSize) {};
+        $this->parts = [];
+        $this->partNumberList = [];
+        $this->uploadedSize = 0;
+        $this->totalSize = $this->body->getSize();
+        $this->needMd5 = isset($options['ContentMD5']) ? $options['ContentMD5'] : true;
+        $this->retry = isset($options['Retry']) ? $options['Retry'] : 3;
+    }
+    public function performUploading() {
+        $uploadId= $this->initiateMultipartUpload();
+        $this->uploadParts($uploadId);
+        foreach ( $this->parts as $key => $row ){
+            $num1[$key] = $row ['PartNumber'];
+            $num2[$key] = $row ['ETag'];
+        }
+        array_multisort($num1, SORT_ASC, $num2, SORT_ASC, $this->parts);
+        return $this->client->completeMultipartUpload(array(
+            'Bucket' => $this->options['Bucket'],
+            'Key' => $this->options['Key'],
+            'UploadId' => $uploadId,
+            'Parts' => $this->parts)
+        );
+
+    }
+    public function uploadParts($uploadId) {
+        $uploadRequests = function ($uploadId) {
+            $partNumber = 1;
+            $index = 1;
+            $offset = 0;
+            $partSize = 0;
+            for ( ; ; $partNumber ++) {
+                if ($this->body->eof()) {
+                    break;
+                }
+                $body = $this->body->read($this->partSize);
+                $partSize = $this->partSize;
+                if ($offset + $this->partSize >= $this->totalSize) {
+                    $partSize = $this->totalSize - $offset;
+                }
+                $offset += $partSize;
+                if (empty($body)) {
+                    break;
+                }
+                if (isset($this->parts[$partNumber])) {
+                    continue;
+                }
+                $this->partNumberList[$index]['PartNumber'] = $partNumber;
+                $this->partNumberList[$index]['PartSize'] = $partSize;
+                $params = array(
+                    'Bucket' => $this->options['Bucket'],
+                    'Key' => $this->options['Key'],
+                    'UploadId' => $uploadId,
+                    'PartNumber' => $partNumber,
+                    'Body' => $body,
+                    'ContentMD5' => $this->needMd5
+                );
+                if ($this->needMd5 == false) {
+                    unset($params["ContentMD5"]);
+                }
+                if (!isset($this->parts[$partNumber])) {
+                    $command = $this->client->getCommand('uploadPart', $params);
+                    $request = $this->client->commandToRequestTransformer($command);
+                    $index ++;
+                    yield $request;
+                }
+            }
+        }; 
+        $pool = new Pool($this->client->httpClient, $uploadRequests($uploadId), [
+            'concurrency' => $this->concurrency,
+            'fulfilled' => function ($response, $index) {
+                $index = $index + 1;
+                $partNumber = $this->partNumberList[$index]['PartNumber'];
+                $partSize = $this->partNumberList[$index]['PartSize'];
+
+                //兼容两种写法,防止index为undefined
+                if (array_key_exists('etag', $response->getHeaders())) {
+                    $etag = $response->getHeaders()["etag"][0];
+                }
+
+                if (array_key_exists('ETag', $response->getHeaders())) {
+                    $etag = $response->getHeaders()["ETag"][0];
+                }
+                $part = array('PartNumber' => $partNumber, 'ETag' => $etag);
+                $this->parts[$partNumber] = $part;
+                $this->uploadedSize += $partSize;
+                call_user_func_array($this->progress, [$this->totalSize, $this->uploadedSize]);
+            },
+           
+            'rejected' => function ($reason, $index) {
+                printf("part [%d] upload failed, reason: %s\n", $index, $reason);
+                throw($reason);
+            }
+        ]);
+        $promise = $pool->promise();
+        $promise->wait();
+    }
+
+    public function resumeUploading() {
+        $uploadId = $this->options['UploadId'];
+        $rt = $this->client->ListParts(
+            array('UploadId' => $uploadId,
+                'Bucket'=>$this->options['Bucket'],
+                'Key'=>$this->options['Key']));
+                $parts = array();
+        if (count($rt['Parts']) > 0) {
+            foreach ($rt['Parts'] as $part) {
+                $this->parts[$part['PartNumber']] = array('PartNumber' => $part['PartNumber'], 'ETag' => $part['ETag']);
+            }
+        }
+        $this->uploadParts($uploadId);
+        foreach ( $this->parts as $key => $row ){
+            $num1[$key] = $row ['PartNumber'];
+            $num2[$key] = $row ['ETag'];
+        }
+        array_multisort($num1, SORT_ASC, $num2, SORT_ASC, $this->parts);
+        return $this->client->completeMultipartUpload(array(
+            'Bucket' => $this->options['Bucket'],
+            'Key' => $this->options['Key'],
+            'UploadId' => $uploadId,
+            'Parts' => $this->parts)
+        );
+    }
+
+    private function calculatePartSize($minPartSize)
+    {   
+        $partSize = intval(ceil(($this->body->getSize() / self::MAX_PARTS)));
+        $partSize = max($minPartSize, $partSize);
+        $partSize = min($partSize, self::MAX_PART_SIZE);
+        $partSize = max($partSize, self::MIN_PART_SIZE);
+        return $partSize;
+    }
+
+    private function initiateMultipartUpload() {
+        $result = $this->client->createMultipartUpload($this->options);
+        return $result['UploadId'];
+    }
+
+}

+ 145 - 0
addons/cos/library/Qcloud/Cos/RangeDownload.php

@@ -0,0 +1,145 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use GuzzleHttp\Pool;
+
+class RangeDownload {
+    const DEFAULT_PART_SIZE = 52428800;
+
+    private $client;
+    private $options;
+    private $partSize;
+    private $parts;
+    private $progress;
+    private $totalSize;
+    private $resumableJson;
+
+    public function __construct( $client, $contentLength, $saveAs, $options = array() ) {
+        $this->client = $client;
+        $this->options = $options;
+        $this->partSize = isset( $options['PartSize'] ) ? $options['PartSize'] : self::DEFAULT_PART_SIZE;
+        $this->concurrency = isset( $options['Concurrency'] ) ? $options['Concurrency'] : 10;
+        $this->progress = isset( $options['Progress'] ) ? $options['Progress'] : function( $totalSize, $downloadedSize ) {
+        }
+        ;
+        $this->parts = [];
+        $this->partNumberList = [];
+        $this->downloadedSize = 0;
+        $this->totalSize = $contentLength;
+        $this->saveAs = $saveAs;
+        $this->resumableJson = [];
+        $this->resumableJson = isset( $options['ResumableJson'] ) ? $options['ResumableJson'] : [];
+        unset( $options['ResumableJson'] );
+        $this->resumableTaskFile = isset( $options['ResumableTaskFile'] ) ? $options['ResumableTaskFile'] : $saveAs . '.cosresumabletask';
+        $this->resumableDownload = isset( $options['ResumableDownload'] ) ? $options['ResumableDownload'] : false;
+    }
+
+    public function performdownloading() {
+        if ( $this->resumableDownload ) {
+            try {
+                if ( file_exists( $this->resumableTaskFile ) ) {
+                    $origin_content = file_get_contents( $this->resumableTaskFile );
+                    $this->resumableJsonLocal = json_decode( $origin_content, true );
+                    if ( $this->resumableJsonLocal == null ) {
+                        $this->resumableJsonLocal = [];
+                    } else if ( $this->resumableJsonLocal['LastModified'] != $this->resumableJson['LastModified'] ||
+                    $this->resumableJsonLocal['ContentLength'] != $this->resumableJson['ContentLength'] ||
+                    $this->resumableJsonLocal['ETag'] != $this->resumableJson['ETag'] ||
+                    $this->resumableJsonLocal['Crc64ecma'] != $this->resumableJson['Crc64ecma'] ) {
+                        $this->resumableDownload = false;
+                    }
+                }
+            } catch ( \Exception $e ) {
+                $this->resumableDownload = false;
+            }
+        }
+        try {
+            if ($this->resumableDownload) {
+                $this->fp = fopen( $this->saveAs, 'r+' );
+            } else {
+                $this->fp = fopen( $this->saveAs, 'wb' );
+            }
+            $rt = $this->donwloadParts();
+            $this->resumableJson['DownloadedBlocks'] = [];
+            if (file_exists( $this->resumableTaskFile )) {
+                unlink($this->resumableTaskFile);
+            }
+        } catch ( \Exception $e ) {
+            $this->fp_resume = fopen( $this->resumableTaskFile, 'wb' );
+            fwrite( $this->fp_resume, json_encode( $this->resumableJson ) );
+            fclose( $this->fp_resume );
+            throw ( $e );
+        }
+        finally {
+            fclose( $this->fp );
+        }
+        return $rt;
+    }
+
+    public function donwloadParts() {
+        $uploadRequests = function () {
+            $index = 1;
+            $partSize = 0;
+            for ( $offset = 0; $offset < $this->totalSize; ) {
+                $partSize = $this->partSize;
+                if ( $offset + $this->partSize >= $this->totalSize ) {
+                    $partSize = $this->totalSize - $offset;
+                }
+                $this->parts[$index]['PartSize'] = $partSize;
+                $this->parts[$index]['Offset'] = $offset;
+                $begin = $offset;
+                $end = $offset + $partSize - 1;
+                if ( !( $this->resumableDownload &&
+                isset( $this->resumableJsonLocal['DownloadedBlocks'] ) &&
+                in_array( ['from' => $begin, 'to' => $end], $this->resumableJsonLocal['DownloadedBlocks'] ) ) ) {
+                    $params = array(
+                        'Bucket' => $this->options['Bucket'],
+                        'Key' => $this->options['Key'],
+                        'Range' => sprintf( 'bytes=%d-%d', $begin, $end )
+                    );
+                    $command = $this->client->getCommand( 'getObject', $params );
+                    $request = $this->client->commandToRequestTransformer( $command );
+                    $index += 1;
+                    yield $request;
+                } else {
+                    $this->resumableJson['DownloadedBlocks'][] = ['from' => $begin, 'to' => $end];
+                    $this->downloadedSize += $partSize;
+                    call_user_func_array( $this->progress, [$this->totalSize, $this->downloadedSize] );
+                }
+                $offset += $partSize;
+            }
+
+        }
+        ;
+
+        $pool = new Pool( $this->client->httpClient, $uploadRequests(), [
+            'concurrency' => $this->concurrency,
+            'fulfilled' => function ( $response, $index ) {
+                $index = $index + 1;
+                $stream = $response->getBody();
+                $offset = $this->parts[$index]['Offset'];
+                $partsize = 8192;
+                $begin = $offset;
+                fseek( $this->fp, $offset );
+                while ( !$stream->eof() ) {
+                    $output = $stream->read( $partsize );
+                    $writeLen = fwrite( $this->fp, $output );
+                    $offset += $writeLen;
+                }
+                $end = $offset - 1;
+                $this->resumableJson['DownloadedBlocks'][] = ['from' => $begin, 'to' => $end];
+                $partSize = $this->parts[$index]['PartSize'];
+                $this->downloadedSize += $partSize;
+                call_user_func_array( $this->progress, [$this->totalSize, $this->downloadedSize] );
+            }
+            ,
+            'rejected' => function ( $reason, $index ) {
+                throw( $reason );
+            }
+        ] );
+        $promise = $pool->promise();
+        $promise->wait();
+    }
+
+}

+ 49 - 0
addons/cos/library/Qcloud/Cos/Request/BodyLocation.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace Qcloud\Cos\Request;
+
+use GuzzleHttp\Command\Guzzle\RequestLocation\AbstractLocation;
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\Parameter;
+use GuzzleHttp\Psr7;
+use Psr\Http\Message\MessageInterface;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Adds a raw/binary body to a request.
+ * This is here because: https://github.com/guzzle/guzzle-services/issues/160
+ */
+class BodyLocation extends AbstractLocation
+{
+
+    /**
+     * Set the name of the location
+     *
+     * @param string $locationName
+     */
+    public function __construct($locationName = 'body')
+    {
+        parent::__construct($locationName);
+    }
+
+    /**
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     * @param Parameter        $param
+     *
+     * @return MessageInterface
+     */
+    public function visit(
+        CommandInterface $command,
+        RequestInterface $request,
+        Parameter $param
+    ) {
+        $value = $request->getBody()->getContents();
+        if ('' !== $value) {
+            throw new \RuntimeException('Only one "body" location may exist per operation');
+        }
+        // binary string data from bound parameter
+        $value = $command[$param->getName()];
+        return $request->withBody(Psr7\Utils::streamFor($value));
+    }
+}

+ 260 - 0
addons/cos/library/Qcloud/Cos/ResultTransformer.php

@@ -0,0 +1,260 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Result;
+
+class ResultTransformer {
+    private $config;
+    private $operation;
+
+    public function __construct($config, $operation) {
+        $this->config = $config;
+        $this->operation = $operation;
+    }
+
+    public function writeDataToLocal(CommandInterface $command, RequestInterface $request, ResponseInterface $response) {
+        $action = $command->getName();
+        if ($action == "GetObject" || $action == "GetSnapshot" || $action == "ImageRepairProcess") {
+            if (isset($command['SaveAs'])) {
+                $fp = fopen($command['SaveAs'], "wb");
+                $stream = $response->getBody();
+                $offset = 0;
+                $partsize = 8192;
+                while (!$stream->eof()) {
+                    $output = $stream->read($partsize);
+                    fseek($fp, $offset);
+                    fwrite($fp, $output);
+                    $offset += $partsize;
+                }
+                fclose($fp);
+            }
+        }
+    }
+
+    public function metaDataTransformer(CommandInterface $command, ResponseInterface $response, Result $result) {
+        $headers = $response->getHeaders();
+        $metadata = array();
+        foreach ($headers as $key => $value) {
+            if (strpos($key, "x-cos-meta-") === 0) {
+                $metadata[substr($key, 11)] = $value[0];
+            }
+        }
+        if (!empty($metadata)) {
+            $result['Metadata'] = $metadata;
+        }
+        return $result;
+    }
+
+    public function extraHeadersTransformer(CommandInterface $command, RequestInterface $request, Result $result) {
+        if ($command['Key'] != null && $result['Key'] == null) {
+            $result['Key'] = $command['Key'];
+        }
+        if ($command['Bucket'] != null && $result['Bucket'] == null) {
+            $result['Bucket'] = $command['Bucket'];
+        }
+        $result['Location'] = $request->getHeader("Host")[0] .  $request->getUri()->getPath();
+        return $result;
+    }
+
+    public function selectContentTransformer(CommandInterface $command, Result $result) {
+        $action = $command->getName();
+        if ($action == "SelectObjectContent") {
+            $result['Data'] = $this->getSelectContents($result);
+        }
+        return $result;
+    }
+
+    public function ciContentInfoTransformer(CommandInterface $command, Result $result) {
+        $action = $command->getName();
+        if ($action == "ImageInfo" || $action == "ImageExif" || $action == "ImageAve" || $action == "GetPrivateM3U8") {
+            $length = intval($result['ContentLength']);
+            if($length > 0){
+                $result['Data'] = $this->geCiContentInfo($result, $length);
+            }
+        }
+
+        if ($action == "PutObject" && isset($command["PicOperations"]) &&  $command["PicOperations"]) {
+            $picOperations = json_decode($command["PicOperations"], true);
+            $picRuleSize = isset($picOperations['rules']) && is_array($picOperations['rules']) ? sizeof($picOperations['rules']) : 0;
+            $length = intval($result['ContentLength']);
+            if($length > 0){
+                $content = $this->geCiContentInfo($result, $length);
+                $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
+                $xmlData = json_decode(json_encode($obj),true);
+                if ($picRuleSize == 1 && isset($xmlData['ProcessResults']['Object'])){
+                    $tmp = $xmlData['ProcessResults']['Object'];
+                    unset($xmlData['ProcessResults']['Object']);
+                    $xmlData['ProcessResults']['Object'][] = $tmp;
+                }
+                $result['Data'] = $xmlData;
+            }
+        }
+
+        if ($action == "GetBucketGuetzli" ) {
+            $length = intval($result['ContentLength']);
+            if($length > 0){
+                $content = $this->geCiContentInfo($result, $length);
+                $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
+                $arr = json_decode(json_encode($obj),true);
+                $result['GuetzliStatus'] = isset($arr[0]) ? $arr[0] : '';
+            }
+        }
+
+        if ($action == "GetCiService" ) {
+            $length = intval($result['ContentLength']);
+            if($length > 0){
+                $content = $this->geCiContentInfo($result, $length);
+                $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
+                $arr = json_decode(json_encode($obj),true);
+                $result['CIStatus'] = isset($arr[0]) ? $arr[0] : '';
+                unset($result['Body']);
+            }
+        }
+
+        if ($action == "GetOriginProtect" ) {
+            $length = intval($result['ContentLength']);
+            if($length > 0){
+                $content = $this->geCiContentInfo($result, $length);
+                $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
+                $arr = json_decode(json_encode($obj),true);
+                $result['OriginProtectStatus'] = isset($arr[0]) ? $arr[0] : '';
+                unset($result['Body']);
+            }
+        }
+
+        if ($action == "GetHotLink" ) {
+            $length = intval($result['ContentLength']);
+            if($length > 0){
+                $content = $this->geCiContentInfo($result, $length);
+                $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
+                $arr = json_decode(json_encode($obj),true);
+                $result['Hotlink'] = $arr;
+                unset($result['Body']);
+            }
+        }
+
+        $xml2JsonActions = array(
+            'CreateMediaTranscodeJobs' => 1,
+            'CreateMediaJobs' => 1,
+            'DescribeMediaJob' => 1,
+            'DescribeMediaJobs' => 1,
+            'CreateMediaSnapshotJobs' => 1,
+            'CreateMediaConcatJobs' => 1,
+            'CreateMediaVoiceSeparateJobs' => 1,
+            'DescribeMediaVoiceSeparateJob' => 1,
+            'UpdateMediaQueue' => 1,
+            'CreateMediaSmartCoverJobs' => 1,
+            'CreateMediaVideoProcessJobs' => 1,
+            'CreateMediaVideoMontageJobs' => 1,
+            'CreateMediaAnimationJobs' => 1,
+            'CreateMediaPicProcessJobs' => 1,
+            'CreateMediaSegmentJobs' => 1,
+            'CreateMediaVideoTagJobs' => 1,
+            'CreateMediaSuperResolutionJobs' => 1,
+            'CreateMediaSDRtoHDRJobs' => 1,
+            'CreateMediaDigitalWatermarkJobs' => 1,
+            'CreateMediaExtractDigitalWatermarkJobs' => 1,
+            'OpticalOcrRecognition' => 1,
+            'GetWorkflowInstance' => 1,
+            'CreateMediaTranscodeTemplate' => 1,
+            'UpdateMediaTranscodeTemplate' => 1,
+            'CreateMediaHighSpeedHdTemplate' => 1,
+            'UpdateMediaHighSpeedHdTemplate' => 1,
+            'CreateMediaAnimationTemplate' => 1,
+            'UpdateMediaAnimationTemplate' => 1,
+            'CreateMediaConcatTemplate' => 1,
+            'UpdateMediaConcatTemplate' => 1,
+            'CreateMediaVideoProcessTemplate' => 1,
+            'UpdateMediaVideoProcessTemplate' => 1,
+            'CreateMediaVideoMontageTemplate' => 1,
+            'UpdateMediaVideoMontageTemplate' => 1,
+            'CreateMediaVoiceSeparateTemplate' => 1,
+            'UpdateMediaVoiceSeparateTemplate' => 1,
+            'CreateMediaSuperResolutionTemplate' => 1,
+            'UpdateMediaSuperResolutionTemplate' => 1,
+            'CreateMediaPicProcessTemplate' => 1,
+            'UpdateMediaPicProcessTemplate' => 1,
+            'CreateMediaWatermarkTemplate' => 1,
+            'UpdateMediaWatermarkTemplate' => 1,
+            'CreateInventoryTriggerJob' => 1,
+            'DescribeInventoryTriggerJobs' => 1,
+            'DescribeInventoryTriggerJob' => 1,
+            'CreateMediaNoiseReductionJobs' => 1,
+            'CreateMediaQualityEstimateJobs' => 1,
+            'CreateMediaStreamExtractJobs' => 1,
+        );
+        if (key_exists($action, $xml2JsonActions)) {
+            $length = intval($result['ContentLength']);
+            if($length > 0){
+                $content = $this->geCiContentInfo($result, $length);
+                $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
+                $xmlData = json_decode(json_encode($obj),true);
+                $result['Response'] = $xmlData;
+            }
+        }
+
+        return $result;
+    }
+
+    public function geCiContentInfo($result, $length) {
+        $f = $result['Body'];
+        $data = "";
+        while (!$f->eof()) {
+            $tmp = $f->read($length);
+            if (empty($tmp)) {
+                break;
+            }
+            $data .= $tmp;
+        }
+        return $data;
+    }
+
+    public function getSelectContents($result) {
+        $f = $result['RawData'];
+        while (!$f->eof()) {
+            $data = array();
+            $tmp = $f->read(4);
+            if (empty($tmp)) {
+                break;
+            }
+            $total_length = (int)(unpack("N", $tmp)[1]);
+            $headers_length = (int)(unpack("N", $f->read(4))[1]);
+            $body_length = $total_length - $headers_length - 16;
+            $predule_crc = (int)(unpack("N", $f->read(4))[1]);
+            $headers = array();
+            for ($offset = 0; $offset < $headers_length;) {
+                $key_length = (int)(unpack("C", $f->read(1))[1]);
+                $key = $f->read($key_length);
+    
+                $head_value_type = (int)(unpack("C", $f->read(1))[1]);
+    
+                $value_length = (int)(unpack("n", $f->read(2))[1]);
+                $value = $f->read($value_length);
+                $offset += 4 + $key_length + $value_length;
+                if ($key == ":message-type") {
+                    $data['MessageType'] = $value;
+                }
+                if ($key == ":event-type") {
+                    $data['EventType'] = $value;
+                }
+                if ($key == ":error-code") {
+                    $data['ErrorCode'] = $value;
+                }
+                if ($key == ":error-message") {
+                    $data['ErrorMessage'] = $value;
+                }
+            }
+            $body = $f->read($body_length);
+            $message_crc = (int)(unpack("N", $f->read(4))[1]);
+            $data['Body'] = $body;
+            yield $data;
+        }
+    }
+    public function __destruct() {
+    }
+
+}

+ 81 - 0
addons/cos/library/Qcloud/Cos/Serializer.php

@@ -0,0 +1,81 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use GuzzleHttp\Command\CommandInterface;
+use GuzzleHttp\Command\Guzzle\DescriptionInterface;
+use GuzzleHttp\Command\Guzzle\Serializer as DefaultSerializer;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Override Request serializer to modify authentication mechanism
+ */
+class Serializer extends DefaultSerializer
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct(
+        DescriptionInterface $description,
+        array $requestLocations = []
+    ) {
+        // Override Guzzle's body location as it isn't raw binary data
+        $requestLocations['body'] = new Request\BodyLocation;
+        parent::__construct($description, $requestLocations);
+    }
+    /**
+     * Authorization header is Loco's preferred authorization method.
+     * Add Authorization header to request if API key is set, unless query is explicitly configured as auth method.
+     * Unset key from command to avoid sending it as a query param.
+     *
+     * @override
+     *
+     * @param CommandInterface $command
+     * @param RequestInterface $request
+     *
+     * @return RequestInterface
+     *
+     * @throws \InvalidArgumentException
+     */
+    protected function prepareRequest(
+        CommandInterface $command,
+        RequestInterface $request
+    ) {
+		/*
+        if ($command->offsetExists('key') === true) {
+            $mode = empty($command->offsetGet('auth')) === false
+                    ? $command->offsetGet('auth')
+                    : 'loco';
+            if ($mode !== 'query') {
+                // else use Authorization header of various types
+                if ($mode === 'loco') {
+                    $value = 'Loco '.$command->offsetGet('key');
+                    $request = $request->withHeader('Authorization', $value);
+                } elseif ($mode === 'basic') {
+                    $value = 'Basic '.base64_encode($command->offsetGet('key').':');
+                    $request = $request->withHeader('Authorization', $value);
+                } else {
+                    throw new \InvalidArgumentException("Invalid auth type: {$mode}");
+                }
+                // avoid request sending key parameter in query string
+                $command->offsetUnset('key');
+            }
+        }
+        // Remap legacy parameters to common `data` binding on request body
+        static $remap = [
+            'import' => ['src'=>'data'],
+            'translate' => ['translation'=>'data'],
+        ];
+        $name = $command->getName();
+        if (isset($remap[$name])) {
+            foreach ($remap[$name] as $old => $new) {
+                if ($command->offsetExists($old)) {
+                    $command->offsetSet($new, $command->offsetGet($old));
+                    $command->offsetUnset($old);
+                }
+            }
+        }
+		*/
+        return parent::prepareRequest($command, $request);
+    }
+}

+ 7387 - 0
addons/cos/library/Qcloud/Cos/Service.php

@@ -0,0 +1,7387 @@
+<?php
+
+namespace Qcloud\Cos;
+
+/**
+ * @link http://guzzle3.readthedocs.io/webservice-client/guzzle-service-descriptions.html
+ */
+class Service {
+    public static function getService() {
+        return array(
+            'name' => 'Cos Service',
+            'apiVersion' => 'V5',
+            'description' => 'Cos V5 API Service',
+            'operations' => array(
+                // 舍弃一个分块上传且删除已上传的分片块
+                'AbortMultipartUpload' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'AbortMultipartUploadOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId'
+                        )
+                    )
+                ),
+                // 创建存储桶(Bucket)
+                'CreateBucket' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CreateBucketOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CreateBucketConfiguration')),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl'),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        )
+                    )
+                ),
+                // 完成整个分块上传
+                'CompleteMultipartUpload' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CompleteMultipartUploadOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CompleteMultipartUpload'
+                        )
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'Parts' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true),
+                            'items' => array(
+                                'name' => 'CompletedPart',
+                                'type' => 'object',
+                                'sentAs' => 'Part',
+                                'properties' => array(
+                                    'ETag' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'PartNumber' => array(
+                                        'type' => 'numeric'
+                                    )
+                                )
+                            )
+                        ),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId',
+                        ),
+                        'PicOperations' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Pic-Operations',
+                        )
+                    )
+                ),
+                // 初始化分块上传
+                'CreateMultipartUpload' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}{/Key*}?uploads',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CreateMultipartUploadOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CreateMultipartUploadRequest'
+                        )
+                    ),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        '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',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'Expires' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        '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-aws-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',
+                        )
+                    )
+                ),
+                // 复制对象
+                'CopyObject' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CopyObjectOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CopyObjectRequest',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        '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',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'CopySource' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source',
+                        ),
+                        'CopySourceIfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-match',
+                        ),
+                        'CopySourceIfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-modified-since',
+                        ),
+                        'CopySourceIfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-none-match',
+                        ),
+                        'CopySourceIfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-unmodified-since',
+                        ),
+                        'Expires' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'MetadataDirective' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-metadata-directive',
+                        ),
+                        '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',
+                        ),
+                        'CopySourceSSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-algorithm',
+                        ),
+                        'CopySourceSSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key',
+                        ),
+                        'CopySourceSSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key-MD5',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        )
+                    ),
+                ),
+                // 删除存储桶 (Bucket)
+                'DeleteBucket' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        )
+                    )
+                ),
+                // 删除跨域访问配置信息
+                'DeleteBucketCors' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?cors',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketCorsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                // 删除存储桶标签信息
+                'DeleteBucketTagging' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?tagging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketTaggingOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                // 删除存储桶标清单任务
+                'DeleteBucketInventory' => array(
+                    'httpMethod' => 'Delete',
+                    'uri' => '/{Bucket}?inventory',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketInventoryOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Id' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'id',
+                        )
+                    ),
+                ),
+                // 删除 COS 上单个对象
+                'DeleteObject' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteObjectOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'MFA' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-mfa',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        )
+                    )
+                ),
+                // 批量删除 COS 对象
+                'DeleteObjects' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}?delete',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteObjectsOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'Delete',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Objects' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'sentAs' => 'Object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                        'minLength' => 1,
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Quiet' => array(
+                            'type' => 'boolean',
+                            'format' => 'boolean-string',
+                            'location' => 'xml',
+                        ),
+                        'MFA' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-mfa',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        )
+                    ),
+                ),
+                // 删除存储桶(Bucket)的website
+                'DeleteBucketWebsite' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?website',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketWebsiteOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                // 删除存储桶(Bucket)的生命周期配置
+                'DeleteBucketLifecycle' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?lifecycle',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketLifecycleOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                // 删除跨区域复制配置
+                'DeleteBucketReplication' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?replication',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketReplicationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                // 配置对象标签
+                'PutObjectTagging' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}?tagging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutObjectTaggingOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'Tagging',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'TagSet' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'name' => 'TagRule',
+                                'type' => 'object',
+                                'sentAs' => 'Tag',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Value' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                // 获取对象标签信息
+                'GetObjectTagging' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?tagging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetObjectTaggingOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        )
+                    ),
+                ),
+                // 删除对象标签
+                'DeleteObjectTagging' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}{/Key*}?tagging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteObjectTaggingOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        )
+                    )
+                ),
+                // 下载对象
+                'GetObject' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetObjectOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        ),
+                        'IfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-Match'
+                        ),
+                        'IfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer'
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Modified-Since'
+                        ),
+                        'IfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-None-Match'
+                        ),
+                        'IfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer'
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Unmodified-Since'
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'Range' => array(
+                            'type' => 'string',
+                            'location' => 'header'),
+                        'ResponseCacheControl' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-cache-control'
+                        ),
+                        'ResponseContentDisposition' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-disposition'
+                        ),
+                        'ResponseContentEncoding' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-encoding'
+                        ),
+                        'ResponseContentLanguage' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-language'
+                        ),
+                        'ResponseContentType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-type'
+                        ),
+                        'ResponseExpires' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer'
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'query',
+                            'sentAs' => 'response-expires'
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        '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',
+                        ),
+                        'TrafficLimit' => array(
+                            'type' => 'integer',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-traffic-limit',
+                        )
+                    )
+                ),
+                // 获取 COS 对象的访问权限信息(Access Control List, ACL)
+                'GetObjectAcl' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetObjectAclOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        )
+                    )
+                ),
+                // 获取存储桶(Bucket)的访问权限信息(Access Control List, ACL)
+                'GetBucketAcl' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketAclOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        )
+                    )
+                ),
+                // 查询存储桶(Bucket)跨域访问配置信息
+                'GetBucketCors' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?cors',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketCorsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 查询存储桶(Bucket)Domain配置信息
+                'GetBucketDomain' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?domain',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketDomainOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 查询存储桶(Bucket)Accelerate配置信息
+                'GetBucketAccelerate' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?accelerate',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketAccelerateOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 查询存储桶(Bucket)Website配置信息
+                'GetBucketWebsite' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?website',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketWebsiteOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 查询存储桶(Bucket)的生命周期配置
+                'GetBucketLifecycle' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?lifecycle',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketLifecycleOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 获取存储桶(Bucket)版本控制信息
+                'GetBucketVersioning' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?versioning',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketVersioningOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 获取存储桶(Bucket)跨区域复制配置信息
+                'GetBucketReplication' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?replication',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketReplicationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 获取存储桶(Bucket)所在的地域信息
+                'GetBucketLocation' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?location',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketLocationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                // 获取存储桶(Bucket)Notification信息
+                'GetBucketNotification' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?notification',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketNotificationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 获取存储桶(Bucket)日志信息
+                'GetBucketLogging' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?logging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketLoggingOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 获取存储桶(Bucket)清单信息
+                'GetBucketInventory' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?inventory',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketInventoryOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Id' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'id',
+                        )
+                    ),
+                ),
+                // 获取存储桶(Bucket)标签信息
+                'GetBucketTagging' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?tagging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketTaggingOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        )
+                    ),
+                ),
+                // 分块上传
+                'UploadPart' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'UploadPartOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'UploadPartRequest'
+                        )
+                    ),
+                    'parameters' => array(
+                        'Body' => array(
+                            'type' => array(
+                                'any'),
+                            'location' => 'body'
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length'
+                        ),
+                        'ContentMD5' => array(
+                            'type' => array(
+                                'boolean'
+                            ),
+                            'location' => 'header',
+                            'sentAs' => 'Content-MD5'
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'PartNumber' => array(
+                            'required' => true,
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'partNumber'),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId'),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        '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',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'TrafficLimit' => array(
+                            'type' => 'integer',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-traffic-limit',
+                        )
+                    )
+                ),
+                // 上传对象
+                'PutObject' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutObjectOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'PutObjectRequest'
+                        )
+                    ),
+                    'parameters' => array(
+                        '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',
+                        ),
+                        'Tagging' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-tagging',
+                        ),
+                    )
+                ),
+                // 追加对象
+                '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)
+                'PutObjectAcl' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutObjectAclOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'AccessControlPolicy',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'name' => 'Grant',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'),
+                                            'ID' => array(
+                                                'type' => 'string'),
+                                            'Type' => array(
+                                                'type' => 'string',
+                                                'sentAs' => 'xsi:type',
+                                                'data' => array(
+                                                    'xmlAttribute' => true,
+                                                    'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance')),
+                                            'URI' => array(
+                                                'type' => 'string') )),
+                                    'Permission' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWrite' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        ),
+                    )
+                ),
+                // 设置存储桶(Bucket)的访问权限(Access Control List, ACL)
+                'PutBucketAcl' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketAclOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'AccessControlPolicy',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'name' => 'Grant',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'EmailAddress' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Type' => array(
+                                                'required' => true,
+                                                'type' => 'string',
+                                                'sentAs' => 'xsi:type',
+                                                'data' => array(
+                                                    'xmlAttribute' => true,
+                                                    'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance',
+                                                ),
+                                            ),
+                                            'URI' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Permission' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWrite' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        ),
+                    ),
+                ),
+                // 设置存储桶(Bucket)的跨域配置信息
+                'PutBucketCors' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?cors',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketCorsOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CORSConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CORSRules' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CORSRule',
+                                'type' => 'object',
+                                'sentAs' => 'CORSRule',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'AllowedHeaders' => array(
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedHeader',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedHeader',
+                                        ),
+                                    ),
+                                    'AllowedMethods' => array(
+                                        'required' => true,
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedMethod',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedMethod',
+                                        ),
+                                    ),
+                                    'AllowedOrigins' => array(
+                                        'required' => true,
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedOrigin',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedOrigin',
+                                        ),
+                                    ),
+                                    'ExposeHeaders' => array(
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'ExposeHeader',
+                                            'type' => 'string',
+                                            'sentAs' => 'ExposeHeader',
+                                        ),
+                                    ),
+                                    'MaxAgeSeconds' => array(
+                                        'type' => 'numeric',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                // 设置存储桶(Bucket)的Domain信息
+                'PutBucketDomain' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?domain',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketDomainOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'DomainConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'DomainRules' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'DomainRule',
+                                'type' => 'object',
+                                'sentAs' => 'DomainRule',
+                                'properties' => array(
+                                    'Status' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Name' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Type' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'ForcedReplacement' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                // 设置存储桶(Bucket)生命周期配置
+                'PutBucketLifecycle' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?lifecycle',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketLifecycleOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'LifecycleConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Rules' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'Rule',
+                                'type' => 'object',
+                                'sentAs' => 'Rule',
+                                'properties' => array(
+                                    'Expiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Date' => array(
+                                                'type' => array(
+                                                    'object',
+                                                    'string',
+                                                    'integer',
+                                                ),
+                                                'format' => 'date-time',
+                                            ),
+                                            'Days' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'require' => true,
+                                        'properties' => array(
+                                            'Prefix' => array(
+                                                'type' => 'string',
+                                                'require' => true,
+                                            ),
+                                            'Tag' => array(
+                                                'type' => 'object',
+                                                'require' => true,
+                                                'properties' => array(
+                                                    'Key' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                    'filters' => array(
+                                                        'Qcloud\\Cos\\Client::explodeKey'),
+                                                    'Value' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                )
+                                            )
+                                        ),
+                                    ),
+                                    'Status' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Transitions' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'Transition',
+                                            'type' => 'object',
+                                            'sentAs' => 'Transition',
+                                            'properties' => array(
+                                                'Date' => array(
+                                                    'type' => array(
+                                                        'object',
+                                                        'string',
+                                                        'integer',
+                                                    ),
+                                                    'format' => 'date-time',
+                                                ),
+                                                'Days' => array(
+                                                    'type' => 'numeric',
+                                                ),
+                                                'StorageClass' => array(
+                                                    'type' => 'string',
+                                                )))),
+                                    'NoncurrentVersionTransition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'NoncurrentVersionExpiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                // 存储桶(Bucket)版本控制
+                'PutBucketVersioning' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?versioning',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketVersioningOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'VersioningConfiguration',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'MFA' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-mfa',
+                        ),
+                        'MFADelete' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                            'sentAs' => 'MfaDelete',
+                        ),
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                    ),
+                ),
+                // 配置存储桶(Bucket)Accelerate
+                'PutBucketAccelerate' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?accelerate',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketAccelerateOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'AccelerateConfiguration',
+                        ),
+                        'xmlAllowEmpty' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Status' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        )
+                    ),
+                ),
+                // 配置存储桶(Bucket)website
+                'PutBucketWebsite' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?website',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketWebsiteOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'WebsiteConfiguration',
+                        ),
+                        'xmlAllowEmpty' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'ErrorDocument' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Key' => array(
+                                    'type' => 'string',
+                                    'minLength' => 1,
+                                ),
+                            ),
+                        ),
+                        'IndexDocument' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Suffix' => array(
+                                    'required' => true,
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'RedirectAllRequestsTo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HostName' => array(
+                                    'type' => 'string',
+                                ),
+                                'Protocol' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'RoutingRules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'name' => 'RoutingRule',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Condition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'HttpErrorCodeReturnedEquals' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'KeyPrefixEquals' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Redirect' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'HostName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'HttpRedirectCode' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Protocol' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ReplaceKeyPrefixWith' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ReplaceKeyWith' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                // 配置存储桶(Bucket)跨区域复制
+                'PutBucketReplication' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?replication',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketReplicationOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'ReplicationConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Role' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Rules' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'ReplicationRule',
+                                'type' => 'object',
+                                'sentAs' => 'Rule',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Prefix' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Status' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Destination' => array(
+                                        'required' => true,
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Bucket' => array(
+                                                'required' => true,
+                                                'type' => 'string',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                // 设置存储桶(Bucket)的回调设置
+                'PutBucketNotification' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?notification',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketNotificationOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'NotificationConfiguration',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CloudFunctionConfigurations' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CloudFunctionConfiguration',
+                                'type' => 'object',
+                                'sentAs' => 'CloudFunctionConfiguration',
+                                'properties' => array(
+                                    'Id' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'CloudFunction' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                        'sentAs' => 'CloudFunction',
+                                    ),
+                                    'Events' => array(
+                                        'required' => true,
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'Event',
+                                            'type' => 'string',
+                                            'sentAs' => 'Event',
+                                        ),
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Key' => array(
+                                                'type' => 'object',
+                                                'sentAs' => 'Key',
+                                                'properties' => array(
+                                                    'FilterRules' => array(
+                                                        'type' => 'array',
+                                                        'data' => array(
+                                                            'xmlFlattened' => true,
+                                                        ),
+                                                        'items' => array(
+                                                            'name' => 'FilterRule',
+                                                            'type' => 'object',
+                                                            'sentAs' => 'FilterRule',
+                                                            'properties' => array(
+                                                                'Name' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                                'Value' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'filters' => array(
+                                                'Qcloud\\Cos\\Client::explodeKey')
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                // 配置存储桶(Bucket)标签
+                'PutBucketTagging' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?tagging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketTaggingOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'Tagging',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'TagSet' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'name' => 'TagRule',
+                                'type' => 'object',
+                                'sentAs' => 'Tag',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Value' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                //开启存储桶(Bucket)日志服务
+                'PutBucketLogging' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?logging',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketLoggingOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'BucketLoggingStatus',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'LoggingEnabled' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'TargetBucket' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'TargetPrefix' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                            )
+                        ),
+                    ),
+                ),
+                // 配置存储桶(Bucket)清单
+                'PutBucketInventory' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?inventory',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketInventoryOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'InventoryConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Id' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'IsEnabled' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Destination' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'COSBucketDestination'=> array(
+                                    'type' => 'object',
+                                    'properties' => array(
+                                        'Format' => array(
+                                            'type' => 'string',
+                                            'require' => true,
+                                        ),
+                                        'AccountId' => array(
+                                            'type' => 'string',
+                                            'require' => true,
+                                        ),
+                                        'Bucket' => array(
+                                            'type' => 'string',
+                                            'require' => true,
+                                        ),
+                                        'Prefix' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Encryption' => array(
+                                            'type' => 'object',
+                                            'properties' => array(
+                                                'SSE-COS' => array(
+                                                    'type' => 'string',
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Schedule' => array(
+                            'required' => true,
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Frequency' => array(
+                                    'type' => 'string',
+                                    'require' => true,
+                                ),
+                            )
+                        ),
+                        'Filter' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Prefix' => array(
+                                    'type' => 'string',
+                                ),
+                            )
+                        ),
+                        'IncludedObjectVersions' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'OptionalFields' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'name' => 'Fields',
+                                'type' => 'string',
+                                'sentAs' => 'Field',
+                            ),
+                        ),
+                    ),
+                ),
+                // 回热归档对象
+                'RestoreObject' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}{/Key*}?restore',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'RestoreObjectOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'RestoreRequest',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'Days' => array(
+                            'required' => true,
+                            'type' => 'numeric',
+                            'location' => 'xml',
+                        ),
+                        'CASJobParameters' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Tier' => array(
+                                    'type' => 'string',
+                                    'required' => true,
+                                ),
+                            ),
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                    ),
+                ),
+                // 查询存储桶(Bucket)中正在进行中的分块上传对象
+                'ListParts' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListPartsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'MaxParts' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-parts'),
+                        'PartNumberMarker' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'part-number-marker'
+                        ),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId'
+                        )
+                    )
+                ),
+                // 查询存储桶(Bucket)下的部分或者全部对象
+                'ListObjects' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListObjectsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'delimiter'
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'encoding-type'
+                        ),
+                        'Marker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'marker'
+                        ),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-keys'
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'prefix'
+                        )
+                    )
+                ),
+                // 获取所属账户的所有存储空间列表
+                'ListBuckets' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListBucketsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                    ),
+                ),
+                // 获取多版本对象
+                'ListObjectVersions' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?versions',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListObjectVersionsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'delimiter',
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'encoding-type',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'key-marker',
+                        ),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-keys',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'prefix',
+                        ),
+                        'VersionIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'version-id-marker',
+                        )
+                    ),
+                ),
+                // 获取已上传分块列表
+                'ListMultipartUploads' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?uploads',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListMultipartUploadsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'delimiter',
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'encoding-type',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'key-marker',
+                        ),
+                        'MaxUploads' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-uploads',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'prefix',
+                        ),
+                        'UploadIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'upload-id-marker',
+                        )
+                    ),
+                ),
+                // 获取清单列表
+                'ListBucketInventoryConfigurations' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?inventory',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListBucketInventoryConfigurationsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        ),
+                        'ContinuationToken' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'continuation-token',
+                        ),
+                    ),
+                ),
+                // 获取对象的meta信息
+                'HeadObject' => array(
+                    'httpMethod' => 'HEAD',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'HeadObjectOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'IfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-Match',
+                        ),
+                        'IfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Modified-Since',
+                        ),
+                        'IfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-None-Match',
+                        ),
+                        'IfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Unmodified-Since',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'Range' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        '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',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                    )
+                ),
+                // 存储桶(Bucket)是否存在
+                'HeadBucket' => array(
+                    'httpMethod' => 'HEAD',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'HeadBucketOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    )
+                ),
+                // 分块copy
+                'UploadPartCopy' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'UploadPartCopyOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'UploadPartCopyRequest',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CopySource' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source',
+                        ),
+                        'CopySourceIfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-match',
+                        ),
+                        'CopySourceIfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-modified-since',
+                        ),
+                        'CopySourceIfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-none-match',
+                        ),
+                        'CopySourceIfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-unmodified-since',
+                        ),
+                        'CopySourceRange' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-range',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'PartNumber' => array(
+                            'required' => true,
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'partNumber',
+                        ),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId',
+                        ),
+                        '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',
+                        ),
+                        'CopySourceSSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-algorithm',
+                        ),
+                        'CopySourceSSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key',
+                        ),
+                        'CopySourceSSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key-MD5',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        )
+                    ),
+                ),
+                // 检索对象内容
+                'SelectObjectContent' => array(
+                    'httpMethod' => 'Post',
+                    'uri' => '/{/Key*}?select&select-type=2',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'SelectObjectContentOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'SelectRequest',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'Expression' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'ExpressionType' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'InputSerialization' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'CompressionType' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'CSV' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'FileHeaderInfo' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'RecordDelimiter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'FieldDelimiter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'QuoteCharacter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'QuoteEscapeCharacter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'Comments' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'AllowQuotedRecordDelimiter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                    )
+                                ),
+                                'JSON' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'Type' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        )
+                                    )
+                                ),
+                            )
+                        ),
+                        'OutputSerialization' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'CompressionType' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'CSV' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'QuoteFields' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'RecordDelimiter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'FieldDelimiter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'QuoteCharacter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                        'QuoteEscapeCharacter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        ),
+                                    )
+                                ),
+                                'JSON' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'RecordDelimiter' => array(
+                                            'type' => 'string',
+                                            'location' => 'xml',
+                                        )
+                                    )
+                                ),
+                            )
+                        ),
+                        'RequestProgress' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'Enabled' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                            )
+                        ),
+                    ),
+                ),
+                // 存储桶(Bucket)开启智能分层
+                'PutBucketIntelligentTiering' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?intelligenttiering',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketIntelligentTieringOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'IntelligentTieringConfiguration',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Transition' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'Days' => array(
+                                    'type' => 'integer',
+                                    'location' => 'xml',
+                                ),
+                                'RequestFrequent' => array(
+                                    'type' => 'integer',
+                                    'location' => 'xml',
+                                ),
+                            )
+                        ),
+                    ),
+                ),
+                // 查询存储桶(Bucket)智能分层
+                'GetBucketIntelligentTiering' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?intelligenttiering',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketIntelligentTieringOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                //万象-获取图片基本信息
+                'ImageInfo' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?imageInfo',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ImageInfoOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                    )
+                ),
+                //万象-获取图片EXIF信息
+                'ImageExif' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?exif',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ImageExifOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                    )
+                ),
+                //万象-获取图片主色调信息
+                'ImageAve' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?imageAve',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ImageAveOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                    ),
+                ),
+                //万象-云上数据处理
+                'ImageProcess' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}{/Key*}?image_process',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ImageProcessOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'PicOperations' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Pic-Operations',
+                        ),
+                    ),
+                ),
+                //万象-二维码下载时识别
+                'Qrcode' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?ci-process=QRcode',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'QrcodeOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'Cover' => array(
+                            'type' => 'integer',
+                            'location' => 'query',
+                            'sentAs' => 'cover'
+                        ),
+                    ),
+                ),
+                //万象-二维码生成
+                'QrcodeGenerate' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?ci-process=qrcode-generate',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'QrcodeGenerateOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'QrcodeContent' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'qrcode-content'
+                        ),
+                        'QrcodeMode' => array(
+                            'type' => 'integer',
+                            'location' => 'query',
+                            'sentAs' => 'mode'
+                        ),
+                        'QrcodeWidth' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'width'
+                        ),
+                    ),
+                ),
+                //万象-图片标签
+                'DetectLabel' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?ci-process=detect-label',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DetectLabelOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                    ),
+                ),
+                //万象-增加样式
+                'PutBucketImageStyle' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?style',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketImageStyleOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'AddStyle',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'StyleName' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'StyleBody' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                //万象-查询样式
+                'GetBucketImageStyle' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?style',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketImageStyleOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'GetStyle',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'StyleName' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                    ),
+                ),
+                //万象-删除样式
+                'DeleteBucketImageStyle' => array(
+                    'httpMethod' => 'Delete',
+                    'uri' => '/{Bucket}?style',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketImageStyleOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'DeleteStyle',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'StyleName' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                //万象-开通Guetzli压缩
+                'PutBucketGuetzli' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?guetzli',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketGuetzliOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                //万象-查询Guetzli状态
+                'GetBucketGuetzli' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?guetzli',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketGuetzliOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                //万象-关闭Guetzli压缩
+                'DeleteBucketGuetzli' => array(
+                    'httpMethod' => 'Delete',
+                    'uri' => '/{Bucket}?guetzli',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketGuetzliOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                //图片审核
+                'GetObjectSensitiveContentRecognition' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetObjectSensitiveContentRecognitionOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'ci-process' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query'
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'DetectType' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'detect-type'
+                        ),
+                        'DetectUrl' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'detect-url'
+                        ),
+                        'Interval' => array(
+                            'type' => 'integer',
+                            'location' => 'query',
+                            'sentAs' => 'interval'
+                        ),
+                        'MaxFrames' => array(
+                            'type' => 'integer',
+                            'location' => 'query',
+                            'sentAs' => 'max-frames'
+                        ),
+                        'BizType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'biz-type'
+                        )
+                    ),
+                ),
+                // 文本审核
+                'DetectText' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}text/auditing',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DetectTextOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'Request',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Input' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'Content' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'Object' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'Url' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'DataId' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'UserInfo' => array(
+                                    'location' => 'xml',
+                                    'type' => 'object',
+                                    'properties' => array(
+                                        'TokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Nickname' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'DeviceId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'AppId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Room' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'IP' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Type' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Gender' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Level' => array( 'type' => 'string', 'location' => 'xml', ),
+                                        'Role' => array( 'type' => 'string', 'location' => 'xml', ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Conf' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'DetectType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'Callback' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'BizType' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'CallbackVersion' => array( 'type' => 'string', 'location' => 'xml', ),
+                                'CallbackType' => array( 'type' => 'integer', 'location' => 'xml', ),
+                            ),
+                        ),
+                    ),
+                ),
+                //媒体截图
+                'GetSnapshot' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetSnapshotOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'Time' => array(
+                            'required' => true,
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'time'
+                        ),
+                        'ci-process' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query'
+                        ),
+                        'Width' => array(
+                            'type' => 'integer',
+                            'location' => 'query',
+                            'sentAs' => 'width'
+                        ),
+                        'Height' => array(
+                            'type' => 'integer',
+                            'location' => 'query',
+                            'sentAs' => 'height'
+                        ),
+                        'Format' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'format'
+                        ),
+                        'Rotate' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'rotate'
+                        ),
+                        'Mode' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'mode'
+                        )
+                    ),
+                ),
+                //添加防盗链
+                'PutBucketReferer' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?referer',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketRefererOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'RefererConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Status' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'RefererType' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'EmptyReferConfiguration' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+
+                        'DomainList' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'Domains' => array(
+                                    'type' => 'array',
+                                    'data' => array(
+                                        'xmlFlattened' => true,
+                                    ),
+                                    'items' => array(
+                                        'name' => 'Domain',
+                                        'type' => 'string',
+                                        'sentAs' => 'Domain',
+                                    ),
+                                )
+                            )
+                        ),
+                    ),
+                ),
+                //获取防盗链规则
+                'GetBucketReferer' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?referer',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketRefererOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'RefererConfiguration',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'
+                        )
+                    )
+                ),
+                //获取媒体信息
+                'GetMediaInfo' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetMediaInfoOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey'
+                            )
+                        ),
+                        'ci-process' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query'
+                        )
+                    ),
+                ),
+                'CreateMediaTranscodeJobs' => Descriptions::CreateMediaTranscodeJobs(), // 媒体转码
+                'CreateMediaJobs' => Descriptions::CreateMediaJobs(), // 媒体任务
+                'DescribeMediaJob' => Descriptions::DescribeMediaJob(), // 查询指定的媒体任务
+                'DescribeMediaJobs' => Descriptions::DescribeMediaJobs(), // 拉取拉取符合条件的媒体任务
+                'CreateMediaSnapshotJobs' => Descriptions::CreateMediaSnapshotJobs(), // 媒体截图
+                'CreateMediaConcatJobs' => Descriptions::CreateMediaConcatJobs(), // 媒体拼接
+                'DetectAudio' => Descriptions::DetectAudio(), // 音频审核
+                'GetDetectAudioResult' => Descriptions::GetDetectAudioResult(), // 主动获取音频审核结果
+                'GetDetectTextResult' => Descriptions::GetDetectTextResult(), // 主动获取文本文件审核结果
+                'DetectVideo' => Descriptions::DetectVideo(), // 视频审核
+                'GetDetectVideoResult' => Descriptions::GetDetectVideoResult(), // 主动获取视频审核结果
+                'DetectDocument' => Descriptions::DetectDocument(), // 文档审核
+                'GetDetectDocumentResult' => Descriptions::GetDetectDocumentResult(), // 主动获取文档审核结果
+                'CreateDocProcessJobs' => Descriptions::CreateDocProcessJobs(), // 提交文档转码任务
+                'DescribeDocProcessQueues' => Descriptions::DescribeDocProcessQueues(), // 查询文档转码队列
+                'DescribeDocProcessJob' => Descriptions::DescribeDocProcessJob(), // 查询文档转码任务
+                'GetDescribeDocProcessJobs' => Descriptions::GetDescribeDocProcessJobs(), // 拉取符合条件的文档转码任务
+                'DetectImage' => Descriptions::DetectImage(), // 图片审核
+                'DetectImages' => Descriptions::DetectImages(), // 图片审核-批量
+                'DetectVirus' => Descriptions::DetectVirus(), // 云查毒
+                'GetDetectVirusResult' => Descriptions::GetDetectVirusResult(), // 查询病毒检测任务结果
+                'GetDetectImageResult' => Descriptions::GetDetectImageResult(), // 主动获取图片审核结果
+                'CreateMediaVoiceSeparateJobs' => Descriptions::CreateMediaVoiceSeparateJobs(), // 提交人声分离任务
+                'DescribeMediaVoiceSeparateJob' => Descriptions::DescribeMediaVoiceSeparateJob(), // 查询指定的人声分离任务
+                'DetectWebpage' => Descriptions::DetectWebpage(), // 提交网页审核任务
+                'GetDetectWebpageResult' => Descriptions::GetDetectWebpageResult(), // 查询网页审核任务结果
+                'DescribeMediaBuckets' => Descriptions::DescribeMediaBuckets(), // 查询媒体处理开通状态
+                'GetPrivateM3U8' => Descriptions::GetPrivateM3U8(), // 获取私有 M3U8 ts 资源的下载授权
+                'DescribeMediaQueues' => Descriptions::DescribeMediaQueues(), // 搜索媒体处理队列
+                'UpdateMediaQueue' => Descriptions::UpdateMediaQueue(), // 更新媒体处理队列
+                'CreateMediaSmartCoverJobs' => Descriptions::CreateMediaSmartCoverJobs(), // 提交智能封面任务
+                'CreateMediaVideoProcessJobs' => Descriptions::CreateMediaVideoProcessJobs(), // 提交视频增强任务
+                'CreateMediaVideoMontageJobs' => Descriptions::CreateMediaVideoMontageJobs(), // 提交精彩集锦任务
+                'CreateMediaAnimationJobs' => Descriptions::CreateMediaAnimationJobs(), // 提交动图任务
+                'CreateMediaPicProcessJobs' => Descriptions::CreateMediaPicProcessJobs(), // 提交图片处理任务
+                'CreateMediaSegmentJobs' => Descriptions::CreateMediaSegmentJobs(), // 提交转封装任务
+                'CreateMediaVideoTagJobs' => Descriptions::CreateMediaVideoTagJobs(), // 提交视频标签任务
+                'CreateMediaSuperResolutionJobs' => Descriptions::CreateMediaSuperResolutionJobs(), // 提交超分辨率任务
+                'CreateMediaSDRtoHDRJobs' => Descriptions::CreateMediaSDRtoHDRJobs(), // 提交 SDR to HDR 任务
+                'CreateMediaDigitalWatermarkJobs' => Descriptions::CreateMediaDigitalWatermarkJobs(), // 嵌入数字水印任务(添加水印)
+                'CreateMediaExtractDigitalWatermarkJobs' => Descriptions::CreateMediaExtractDigitalWatermarkJobs(), // 提取数字水印任务(提取水印)
+                'DetectLiveVideo' => Descriptions::DetectLiveVideo(), // 直播流审核
+                'CancelLiveVideoAuditing' => Descriptions::CancelLiveVideoAuditing(), // 取消直播流审核
+                'OpticalOcrRecognition' => Descriptions::OpticalOcrRecognition(), // 通用文字识别
+                'TriggerWorkflow' => Descriptions::TriggerWorkflow(), // 手动触发工作流
+                'GetWorkflowInstances' => Descriptions::GetWorkflowInstances(), // 获取工作流实例列表
+                'GetWorkflowInstance' => Descriptions::GetWorkflowInstance(), // 获取工作流实例详情
+                'CreateMediaSnapshotTemplate' => Descriptions::CreateMediaSnapshotTemplate(), // 新增截图模板
+                'UpdateMediaSnapshotTemplate' => Descriptions::UpdateMediaSnapshotTemplate(), // 更新截图模板
+                'CreateMediaTranscodeTemplate' => Descriptions::CreateMediaTranscodeTemplate(), // 新增转码模板
+                'UpdateMediaTranscodeTemplate' => Descriptions::UpdateMediaTranscodeTemplate(), // 更新转码模板
+                'CreateMediaHighSpeedHdTemplate' => Descriptions::CreateMediaHighSpeedHdTemplate(), // 新增极速高清转码模板
+                'UpdateMediaHighSpeedHdTemplate' => Descriptions::UpdateMediaHighSpeedHdTemplate(), // 更新极速高清转码模板
+                'CreateMediaAnimationTemplate' => Descriptions::CreateMediaAnimationTemplate(), // 新增动图模板
+                'UpdateMediaAnimationTemplate' => Descriptions::UpdateMediaAnimationTemplate(), // 更新动图模板
+                'CreateMediaConcatTemplate' => Descriptions::CreateMediaConcatTemplate(), // 新增拼接模板
+                'UpdateMediaConcatTemplate' => Descriptions::UpdateMediaConcatTemplate(), // 更新拼接模板
+                'CreateMediaVideoProcessTemplate' => Descriptions::CreateMediaVideoProcessTemplate(), // 新增视频增强模板
+                'UpdateMediaVideoProcessTemplate' => Descriptions::UpdateMediaVideoProcessTemplate(), // 更新视频增强模板
+                'CreateMediaVideoMontageTemplate' => Descriptions::CreateMediaVideoMontageTemplate(), // 新增精彩集锦模板
+                'UpdateMediaVideoMontageTemplate' => Descriptions::UpdateMediaVideoMontageTemplate(), // 更新精彩集锦模板
+                'CreateMediaVoiceSeparateTemplate' => Descriptions::CreateMediaVoiceSeparateTemplate(), // 新增人声分离模板
+                'UpdateMediaVoiceSeparateTemplate' => Descriptions::UpdateMediaVoiceSeparateTemplate(), // 更新人声分离模板
+                'CreateMediaSuperResolutionTemplate' => Descriptions::CreateMediaSuperResolutionTemplate(), // 新增超分辨率模板
+                'UpdateMediaSuperResolutionTemplate' => Descriptions::UpdateMediaSuperResolutionTemplate(), // 更新超分辨率模板
+                'CreateMediaPicProcessTemplate' => Descriptions::CreateMediaPicProcessTemplate(), // 新增图片处理模板
+                'UpdateMediaPicProcessTemplate' => Descriptions::UpdateMediaPicProcessTemplate(), // 更新图片处理模板
+                'CreateMediaWatermarkTemplate' => Descriptions::CreateMediaWatermarkTemplate(), // 新增水印模板
+                'UpdateMediaWatermarkTemplate' => Descriptions::UpdateMediaWatermarkTemplate(), // 更新水印模板
+                'DescribeMediaTemplates' => Descriptions::DescribeMediaTemplates(), // 查询模板列表
+                'DescribeWorkflow' => Descriptions::DescribeWorkflow(), // 搜索工作流
+                'DeleteWorkflow' => Descriptions::DeleteWorkflow(), // 删除工作流
+                'CreateInventoryTriggerJob' => Descriptions::CreateInventoryTriggerJob(), // 触发批量存量任务
+                'DescribeInventoryTriggerJobs' => Descriptions::DescribeInventoryTriggerJobs(), // 批量拉取存量任务
+                'DescribeInventoryTriggerJob' => Descriptions::DescribeInventoryTriggerJob(), // 查询存量任务
+                'CancelInventoryTriggerJob' => Descriptions::CancelInventoryTriggerJob(), // 取消存量任务
+                'CreateMediaNoiseReductionJobs' => Descriptions::CreateMediaNoiseReductionJobs(), // 提交音频降噪任务
+                'ImageRepairProcess' => Descriptions::ImageRepairProcess(), // 图片水印修复
+                'ImageDetectCarProcess' => Descriptions::ImageDetectCarProcess(), // 车辆车牌检测
+                'ImageAssessQualityProcess' => Descriptions::ImageAssessQualityProcess(), // 图片质量评估
+                'ImageSearchOpen' => Descriptions::ImageSearchOpen(), // 开通以图搜图
+                'ImageSearchAdd' => Descriptions::ImageSearchAdd(), // 添加图库图片
+                'ImageSearch' => Descriptions::ImageSearch(), // 图片搜索接口
+                'ImageSearchDelete' => Descriptions::ImageSearchDelete(), // 图片搜索接口
+                'BindCiService' => Descriptions::BindCiService(), // 绑定数据万象服务
+                'GetCiService' => Descriptions::GetCiService(), // 查询数据万象服务
+                'UnBindCiService' => Descriptions::UnBindCiService(), // 解绑数据万象服务
+                'GetHotLink' => Descriptions::GetHotLink(), // 查询防盗链
+                'AddHotLink' => Descriptions::AddHotLink(), // 查询防盗链
+                'OpenOriginProtect' => Descriptions::OpenOriginProtect(), // 开通原图保护
+                'GetOriginProtect' => Descriptions::GetOriginProtect(), // 查询原图保护状态
+                'CloseOriginProtect' => Descriptions::CloseOriginProtect(), // 关闭原图保护
+                'ImageDetectFace' => Descriptions::ImageDetectFace(), // 人脸检测
+                'ImageFaceEffect' => Descriptions::ImageFaceEffect(), // 人脸特效
+                'IDCardOCR' => Descriptions::IDCardOCR(), // 身份证识别
+                'IDCardOCRByUpload' => Descriptions::IDCardOCRByUpload(), // 身份证识别-上传时处理
+                'GetLiveCode' => Descriptions::GetLiveCode(), // 获取数字验证码
+                'GetActionSequence' => Descriptions::GetActionSequence(), // 获取动作顺序
+                'DescribeDocProcessBuckets' => Descriptions::DescribeDocProcessBuckets(), // 查询文档预览开通状态
+                'UpdateDocProcessQueue' => Descriptions::UpdateDocProcessQueue(), // 更新文档转码队列
+                'CreateMediaQualityEstimateJobs' => Descriptions::CreateMediaQualityEstimateJobs(), // 提交视频质量评分任务
+                'CreateMediaStreamExtractJobs' => Descriptions::CreateMediaStreamExtractJobs(), // 提交音视频流分离任务
+            ),
+            'models' => array(
+                'AbortMultipartUploadOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'CreateBucketOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Location' => array(
+                            'type' => 'string',
+                            'location' => 'header'
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'CompleteMultipartUploadOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Location' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Key' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'CRC' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-hash-crc64ecma',
+                        ),
+                        'ImageInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Format' => array(
+                                    'type' => 'string',
+                                ),
+                                'Width' => array(
+                                    'type' => 'string',
+                                ),
+                                'Height' => array(
+                                    'type' => 'string',
+                                ),
+                                'Quality' => array(
+                                    'type' => 'string',
+                                ),
+                                'Ave' => array(
+                                    'type' => 'string',
+                                ),
+                                'Orientation' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'ProcessResults' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Object' => array(
+                                    'type' => 'array',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Key' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Location' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Format' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Width' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Height' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Size' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Quality' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ETag' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'WatermarkStatus' => array(
+                                                'type' => 'integer',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'CreateMultipartUploadOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                            'sentAs' => 'Bucket'
+                        ),
+                        'Key' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'UploadId' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        '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-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        )
+                    )
+                ),
+                'CopyObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'CopySourceVersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-version-id',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'CRC' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-hash-crc64ecma',
+                        )
+                    ),
+                ),
+                'DeleteBucketOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'DeleteBucketCorsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketTaggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketInventoryOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'DeleteMarker' => array(
+                            'type' => 'boolean',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-delete-marker',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteObjectsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Deleted' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Deleted',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'DeleteMarker' => array(
+                                        'type' => 'boolean',
+                                    ),
+                                    'DeleteMarkerVersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'Errors' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Error',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Code' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Message' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketLifecycleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketReplicationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketWebsiteOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutObjectTaggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetObjectTaggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'TagSet' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'sentAs' => 'Tag',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Value' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteObjectTaggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'GetObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                        'DeleteMarker' => array(
+                            'type' => 'boolean',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-delete-marker',
+                        ),
+                        'AcceptRanges' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'accept-ranges',
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'Restore' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-restore',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Last-Modified',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'MissingMeta' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-missing-meta',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        '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',
+                        ),
+                        'ContentRange' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Range',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'Expires' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        '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-aws-kms-key-id',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'ReplicationStatus' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-replication-status',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'CRC' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-hash-crc64ecma',
+                        )
+                    ),
+                ),
+                'GetObjectAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'),
+                                            'ID' => array(
+                                                'type' => 'string'))),
+                                    'Permission' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string'
+                                ),
+                                'ID' => array(
+                                    'type' => 'string'
+                                )
+                            )
+                        ),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string'
+                                            )
+                                        )
+                                    ),
+                                    'Permission' => array(
+                                        'type' => 'string'
+                                    )
+                                )
+                            )
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'GetBucketCorsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'CORSRules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'CORSRule',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string'),
+                                    'AllowedHeaders' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'AllowedHeader',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'type' => 'string',
+                                        )
+                                    ),
+                                    'AllowedMethods' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'AllowedMethod',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'type' => 'string',
+                                        ),
+                                    ),
+                                    'AllowedOrigins' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'AllowedOrigin',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'type' => 'string',
+                                        ),
+                                    ),
+                                    'ExposeHeaders' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'ExposeHeader',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'type' => 'string',
+                                        ),
+                                    ),
+                                    'MaxAgeSeconds' => array(
+                                        'type' => 'numeric',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketDomainOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'DomainRules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'DomainRule',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Status' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'Name' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'Type' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'ForcedReplacement' => array(
+                                        'type' => 'string'
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'DomainTxtVerification' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-domain-txt-verification',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketLifecycleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Rules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Rule',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Expiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Date' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Days' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Prefix' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Tag' => array(
+                                                'type' => 'object',
+                                                'properties' => array(
+                                                    'Key' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                    'Value' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                )
+                                            )
+                                        ),
+                                    ),
+                                    'Status' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Transition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Date' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Days' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'NoncurrentVersionTransition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'NoncurrentVersionExpiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketVersioningOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'MFADelete' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                            'sentAs' => 'MfaDelete',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketReplicationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Role' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Rules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Rule',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Prefix' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Status' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Destination' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Bucket' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketLocationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Location' => array(
+                            'type' => 'string',
+                            'location' => 'body',
+                            'filters' => array(
+                                'strval',
+                                'strip_tags',
+                                'trim',
+                            ),
+                        ),
+                    ),
+                ),
+                'GetBucketAccelerateOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Type' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketWebsiteOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RedirectAllRequestsTo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'HostName' => array(
+                                    'type' => 'string',
+                                ),
+                                'Protocol' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'IndexDocument' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Suffix' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'ErrorDocument' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Key' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'RoutingRules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'name' => 'RoutingRule',
+                                'type' => 'object',
+                                'sentAs' => 'RoutingRule',
+                                'properties' => array(
+                                    'Condition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'HttpErrorCodeReturnedEquals' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'KeyPrefixEquals' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Redirect' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'HostName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'HttpRedirectCode' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Protocol' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ReplaceKeyPrefixWith' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ReplaceKeyWith' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketInventoryOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Destination' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'COSBucketDestination' => array(
+                                    'type' => 'object',
+                                    'properties' => array(
+                                        'Format' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'AccountId' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Bucket' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Prefix' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Encryption' => array(
+                                            'type' => 'object',
+                                            'properties' => array(
+                                                'SSE-COS' => array(
+                                                    'type' => 'string',
+                                                )
+                                            )
+                                        ),
+                                        
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Schedule' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Frequency' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'OptionalFields' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Key' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'OptionalFields' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'name' => 'Field',
+                                'type' => 'string',
+                                'sentAs' => 'Field',
+                            ),
+                        ),
+                        'IsEnabled' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Id' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'IncludedObjectVersions' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketTaggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'TagSet' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'sentAs' => 'Tag',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Value' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketNotificationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'CloudFunctionConfigurations' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'CloudFunctionConfiguration',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Id' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'CloudFunction' => array(
+                                        'type' => 'string',
+                                        'sentAs' => 'CloudFunction',
+                                    ),
+                                    'Events' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'Event',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'type' => 'string',
+                                        ),
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Key' => array(
+                                                'type' => 'object',
+                                                'sentAs' => 'Key',
+                                                'properties' => array(
+                                                    'FilterRules' => array(
+                                                        'type' => 'array',
+                                                        'sentAs' => 'FilterRule',
+                                                        'data' => array(
+                                                            'xmlFlattened' => true,
+                                                        ),
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'properties' => array(
+                                                                'Name' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                                'Value' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketLoggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'LoggingEnabled' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'TargetBucket' => array(
+                                    'type' => 'string',
+                                    'location' => 'xml',
+                                ),
+                                'TargetPrefix' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'UploadPartOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        '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-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'CRC' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-hash-crc64ecma',
+                        )
+                    ),
+                ),
+                'UploadPartCopyOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'CopySourceVersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-version-id',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        '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-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'CRC' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-hash-crc64ecma',
+                        )
+                    ),
+                ),
+                'PutBucketAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'PutObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        '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-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                        'CRC' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-hash-crc64ecma',
+                        )
+                    ),
+                ),
+                'AppendObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'Position' => array(
+                            'type' => 'integer',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-next-append-position',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        )
+                    ),
+                ),
+                'PutObjectAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketCorsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketDomainOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketLifecycleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketVersioningOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketReplicationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketNotificationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketWebsiteOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header', 
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketAccelerateOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketLoggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketInventoryOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketTaggingOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'RestoreObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ListPartsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'Key' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'UploadId' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'PartNumberMarker' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'
+                        ),
+                        'NextPartNumberMarker' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'
+                        ),
+                        'MaxParts' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'
+                        ),
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml'
+                        ),
+                        'Parts' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Part',
+                            'data' => array(
+                                'xmlFlattened' => true
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'PartNumber' => array(
+                                        'type' => 'numeric'
+                                    ),
+                                    'LastModified' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'ETag' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'Size' => array(
+                                        'type' => 'numeric'
+                                    )
+                                )
+                            )
+                        ),
+                        'Initiator' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ID' => array(
+                                    'type' => 'string'
+                                ),
+                                'DisplayName' => array(
+                                    'type' => 'string'
+                                )
+                            )
+                        ),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string'
+                                ),
+                                'ID' => array(
+                                    'type' => 'string'
+                                )
+                            )
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'ListObjectsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml'
+                        ),
+                        'Marker' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'NextMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'Contents' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'LastModified' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'ETag' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'Size' => array(
+                                        'type' => 'numeric'
+                                    ),
+                                    'StorageClass' => array(
+                                        'type' => 'string'
+                                    ),
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string'
+                                            )
+                                        )
+                                    )
+                                )
+                            )
+                        ),
+                        'Name' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'
+                        ),
+                        'CommonPrefixes' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Prefix' => array(
+                                        'type' => 'string'
+                                    )
+                                )
+                            )
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        )
+                    )
+                ),
+                'ListBucketsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Buckets' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Name' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'CreationDate' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ListObjectVersionsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'VersionIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextKeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextVersionIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Version' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'ETag' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Size' => array(
+                                        'type' => 'numeric',
+                                    ),
+                                    'StorageClass' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'IsLatest' => array(
+                                        'type' => 'boolean',
+                                    ),
+                                    'LastModified' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'DeleteMarkers' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'DeleteMarker',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'IsLatest' => array(
+                                        'type' => 'boolean',
+                                    ),
+                                    'LastModified' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Name' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml',
+                        ),
+                        'CommonPrefixes' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Prefix' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ListMultipartUploadsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'UploadIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextKeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextUploadIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'MaxUploads' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml',
+                        ),
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml',
+                        ),
+                        'Uploads' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Upload',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'UploadId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Initiated' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'StorageClass' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Initiator' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'CommonPrefixes' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Prefix' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ListBucketInventoryConfigurationsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'InventoryConfiguration' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'InventoryConfiguration',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Destination' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'COSBucketDestination' => array(
+                                                'type' => 'object',
+                                                'properties' => array(
+                                                    'Format' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'AccountId' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'Bucket' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'Prefix' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'Encryption' => array(
+                                                        'type' => 'object',
+                                                        'properties' => array(
+                                                            'SSE-COS' => array(
+                                                                'type' => 'string',
+                                                            )
+                                                        )
+                                                    ),
+                                                    
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                    'Schedule' => array(
+                                        'type' => 'object',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Frequency' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'OptionalFields' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'properties' => array(
+                                            'Key' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'OptionalFields' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'items' => array(
+                                            'name' => 'Field',
+                                            'type' => 'string',
+                                            'sentAs' => 'Field',
+                                        ),
+                                    ),
+                                    'IsEnabled' => array(
+                                        'type' => 'string',
+                                        'location' => 'xml',
+                                    ),
+                                    'Id' => array(
+                                        'type' => 'string',
+                                        'location' => 'xml',
+                                    ),
+                                    'IncludedObjectVersions' => array(
+                                        'type' => 'string',
+                                        'location' => 'xml',
+                                    ),
+                                    'RequestId' => array(
+                                        'location' => 'header',
+                                        'sentAs' => 'x-cos-request-id',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'HeadObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'DeleteMarker' => array(
+                            'type' => 'boolean',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-delete-marker',
+                        ),
+                        'AcceptRanges' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'accept-ranges',
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'Restore' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-restore',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Last-Modified',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'MissingMeta' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-missing-meta',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        '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',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'Expires' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        '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-aws-kms-key-id',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'ReplicationStatus' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-replication-status',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'CRC' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-hash-crc64ecma',
+                        )
+                    )
+                ),
+                'HeadBucketOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'SelectObjectContentOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RawData' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                    ),
+                ),
+                'GetBucketIntelligentTieringOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Transition' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Days' => array(
+                                    'type' => 'string',
+                                ),
+                                'RequestFrequent' => array(
+                                    'type' => 'string',
+                                ),
+                            )
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketIntelligentTieringOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ImageInfoOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                    ),
+                ),
+                'ImageExifOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                    ),
+                ),
+                'ImageAveOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                    ),
+                ),
+                'ImageProcessOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'OriginalInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Key' => array(
+                                    'type' => 'string',
+                                ),
+                                'Location' => array(
+                                    'type' => 'string',
+                                ),
+                                'ETag' => array(
+                                    'type' => 'string',
+                                ),
+                                'ImageInfo' => array(
+                                    'type' => 'object',
+                                    'properties' => array(
+                                        'Format' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Width' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Height' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Quality' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Ave' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Orientation' => array(
+                                            'type' => 'string',
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ProcessResults' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Object' => array(
+                                    'type' => 'array',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Key' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Location' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Format' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Width' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Height' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Size' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Quality' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ETag' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'WatermarkStatus' => array(
+                                                'type' => 'integer',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'QrcodeOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'CodeStatus' => array(
+                            'type' => 'integer',
+                            'location' => 'xml',
+                        ),
+                        'QRcodeInfo' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'CodeUrl' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Point' => array(
+                                        'type' => 'array',
+                                        'items' => array(
+                                            'type' => 'string',
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'ResultImage' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                    ),
+                ),
+                'QrcodeGenerateOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'ResultImage' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                    ),
+                ),
+                'DetectLabelOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'Labels' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Confidence' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Name' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'PutBucketImageStyleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketImageStyleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'StyleRule' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'StyleName' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'StyleBody' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'DeleteBucketImageStyleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketGuetzliOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketGuetzliOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                    ),
+                ),
+                'DeleteBucketGuetzliOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetObjectSensitiveContentRecognitionOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'PornInfo' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Code' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Msg' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'HitFlag' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Score' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Label' => array(
+                                        'type' => 'string',
+                                    )
+                                ),
+                            ),
+                        ),
+                        'TerroristInfo' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Code' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Msg' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'HitFlag' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Score' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Label' => array(
+                                        'type' => 'string',
+                                    )
+                                ),
+                            ),
+                        ),
+                        'PoliticsInfo' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Code' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Msg' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'HitFlag' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Score' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Label' => array(
+                                        'type' => 'string',
+                                    )
+                                ),
+                            ),
+                        ),
+                        'AdsInfo' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Code' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Msg' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'HitFlag' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Score' => array(
+                                        'type' => 'integer',
+                                    ),
+                                    'Label' => array(
+                                        'type' => 'string',
+                                    )
+                                ),
+                            ),
+                        ),
+                    )
+                ),
+                'DetectTextOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-ci-request-id',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'JobsDetail' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Code' => array( 'type' => 'string', 'location' => 'xml',),
+                                'DataId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Message' => array( 'type' => 'string', 'location' => 'xml',),
+                                'JobId' => array( 'type' => 'string', 'location' => 'xml',),
+                                'State' => array( 'type' => 'string', 'location' => 'xml',),
+                                'CreationTime' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Content' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                'Result' => array( 'type' => 'integer', 'location' => 'xml',),
+                                'SectionCount' => array( 'type' => 'integer', 'location' => 'xml',),
+                                'PornInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        'Count' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'TerrorismInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        'Count' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'PoliticsInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        'Count' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'AdsInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        'Count' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'IllegalInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        'Count' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'AbuseInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                        'Count' => array( 'type' => 'integer', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'Section' => array(
+                                    'type' => 'array',
+                                    'location' => 'xml',
+                                    'items' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'StartByte' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'Label' => array( 'type' => 'string', 'location' => 'xml',),
+                                            'Result' => array( 'type' => 'integer', 'location' => 'xml',),
+                                            'PornInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'TerrorismInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'PoliticsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'AdsInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'IllegalInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'AbuseInfo' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Score' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'Keywords' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'SubLabel' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'LibResults' => array(
+                                                        'type' => 'array',
+                                                        'location' => 'xml',
+                                                        'items' => array(
+                                                            'type' => 'object',
+                                                            'location' => 'xml',
+                                                            'properties' => array(
+                                                                'LibType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                                'LibName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                'Keywords' => array(
+                                                                    'type' => 'array',
+                                                                    'location' => 'xml',
+                                                                    'items' => array( 'type' => 'string', 'location' => 'xml',),
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                                'UserInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'TokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'Nickname' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'DeviceId' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'AppId' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'Room' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'IP' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'Type' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'ReceiveTokenId' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'Gender' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'Level' => array( 'type' => 'string', 'location' => 'xml',),
+                                        'Role' => array( 'type' => 'string', 'location' => 'xml',),
+                                    ),
+                                ),
+                                'ListInfo' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'ListResults' => array(
+                                            'type' => 'array',
+                                            'location' => 'xml',
+                                            'items' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'ListType' => array( 'type' => 'integer', 'location' => 'xml',),
+                                                    'ListName' => array( 'type' => 'string', 'location' => 'xml',),
+                                                    'Entity' => array( 'type' => 'string', 'location' => 'xml',),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'GetSnapshotOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'GuzzleHttp\\Psr7\\Stream',
+                            'location' => 'body',
+                        ),
+                        'DeleteMarker' => array(
+                            'type' => 'boolean',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-delete-marker',
+                        ),
+                        'AcceptRanges' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'accept-ranges',
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'Restore' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-restore',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Last-Modified',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'MissingMeta' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-missing-meta',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        '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',
+                        ),
+                        'ContentRange' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Range',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'Expires' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        '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-aws-kms-key-id',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'ReplicationStatus' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-replication-status',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        )
+                    )
+                ),
+                'PutBucketRefererOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        )
+                    )
+                ),
+                'GetBucketRefererOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'RefererType' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'EmptyReferConfiguration' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'DomainList' => array(
+                            'location' => 'xml',
+                            'type' => 'object',
+                            'properties' => array(
+                                'Domains' => array(
+                                    'type' => 'array',
+                                    'data' => array(
+                                        'xmlFlattened' => true,
+                                    ),
+                                    'items' => array(
+                                        'name' => 'Domain',
+                                        'type' => 'string',
+                                        'sentAs' => 'Domain',
+                                    ),
+                                )
+                            )
+                        )
+                    )
+                ),
+                'GetMediaInfoOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'minimum'=> 0,
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'MediaInfo' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Stream' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'JobId' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'State' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'Video' => array(
+                                            'type' => 'object',
+                                            'location' => 'xml',
+                                            'properties' => array(
+                                                'Index' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'CodecName' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'CodecLongName' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'CodecTimeBase' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'CodecTag' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'Profile' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'Height' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'Width' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'HasBFrame' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'RefFrames' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'Sar' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'Dar' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'PixFormat' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'FieldOrder' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'Level' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'Fps' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'AvgFps' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'Timebase' => array(
+                                                    'type' => 'string',
+                                                ),
+                                                'StartTime' => array(
+                                                    'type' => 'numeric',
+                                                ),
+                                                'Duration' => array(
+                                                    'type' => 'numeric',
+                                                ),
+                                                'Bitrate' => array(
+                                                    'type' => 'numeric',
+                                                ),
+                                                'NumFrames' => array(
+                                                    'type' => 'integer',
+                                                ),
+                                                'Language' => array(
+                                                    'type' => 'string',
+                                                )
+                                            ),
+                                            'Audio' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'Index' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                    'CodecName' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'CodecLongName' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'CodecTimeBase' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'CodecTagString' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'CodecTag' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'SampleFmt' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'SampleRate' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                    'Channel' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                    'ChannelLayout' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'Timebase' => array(
+                                                        'type' => 'string',
+                                                    ),
+                                                    'StartTime' => array(
+                                                        'type' => 'numeric',
+                                                    ),
+                                                    'Duration' => array(
+                                                        'type' => 'numeric',
+                                                    ),
+                                                    'Bitrate' => array(
+                                                        'type' => 'numeric',
+                                                    ),
+                                                    'Language' => array(
+                                                        'type' => 'string',
+                                                    )
+                                                )
+                                            ),
+                                            'Subtitle' => array(
+                                                'type' => 'object',
+                                                'location' => 'xml',
+                                                'properties' => array(
+                                                    'Index' => array(
+                                                        'type' => 'integer',
+                                                    ),
+                                                    'Language' => array(
+                                                        'type' => 'string',
+                                                    )
+                                                )
+                                            )
+                                        ),
+                                    )
+                                ),
+                                'Format' => array(
+                                    'type' => 'object',
+                                    'location' => 'xml',
+                                    'properties' => array(
+                                        'NumStream' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'NumProgram' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'FormatName' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'FormatLongName' => array(
+                                            'type' => 'string',
+                                        ),
+                                        'StartTime' => array(
+                                            'type' => 'numeric',
+                                        ),
+                                        'Duration' => array(
+                                            'type' => 'numeric',
+                                        ),
+                                        'Bitrate' => array(
+                                            'type' => 'integer',
+                                        ),
+                                        'Size' => array(
+                                            'type' => 'integer',
+                                        )
+                                    )
+                                )
+                            )
+                        )
+
+
+                    )
+                ),
+                'CreateMediaTranscodeJobsOutput' => Descriptions::CreateMediaTranscodeJobsOutput(),
+                'DescribeMediaJobOutput' => Descriptions::DescribeMediaJobOutput(),
+                'DescribeMediaJobsOutput' => Descriptions::DescribeMediaJobsOutput(),
+                'CreateMediaJobsOutput' => Descriptions::CreateMediaJobsOutput(),
+                'CreateMediaSnapshotJobsOutput' => Descriptions::CreateMediaSnapshotJobsOutput(),
+                'CreateMediaConcatJobsOutput' => Descriptions::CreateMediaConcatJobsOutput(),
+                'DetectAudioOutput' => Descriptions::DetectAudioOutput(),
+                'GetDetectAudioResultOutput' => Descriptions::GetDetectAudioResultOutput(),
+                'GetDetectTextResultOutput' => Descriptions::GetDetectTextResultOutput(),
+                'DetectVideoOutput' => Descriptions::DetectVideoOutput(),
+                'GetDetectVideoResultOutput' => Descriptions::GetDetectVideoResultOutput(),
+                'DetectDocumentOutput' => Descriptions::DetectDocumentOutput(),
+                'GetDetectDocumentResultOutput' => Descriptions::GetDetectDocumentResultOutput(),
+                'CreateDocProcessJobsOutput' => Descriptions::CreateDocProcessJobsOutput(),
+                'DescribeDocProcessQueuesOutput' => Descriptions::DescribeDocProcessQueuesOutput(),
+                'DescribeDocProcessJobOutput' => Descriptions::DescribeDocProcessJobOutput(),
+                'GetDescribeDocProcessJobsOutput' => Descriptions::GetDescribeDocProcessJobsOutput(),
+                'DetectImageOutput' => Descriptions::DetectImageOutput(),
+                'DetectImagesOutput' => Descriptions::DetectImagesOutput(),
+                'DetectVirusOutput' => Descriptions::DetectVirusOutput(),
+                'GetDetectVirusResultOutput' => Descriptions::GetDetectVirusResultOutput(),
+                'GetDetectImageResultOutput' => Descriptions::GetDetectImageResultOutput(),
+                'CreateMediaVoiceSeparateJobsOutput' => Descriptions::CreateMediaVoiceSeparateJobsOutput(),
+                'DescribeMediaVoiceSeparateJobOutput' => Descriptions::DescribeMediaVoiceSeparateJobOutput(),
+                'DetectWebpageOutput' => Descriptions::DetectWebpageOutput(),
+                'GetDetectWebpageResultOutput' => Descriptions::GetDetectWebpageResultOutput(),
+                'DescribeMediaBucketsOutput' => Descriptions::DescribeMediaBucketsOutput(),
+                'GetPrivateM3U8Output' => Descriptions::GetPrivateM3U8Output(),
+                'DescribeMediaQueuesOutput' => Descriptions::DescribeMediaQueuesOutput(),
+                'UpdateMediaQueueOutput' => Descriptions::UpdateMediaQueueOutput(),
+                'CreateMediaSmartCoverJobsOutput' => Descriptions::CreateMediaSmartCoverJobsOutput(),
+                'CreateMediaVideoProcessJobsOutput' => Descriptions::CreateMediaVideoProcessJobsOutput(),
+                'CreateMediaVideoMontageJobsOutput' => Descriptions::CreateMediaVideoMontageJobsOutput(),
+                'CreateMediaAnimationJobsOutput' => Descriptions::CreateMediaAnimationJobsOutput(),
+                'CreateMediaPicProcessJobsOutput' => Descriptions::CreateMediaPicProcessJobsOutput(),
+                'CreateMediaSegmentJobsOutput' => Descriptions::CreateMediaSegmentJobsOutput(),
+                'CreateMediaVideoTagJobsOutput' => Descriptions::CreateMediaVideoTagJobsOutput(),
+                'CreateMediaSuperResolutionJobsOutput' => Descriptions::CreateMediaSuperResolutionJobsOutput(),
+                'CreateMediaSDRtoHDRJobsOutput' => Descriptions::CreateMediaSDRtoHDRJobsOutput(),
+                'CreateMediaDigitalWatermarkJobsOutput' => Descriptions::CreateMediaDigitalWatermarkJobsOutput(),
+                'CreateMediaExtractDigitalWatermarkJobsOutput' => Descriptions::CreateMediaExtractDigitalWatermarkJobsOutput(),
+                'DetectLiveVideoOutput' => Descriptions::DetectLiveVideoOutput(),
+                'CancelLiveVideoAuditingOutput' => Descriptions::CancelLiveVideoAuditingOutput(),
+                'OpticalOcrRecognitionOutput' => Descriptions::OpticalOcrRecognitionOutput(),
+                'TriggerWorkflowOutput' => Descriptions::TriggerWorkflowOutput(),
+                'GetWorkflowInstancesOutput' => Descriptions::GetWorkflowInstancesOutput(),
+                'GetWorkflowInstanceOutput' => Descriptions::GetWorkflowInstanceOutput(),
+                'CreateMediaSnapshotTemplateOutput' => Descriptions::CreateMediaSnapshotTemplateOutput(),
+                'UpdateMediaSnapshotTemplateOutput' => Descriptions::UpdateMediaSnapshotTemplateOutput(),
+                'CreateMediaTranscodeTemplateOutput' => Descriptions::CreateMediaTranscodeTemplateOutput(),
+                'UpdateMediaTranscodeTemplateOutput' => Descriptions::UpdateMediaTranscodeTemplateOutput(),
+                'CreateMediaHighSpeedHdTemplateOutput' => Descriptions::CreateMediaHighSpeedHdTemplateOutput(),
+                'UpdateMediaHighSpeedHdTemplateOutput' => Descriptions::UpdateMediaHighSpeedHdTemplateOutput(),
+                'CreateMediaAnimationTemplateOutput' => Descriptions::CreateMediaAnimationTemplateOutput(),
+                'UpdateMediaAnimationTemplateOutput' => Descriptions::UpdateMediaAnimationTemplateOutput(),
+                'CreateMediaConcatTemplateOutput' => Descriptions::CreateMediaConcatTemplateOutput(),
+                'UpdateMediaConcatTemplateOutput' => Descriptions::UpdateMediaConcatTemplateOutput(),
+                'CreateMediaVideoProcessTemplateOutput' => Descriptions::CreateMediaVideoProcessTemplateOutput(),
+                'UpdateMediaVideoProcessTemplateOutput' => Descriptions::UpdateMediaVideoProcessTemplateOutput(),
+                'CreateMediaVideoMontageTemplateOutput' => Descriptions::CreateMediaVideoMontageTemplateOutput(),
+                'UpdateMediaVideoMontageTemplateOutput' => Descriptions::UpdateMediaVideoMontageTemplateOutput(),
+                'CreateMediaVoiceSeparateTemplateOutput' => Descriptions::CreateMediaVoiceSeparateTemplateOutput(),
+                'UpdateMediaVoiceSeparateTemplateOutput' => Descriptions::UpdateMediaVoiceSeparateTemplateOutput(),
+                'CreateMediaSuperResolutionTemplateOutput' => Descriptions::CreateMediaSuperResolutionTemplateOutput(),
+                'UpdateMediaSuperResolutionTemplateOutput' => Descriptions::UpdateMediaSuperResolutionTemplateOutput(),
+                'CreateMediaPicProcessTemplateOutput' => Descriptions::CreateMediaPicProcessTemplateOutput(),
+                'UpdateMediaPicProcessTemplateOutput' => Descriptions::UpdateMediaPicProcessTemplateOutput(),
+                'CreateMediaWatermarkTemplateOutput' => Descriptions::CreateMediaWatermarkTemplateOutput(),
+                'UpdateMediaWatermarkTemplateOutput' => Descriptions::UpdateMediaWatermarkTemplateOutput(),
+                'DescribeMediaTemplatesOutput' => Descriptions::DescribeMediaTemplatesOutput(),
+                'DescribeWorkflowOutput' => Descriptions::DescribeWorkflowOutput(),
+                'DeleteWorkflowOutput' => Descriptions::DeleteWorkflowOutput(),
+                'CreateInventoryTriggerJobOutput' => Descriptions::CreateInventoryTriggerJobOutput(),
+                'DescribeInventoryTriggerJobsOutput' => Descriptions::DescribeInventoryTriggerJobsOutput(),
+                'DescribeInventoryTriggerJobOutput' => Descriptions::DescribeInventoryTriggerJobOutput(),
+                'CancelInventoryTriggerJobOutput' => Descriptions::CancelInventoryTriggerJobOutput(),
+                'CreateMediaNoiseReductionJobsOutput' => Descriptions::CreateMediaNoiseReductionJobsOutput(),
+                'ImageRepairProcessOutput' => Descriptions::ImageRepairProcessOutput(),
+                'ImageDetectCarProcessOutput' => Descriptions::ImageDetectCarProcessOutput(),
+                'ImageAssessQualityProcessOutput' => Descriptions::ImageAssessQualityProcessOutput(),
+                'ImageSearchOpenOutput' => Descriptions::ImageSearchOpenOutput(),
+                'ImageSearchAddOutput' => Descriptions::ImageSearchAddOutput(),
+                'ImageSearchOutput' => Descriptions::ImageSearchOutput(),
+                'ImageSearchDeleteOutput' => Descriptions::ImageSearchDeleteOutput(),
+                'BindCiServiceOutput' => Descriptions::BindCiServiceOutput(),
+                'GetCiServiceOutput' => Descriptions::GetCiServiceOutput(),
+                'UnBindCiServiceOutput' => Descriptions::UnBindCiServiceOutput(),
+                'GetHotLinkOutput' => Descriptions::GetHotLinkOutput(),
+                'AddHotLinkOutput' => Descriptions::AddHotLinkOutput(),
+                'OpenOriginProtectOutput' => Descriptions::OpenOriginProtectOutput(),
+                'GetOriginProtectOutput' => Descriptions::GetOriginProtectOutput(),
+                'CloseOriginProtectOutput' => Descriptions::CloseOriginProtectOutput(),
+                'ImageDetectFaceOutput' => Descriptions::ImageDetectFaceOutput(),
+                'ImageFaceEffectOutput' => Descriptions::ImageFaceEffectOutput(),
+                'IDCardOCROutput' => Descriptions::IDCardOCROutput(),
+                'IDCardOCRByUploadOutput' => Descriptions::IDCardOCRByUploadOutput(),
+                'GetLiveCodeOutput' => Descriptions::GetLiveCodeOutput(),
+                'GetActionSequenceOutput' => Descriptions::GetActionSequenceOutput(),
+                'DescribeDocProcessBucketsOutput' => Descriptions::DescribeDocProcessBucketsOutput(),
+                'UpdateDocProcessQueueOutput' => Descriptions::UpdateDocProcessQueueOutput(),
+                'CreateMediaQualityEstimateJobsOutput' => Descriptions::CreateMediaQualityEstimateJobsOutput(),
+                'CreateMediaStreamExtractJobsOutput' => Descriptions::CreateMediaStreamExtractJobsOutput(),
+            )
+        );
+    }
+}

+ 131 - 0
addons/cos/library/Qcloud/Cos/Signature.php

@@ -0,0 +1,131 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Psr\Http\Message\RequestInterface;
+
+class Signature {
+    // string: access key.
+    private $accessKey;
+
+    // string: secret key.
+    private $secretKey;
+
+    // array: cos config.
+    private $options;
+
+    public function __construct( $accessKey, $secretKey, $options, $token = null ) {
+        $this->accessKey = $accessKey;
+        $this->secretKey = $secretKey;
+        $this->options = $options;
+        $this->token = $token;
+        $this->signHeader = [
+            'cache-control',
+            'content-disposition',
+            'content-encoding',
+            'content-length',
+            'content-md5',
+            'content-type',
+            'expect',
+            'expires',
+            'host',
+            'if-match',
+            'if-modified-since',
+            'if-none-match',
+            'if-unmodified-since',
+            'origin',
+            'range',
+            'response-cache-control',
+            'response-content-disposition',
+            'response-content-encoding',
+            'response-content-language',
+            'response-content-type',
+            'response-expires',
+            'transfer-encoding',
+            'versionid',
+        ];
+        date_default_timezone_set( 'PRC' );
+    }
+
+    public function __destruct() {
+    }
+
+    public function needCheckHeader( $header ) {
+        if ( startWith( $header, 'x-cos-' ) ) {
+            return true;
+        }
+        if ( in_array( $header, $this->signHeader ) ) {
+            return true;
+        }
+        return false;
+    }
+
+    public function signRequest( RequestInterface $request ) {
+        $authorization = $this->createAuthorization( $request );
+        return $request->withHeader( 'Authorization', $authorization );
+    }
+
+    public function createAuthorization( RequestInterface $request, $expires = '+30 minutes' ) {
+        if ( is_null( $expires ) || !strtotime( $expires )) {
+            $expires = '+30 minutes';
+        }
+        $signTime = ( string )( time() - 60 ) . ';' . ( string )( strtotime( $expires ) );
+        $urlParamListArray = [];
+        foreach ( explode( '&', $request->getUri()->getQuery() ) as $query ) {
+            if (!empty($query)) {
+                $tmpquery = explode( '=', $query );
+                //为了保证CI的key中有=号的情况也能正常通过,ci在这层之前已经encode了,这里需要拆开重新encode,防止上方explode拆错
+                $key = strtolower( rawurlencode(urldecode($tmpquery[0])) );
+                if (count($tmpquery) >= 2) {
+                    $value = $tmpquery[1];
+                } else {
+                    $value = "";
+                }
+                //host开关
+                if (!$this->options['signHost'] && $key == 'host') {
+                    continue;
+                }
+                $urlParamListArray[$key] = $key. '='. $value;
+            }
+        }
+        ksort($urlParamListArray);
+        $urlParamList = join(';', array_keys($urlParamListArray));
+        $httpParameters = join('&', array_values($urlParamListArray));
+
+        $headerListArray = [];
+        foreach ( $request->getHeaders() as $key => $value ) {
+            $key = strtolower( urlencode( $key ) );
+            $value = rawurlencode( $value[0] );
+            if ( !$this->options['signHost'] && $key == 'host' ) {
+                continue;
+            }
+            if ( $this->needCheckHeader( $key ) ) {
+                $headerListArray[$key] = $key. '='. $value;
+            }
+        }
+        ksort($headerListArray);
+        $headerList = join(';', array_keys($headerListArray));
+        $httpHeaders = join('&', array_values($headerListArray));
+        $httpString = strtolower( $request->getMethod() ) . "\n" . urldecode( $request->getUri()->getPath() ) . "\n" . $httpParameters.
+        "\n". $httpHeaders. "\n";
+        $sha1edHttpString = sha1( $httpString );
+        $stringToSign = "sha1\n$signTime\n$sha1edHttpString\n";
+        $signKey = hash_hmac( 'sha1', $signTime, trim($this->secretKey) );
+        $signature = hash_hmac( 'sha1', $stringToSign, $signKey );
+        $authorization = 'q-sign-algorithm=sha1&q-ak='. trim($this->accessKey) .
+        "&q-sign-time=$signTime&q-key-time=$signTime&q-header-list=$headerList&q-url-param-list=$urlParamList&" .
+        "q-signature=$signature";
+        return $authorization;
+    }
+
+    public function createPresignedUrl( RequestInterface $request, $expires = '+30 minutes' ) {
+        $authorization = $this->createAuthorization( $request, $expires);
+        $uri = $request->getUri();
+        $query = 'sign='.urlencode( $authorization ) . '&' . $uri->getQuery();
+        if ( $this->token != null ) {
+            $query = $query.'&x-cos-security-token='.$this->token;
+        }
+        $uri = $uri->withQuery( $query );
+        return $uri;
+    }
+}

+ 23 - 0
addons/cos/library/Qcloud/Cos/SignatureMiddleware.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Psr\Http\Message\RequestInterface;
+
+class SignatureMiddleware {
+    private $nextHandler;
+    protected $signature;
+
+    /**
+     * @param callable $nextHandler Next handler to invoke.
+     */
+    public function __construct(callable $nextHandler, $accessKey, $secretKey, $options) {
+        $this->nextHandler = $nextHandler;
+        $this->signature = new Signature($accessKey, $secretKey, $options);
+    }
+
+    public function __invoke(RequestInterface $request, array $options) {
+        $fn = $this->nextHandler;
+        return $fn($this->signature->signRequest($request), $options);
+	}
+}

File diff suppressed because it is too large
+ 0 - 0
public/assets/addons/cos/js/spark.js


Some files were not shown because too many files changed in this diff