From fd62937b7fd6d1c51b42800a596095ce2ff93aa2 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 21 Apr 2023 16:22:13 +0800 Subject: [PATCH] =?UTF-8?q?2.11=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 48 +- app/common/dao/community/CommunityDao.php | 10 +- .../dao/store/coupon/StoreCouponDao.php | 6 +- app/common/dao/store/order/StoreOrderDao.php | 9 - .../dao/store/order/StoreOrderProductDao.php | 5 +- .../dao/store/order/StoreOrderStatusDao.php | 17 +- app/common/dao/store/product/ProductDao.php | 13 +- .../dao/store/product/ProductGroupUserDao.php | 2 +- .../dao/store/product/ProductSkuDao.php | 4 +- app/common/dao/store/product/SpuDao.php | 14 +- .../store/product/StoreDiscountProductDao.php | 6 +- .../dao/store/service/StoreServiceDao.php | 4 +- .../dao/system/merchant/MerchantDao.php | 8 +- app/common/dao/user/UserBillDao.php | 9 +- app/common/dao/user/UserDao.php | 2 +- app/common/dao/user/UserExtractDao.php | 2 - app/common/dao/user/UserRechargeDao.php | 3 +- .../MerchantCheckBaseInfoMiddleware.php | 2 +- .../middleware/ServiceTokenMiddleware.php | 5 +- app/common/model/store/order/StoreCart.php | 2 +- app/common/model/store/order/StoreOrder.php | 8 +- .../model/store/order/StoreRefundOrder.php | 5 +- app/common/model/store/product/Product.php | 188 +- .../model/store/product/ProductAttrValue.php | 14 +- app/common/model/store/product/Spu.php | 5 + .../store/product/StoreDiscountProduct.php | 3 +- app/common/model/system/merchant/Merchant.php | 5 +- app/common/model/user/User.php | 7 +- app/common/model/user/UserExtract.php | 11 + .../community/CommunityRepository.php | 29 +- .../delivery/DeliveryOrderRepository.php | 40 +- .../broadcast/BroadcastGoodsRepository.php | 4 +- .../broadcast/BroadcastRoomRepository.php | 18 +- .../store/coupon/StoreCouponRepository.php | 16 +- .../store/order/PresellOrderRepository.php | 36 +- .../store/order/StoreGroupOrderRepository.php | 14 +- .../order/StoreOrderCreateDgRepository.php | 6 +- .../order/StoreOrderCreateRepository.php | 32 +- .../store/order/StoreOrderRepository.php | 350 +- .../store/order/StoreOrderSplitRepository.php | 35 +- .../order/StoreOrderStatusRepository.php | 93 +- .../order/StoreRefundOrderRepository.php | 213 +- .../store/product/ProductAssistRepository.php | 2 +- .../store/product/ProductCopyRepository.php | 22 +- .../product/ProductGroupBuyingRepository.php | 32 +- .../store/product/ProductGroupRepository.php | 2 +- .../product/ProductPresellRepository.php | 6 +- .../store/product/ProductReplyRepository.php | 12 +- .../store/product/ProductRepository.php | 32 +- .../store/product/ProductSkuRepository.php | 3 +- .../store/product/SpuRepository.php | 12 +- .../store/product/StoreDiscountRepository.php | 12 +- .../store/service/StoreServiceRepository.php | 23 +- .../service/StoreServiceUserRepository.php | 25 +- .../repositories/system/CacheRepository.php | 1 - .../system/config/ConfigRepository.php | 27 +- .../system/financial/FinancialRepository.php | 6 +- .../merchant/MerchantIntentionRepository.php | 26 +- .../system/merchant/MerchantRepository.php | 2 +- .../system/serve/ServeMealRepository.php | 9 - .../system/serve/ServeOrderRepository.php | 10 +- .../user/UserExtractRepository.php | 36 +- .../repositories/user/UserOrderRepository.php | 21 +- .../user/UserRelationRepository.php | 60 +- .../repositories/user/UserRepository.php | 50 +- .../wechat/WechatUserRepository.php | 4 +- app/controller/admin/order/Order.php | 16 +- .../admin/store/StoreBrandCategory.php | 1 - app/controller/admin/store/StoreProduct.php | 6 +- app/controller/admin/system/config/Config.php | 14 +- app/controller/admin/system/diy/Diy.php | 11 +- .../admin/system/merchant/Merchant.php | 1 + .../admin/system/service/StoreService.php | 2 +- app/controller/api/Auth.php | 80 +- app/controller/api/Common.php | 17 +- app/controller/api/community/Community.php | 17 +- .../api/community/CommunityReply.php | 3 +- app/controller/api/server/StoreOrder.php | 5 +- app/controller/api/server/StoreProduct.php | 2 - .../api/server/StoreRefundOrder.php | 2 +- .../api/store/merchant/Merchant.php | 123 +- app/controller/api/store/order/StoreOrder.php | 3 +- .../api/store/product/Discounts.php | 4 +- .../api/store/product/StoreCategory.php | 1 - .../api/store/product/StoreCoupon.php | 1 - .../api/store/product/StoreProductPresell.php | 2 +- app/controller/api/store/product/StoreSpu.php | 14 +- app/controller/api/store/service/Service.php | 12 + app/controller/api/user/Admin.php | 2 +- app/controller/api/user/User.php | 19 +- app/controller/api/user/UserExtract.php | 8 + app/controller/api/user/UserRelation.php | 17 +- app/controller/merchant/Common.php | 2 +- app/controller/merchant/store/Excel.php | 14 +- app/controller/merchant/store/StoreImport.php | 27 +- .../store/delivery/DeliveryStation.php | 3 +- app/controller/merchant/store/order/Order.php | 10 +- .../merchant/store/order/RefundOrder.php | 12 +- .../merchant/store/product/Discounts.php | 4 +- .../merchant/store/product/Product.php | 2 +- .../merchant/store/product/ProductSeckill.php | 2 +- .../merchant/store/service/StoreService.php | 2 +- app/controller/service/Login.php | 16 +- app/controller/service/Service.php | 5 +- .../api/MerchantIntentionValidate.php | 2 +- app/validate/api/UserExtractValidate.php | 3 +- .../merchant/StoreProductAdminValidate.php | 2 +- app/webscoket/handler/AdminHandler.php | 4 +- app/webscoket/handler/MerchantHandler.php | 4 +- app/webscoket/handler/ServiceHandler.php | 4 +- app/webscoket/handler/UserHandler.php | 2 +- composer.json | 6 - config/log.php | 4 +- crmeb/jobs/CheckProductPresellJob.php | 2 +- crmeb/jobs/ExpressSyncJob.php | 2 +- crmeb/jobs/GauaranteeCountJob.php | 2 +- crmeb/jobs/OrderReplyJob.php | 14 +- crmeb/jobs/SendNewsJob.php | 3 +- crmeb/jobs/SendSmsJob.php | 1 + crmeb/jobs/SyncProductTopJob.php | 2 +- crmeb/jobs/UserBrokerageLevelJob.php | 1 - crmeb/listens/AuthTakeOrderListen.php | 3 +- crmeb/listens/InitSwooleLockListen.php | 2 + .../listens/ProductGroupStatusCheckListen.php | 2 +- crmeb/listens/RefundOrderAgreeListen.php | 2 +- crmeb/listens/SwooleTaskListen.php | 6 +- crmeb/listens/pay/OrderPaySuccessListen.php | 2 + crmeb/services/CopyProductService.php | 1 - crmeb/services/DownloadImageService.php | 1 + crmeb/services/ExcelService.php | 2 +- crmeb/services/MiniProgramService.php | 191 +- crmeb/services/SmsService.php | 6 +- crmeb/services/WechatService.php | 153 +- .../services/WechatTemplateMessageService.php | 10 +- crmeb/services/delivery/storage/Uupt.php | 1 - crmeb/services/easywechat/BaseClient.php | 22 +- crmeb/services/easywechat/batches/Client.php | 50 + .../easywechat/batches/ServiceProvider.php | 33 + .../easywechat/certficates/Client.php | 2 +- crmeb/services/easywechat/merchant/Client.php | 11 - .../easywechat/miniPayment/Client.php | 101 + .../miniPayment/ServiceProvider.php | 52 + .../easywechat/msgseccheck/Client.php | 113 + .../msgseccheck/ServiceProvider.php | 33 + crmeb/services/easywechat/pay/Client.php | 201 + .../easywechat/pay/ServiceProvider.php | 33 + crmeb/traits/CategoresRepository.php | 3 +- crmeb/utils/Start.php | 110 + route/admin/accounts.php | 6 - route/admin/article.php | 12 - route/admin/attachment.php | 8 - route/admin/order.php | 3 + route/admin/wechat.php | 4 +- route/api.php | 7 +- route/merchant/order.php | 5 +- route/merchant/system.php | 21 +- vendor/composer/platform_check.php | 2 +- vendor/guzzlehttp/command/LICENSE | 19 + vendor/guzzlehttp/command/README.md | 134 + vendor/guzzlehttp/command/composer.json | 36 + vendor/guzzlehttp/command/src/Command.php | 55 + .../command/src/CommandInterface.php | 39 + .../src/Exception/CommandClientException.php | 7 + .../src/Exception/CommandException.php | 109 + .../src/Exception/CommandServerException.php | 7 + .../guzzlehttp/command/src/HasDataTrait.php | 60 + vendor/guzzlehttp/command/src/Result.php | 18 + .../command/src/ResultInterface.php | 9 + .../guzzlehttp/command/src/ServiceClient.php | 217 + .../command/src/ServiceClientInterface.php | 92 + .../command/src/ToArrayInterface.php | 16 + vendor/guzzlehttp/guzzle-services/.travis.yml | 23 + .../guzzlehttp/guzzle-services/CHANGELOG.md | 351 + vendor/guzzlehttp/guzzle-services/LICENSE | 19 + vendor/guzzlehttp/guzzle-services/Makefile | 15 + vendor/guzzlehttp/guzzle-services/README.md | 129 + .../guzzlehttp/guzzle-services/composer.json | 49 + .../guzzle-services/phpunit.xml.dist | 14 + .../guzzle-services/src/Description.php | 265 + .../src/DescriptionInterface.php | 107 + .../guzzle-services/src/Deserializer.php | 294 + .../guzzle-services/src/GuzzleClient.php | 169 + .../Handler/ValidatedDescriptionHandler.php | 82 + .../guzzle-services/src/Operation.php | 312 + .../guzzle-services/src/Parameter.php | 655 + .../QuerySerializerInterface.php | 13 + .../src/QuerySerializer/Rfc3986Serializer.php | 33 + .../src/RequestLocation/AbstractLocation.php | 101 + .../src/RequestLocation/BodyLocation.php | 49 + .../src/RequestLocation/FormParamLocation.php | 84 + .../src/RequestLocation/HeaderLocation.php | 67 + .../src/RequestLocation/JsonLocation.php | 85 + .../src/RequestLocation/MultiPartLocation.php | 76 + .../src/RequestLocation/QueryLocation.php | 92 + .../RequestLocationInterface.php | 44 + .../src/RequestLocation/XmlLocation.php | 328 + .../src/ResponseLocation/AbstractLocation.php | 69 + .../src/ResponseLocation/BodyLocation.php | 39 + .../src/ResponseLocation/HeaderLocation.php | 47 + .../src/ResponseLocation/JsonLocation.php | 176 + .../ResponseLocation/ReasonPhraseLocation.php | 41 + .../ResponseLocationInterface.php | 61 + .../ResponseLocation/StatusCodeLocation.php | 39 + .../src/ResponseLocation/XmlLocation.php | 311 + .../guzzle-services/src/SchemaFormatter.php | 141 + .../guzzle-services/src/SchemaValidator.php | 297 + .../guzzle-services/src/Serializer.php | 164 + .../Exception/CustomCommandException.php | 13 + .../Exception/OtherCustomCommandException.php | 13 + .../guzzle-services/tests/Asset/test.html | 10 + .../guzzle-services/tests/DescriptionTest.php | 184 + .../tests/DeserializerTest.php | 386 + .../tests/GuzzleClientTest.php | 1037 ++ .../ValidatedDescriptionHandlerTest.php | 112 + .../guzzle-services/tests/OperationTest.php | 227 + .../guzzle-services/tests/ParameterTest.php | 378 + .../QuerySerializer/Rfc3986SerializerTest.php | 35 + .../RequestLocation/BodyLocationTest.php | 26 + .../RequestLocation/FormParamLocationTest.php | 52 + .../RequestLocation/HeaderLocationTest.php | 52 + .../RequestLocation/JsonLocationTest.php | 91 + .../RequestLocation/MultiPartLocationTest.php | 33 + .../RequestLocation/QueryLocationTest.php | 77 + .../tests/RequestLocation/XmlLocationTest.php | 525 + .../ResponseLocation/BodyLocationTest.php | 30 + .../ResponseLocation/HeaderLocationTest.php | 31 + .../ResponseLocation/JsonLocationTest.php | 581 + .../ReasonPhraseLocationTest.php | 30 + .../StatusCodeLocationTest.php | 27 + .../ResponseLocation/XmlLocationTest.php | 795 + .../tests/SchemaFormatterTest.php | 60 + .../tests/SchemaValidatorTest.php | 330 + .../guzzle-services/tests/SerializerTest.php | 39 + .../cos-sdk-v5/.github/workflows/format.yml | 37 + .../cos-sdk-v5/.github/workflows/install.yml | 29 + vendor/qcloud/cos-sdk-v5/CHANGELOG.md | 367 + .../qcloud/cos-sdk-v5/sample/ImageSearch.php | 30 + .../cos-sdk-v5/sample/ImageSearchAdd.php | 29 + .../cos-sdk-v5/sample/ImageSearchDelete.php | 27 + .../cos-sdk-v5/sample/ImageSearchOpen.php | 27 + .../qcloud/cos-sdk-v5/sample/addHotLink.php | 30 + .../qcloud/cos-sdk-v5/sample/appendObject.php | 36 + .../cos-sdk-v5/sample/bindCiService.php | 24 + .../cos-sdk-v5/sample/blindWatermark.php | 31 + .../sample/cancelInventoryTriggerJob.php | 26 + .../sample/cancelLiveVideoAuditing.php | 25 + .../cos-sdk-v5/sample/ciTransformation.php | 38 + .../cos-sdk-v5/sample/closeOriginProtect.php | 24 + vendor/qcloud/cos-sdk-v5/sample/copy.php | 31 + vendor/qcloud/cos-sdk-v5/sample/cosClient.php | 30 + .../sample/createDocProcessJobs.php | 49 + .../sample/createFileCompressJobs.php | 54 + .../sample/createFileHashCodeJobs.php | 45 + .../sample/createFileUncompressJobs.php | 49 + .../qcloud/cos-sdk-v5/sample/createFolder.php | 26 + .../sample/createInventoryTriggerJob.php | 39 + .../sample/createMediaAnimationJobs.php | 85 + .../sample/createMediaAnimationTemplate.php | 43 + .../sample/createMediaConcatJobs.php | 100 + .../sample/createMediaConcatTemplate.php | 56 + .../createMediaDigitalWatermarkJobs.php | 45 + ...createMediaExtractDigitalWatermarkJobs.php | 39 + .../sample/createMediaHighSpeedHdTemplate.php | 60 + .../cos-sdk-v5/sample/createMediaJobs.php | 56 + .../sample/createMediaNoiseReductionJobs.php | 39 + .../sample/createMediaPicProcessJobs.php | 71 + .../sample/createMediaPicProcessTemplate.php | 31 + .../sample/createMediaQualityEstimateJobs.php | 42 + .../sample/createMediaSDRtoHDRJobs.php | 45 + .../sample/createMediaSegmentJobs.php | 48 + .../sample/createMediaSmartCoverJobs.php | 50 + .../sample/createMediaSnapshotJobs.php | 81 + .../sample/createMediaSnapshotTemplate.php | 35 + .../sample/createMediaStreamExtractJobs.php | 56 + .../sample/createMediaSuperResolutionJobs.php | 161 + .../createMediaSuperResolutionTemplate.php | 29 + .../sample/createMediaTranscodeJobs.php | 124 + .../sample/createMediaTranscodeTemplate.php | 79 + .../sample/createMediaVideoMontageJobs.php | 87 + .../createMediaVideoMontageTemplate.php | 51 + .../sample/createMediaVideoProcessJobs.php | 157 + .../createMediaVideoProcessTemplate.php | 37 + .../sample/createMediaVideoTagJobs.php | 38 + .../sample/createMediaVoiceSeparateJobs.php | 77 + .../createMediaVoiceSeparateTemplate.php | 34 + .../sample/createMediaWatermarkTemplate.php | 70 + .../cos-sdk-v5/sample/deleteBucketDomain.php | 24 + .../cos-sdk-v5/sample/deleteBucketGuetzli.php | 24 + .../sample/deleteBucketImageStyle.php | 25 + .../cos-sdk-v5/sample/deleteBucketTagging.php | 24 + .../cos-sdk-v5/sample/deleteBucketWebsite.php | 24 + .../cos-sdk-v5/sample/deleteBuckets.php | 52 + .../qcloud/cos-sdk-v5/sample/deleteFolder.php | 48 + .../cos-sdk-v5/sample/deleteObjectTagging.php | 25 + .../cos-sdk-v5/sample/deleteWorkflow.php | 26 + .../sample/describeInventoryTriggerJob.php | 26 + .../sample/describeInventoryTriggerJobs.php | 34 + .../cos-sdk-v5/sample/describeMediaJob.php | 26 + .../cos-sdk-v5/sample/describeMediaJobs.php | 31 + .../sample/describeMediaTemplates.php | 31 + .../cos-sdk-v5/sample/describeWorkflow.php | 29 + .../qcloud/cos-sdk-v5/sample/detectAudio.php | 67 + .../cos-sdk-v5/sample/detectDocument.php | 63 + .../qcloud/cos-sdk-v5/sample/detectImage.php | 55 + .../qcloud/cos-sdk-v5/sample/detectImages.php | 56 + .../qcloud/cos-sdk-v5/sample/detectLable.php | 25 + .../cos-sdk-v5/sample/detectLiveVideo.php | 43 + .../qcloud/cos-sdk-v5/sample/detectText.php | 71 + .../qcloud/cos-sdk-v5/sample/detectVideo.php | 77 + .../qcloud/cos-sdk-v5/sample/detectVirus.php | 44 + .../cos-sdk-v5/sample/detectWebpage.php | 33 + .../cos-sdk-v5/sample/document2dstType.php | 64 + .../cos-sdk-v5/sample/doesBucketExist.php | 24 + .../cos-sdk-v5/sample/doesObjectExist.php | 25 + vendor/qcloud/cos-sdk-v5/sample/download.php | 38 + .../cos-sdk-v5/sample/downloadFolder.php | 52 + .../cos-sdk-v5/sample/fileJobs4Hash.php | 33 + .../cos-sdk-v5/sample/getActionSequence.php | 24 + .../cos-sdk-v5/sample/getBlindWatermark.php | 35 + .../cos-sdk-v5/sample/getBucketAccelerate.php | 24 + .../cos-sdk-v5/sample/getBucketDomain.php | 24 + .../cos-sdk-v5/sample/getBucketGuetzli.php | 24 + .../cos-sdk-v5/sample/getBucketImageStyle.php | 25 + .../cos-sdk-v5/sample/getBucketInventory.php | 25 + .../cos-sdk-v5/sample/getBucketLogging.php | 24 + .../cos-sdk-v5/sample/getBucketReferer.php | 25 + .../cos-sdk-v5/sample/getBucketTagging.php | 24 + .../cos-sdk-v5/sample/getBucketWebsite.php | 24 + .../qcloud/cos-sdk-v5/sample/getCiService.php | 24 + .../sample/getDescribeDocProcessBuckets.php | 30 + .../sample/getDescribeDocProcessJob.php | 25 + .../sample/getDescribeDocProcessJobs.php | 32 + .../sample/getDescribeDocProcessQueues.php | 24 + .../sample/getDescribeMediaBuckets.php | 29 + .../sample/getDescribeMediaQueues.php | 31 + .../getDescribeMediaVoiceSeparateJob.php | 25 + .../sample/getDetectAudioResult.php | 25 + .../sample/getDetectDocumentResult.php | 25 + .../sample/getDetectImageResult.php | 25 + .../cos-sdk-v5/sample/getDetectTextResult.php | 25 + .../sample/getDetectVideoResult.php | 25 + .../sample/getDetectVirusResult.php | 25 + .../sample/getDetectWebpageResult.php | 25 + .../sample/getFileCompressResult.php | 26 + .../sample/getFileHashCodeResult.php | 26 + .../sample/getFileProcessQueueList.php | 29 + .../sample/getFileUncompressResult.php | 26 + .../qcloud/cos-sdk-v5/sample/getHotLink.php | 24 + .../qcloud/cos-sdk-v5/sample/getLiveCode.php | 24 + .../qcloud/cos-sdk-v5/sample/getMediaInfo.php | 29 + .../getObjectSensitiveContentRecognition.php | 52 + .../cos-sdk-v5/sample/getObjectTagging.php | 24 + .../qcloud/cos-sdk-v5/sample/getObjectUrl.php | 40 + .../sample/getObjectWithoutSign.php | 26 + .../cos-sdk-v5/sample/getOriginProtect.php | 24 + .../cos-sdk-v5/sample/getPresignedUrl.php | 30 + .../cos-sdk-v5/sample/getPrivateM3U8.php | 28 + .../qcloud/cos-sdk-v5/sample/getSnapshot.php | 41 + .../cos-sdk-v5/sample/getWorkflowInstance.php | 26 + .../sample/getWorkflowInstances.php | 33 + vendor/qcloud/cos-sdk-v5/sample/iDCardOCR.php | 38 + .../sample/imageAssessQualityProcess.php | 26 + vendor/qcloud/cos-sdk-v5/sample/imageAve.php | 25 + .../sample/imageDetectCarProcess.php | 26 + .../cos-sdk-v5/sample/imageDetectFace.php | 26 + vendor/qcloud/cos-sdk-v5/sample/imageExif.php | 25 + .../cos-sdk-v5/sample/imageFaceEffect.php | 32 + vendor/qcloud/cos-sdk-v5/sample/imageInfo.php | 25 + vendor/qcloud/cos-sdk-v5/sample/imageMogr.php | 30 + .../qcloud/cos-sdk-v5/sample/imageProcess.php | 31 + .../cos-sdk-v5/sample/imageProcessBright.php | 57 + .../cos-sdk-v5/sample/imageProcessChannel.php | 65 + .../sample/imageProcessContrast.php | 57 + .../cos-sdk-v5/sample/imageProcessCrop.php | 62 + .../cos-sdk-v5/sample/imageProcessFormat.php | 58 + .../sample/imageProcessFormatAvif.php | 55 + .../sample/imageProcessFormatHeif.php | 55 + .../sample/imageProcessFormatSvgc.php | 55 + .../sample/imageProcessFormatTpg.php | 55 + .../sample/imageProcessFormatWebp.php | 55 + .../sample/imageProcessGaussianBlur.php | 56 + .../sample/imageProcessGrayscale.php | 57 + .../sample/imageProcessImageView.php | 61 + .../cos-sdk-v5/sample/imageProcessQuality.php | 58 + .../cos-sdk-v5/sample/imageProcessRotate.php | 58 + .../cos-sdk-v5/sample/imageProcessSharpen.php | 57 + .../sample/imageProcessSizeLimit.php | 57 + .../cos-sdk-v5/sample/imageProcessStrip.php | 57 + .../sample/imageProcessThumbnail.php | 68 + .../sample/imageProcessWatermarkImage.php | 65 + .../sample/imageProcessWatermarkText.php | 66 + .../cos-sdk-v5/sample/imageRepairProcess.php | 65 + vendor/qcloud/cos-sdk-v5/sample/imageView.php | 32 + .../cos-sdk-v5/sample/imageWatermark.php | 33 + .../qcloud/cos-sdk-v5/sample/listBuckets.php | 23 + .../sample/openFileProcessService.php | 25 + .../cos-sdk-v5/sample/openOriginProtect.php | 24 + .../sample/opticalOcrRecognition.php | 33 + .../cos-sdk-v5/sample/picOperations.php | 33 + .../cos-sdk-v5/sample/putBlindWatermark.php | 34 + .../cos-sdk-v5/sample/putBucketAccelerate.php | 25 + .../cos-sdk-v5/sample/putBucketDomain.php | 33 + .../cos-sdk-v5/sample/putBucketGuetzli.php | 24 + .../cos-sdk-v5/sample/putBucketImageStyle.php | 26 + .../cos-sdk-v5/sample/putBucketInventory.php | 45 + .../cos-sdk-v5/sample/putBucketLogging.php | 28 + .../cos-sdk-v5/sample/putBucketReferer.php | 35 + .../cos-sdk-v5/sample/putBucketTagging.php | 32 + .../cos-sdk-v5/sample/putBucketWebsite.php | 46 + .../cos-sdk-v5/sample/putImageStyle.php | 33 + .../cos-sdk-v5/sample/putObjectTagging.php | 33 + vendor/qcloud/cos-sdk-v5/sample/putQrcode.php | 34 + vendor/qcloud/cos-sdk-v5/sample/qrcode.php | 27 + .../cos-sdk-v5/sample/qrcodeGenerate.php | 28 + .../cos-sdk-v5/sample/selectObjectContent.php | 85 + .../cos-sdk-v5/sample/textWatermark.php | 31 + .../qcloud/cos-sdk-v5/sample/trafficLimit.php | 40 + .../cos-sdk-v5/sample/triggerWorkflow.php | 28 + .../cos-sdk-v5/sample/unBindCiService.php | 24 + .../sample/updateDocProcessQueue.php | 35 + .../sample/updateFileProcessQueue.php | 38 + .../sample/updateMediaAnimationTemplate.php | 45 + .../sample/updateMediaConcatTemplate.php | 57 + .../sample/updateMediaHighSpeedHdTemplate.php | 61 + .../sample/updateMediaPicProcessTemplate.php | 32 + .../cos-sdk-v5/sample/updateMediaQueue.php | 39 + .../sample/updateMediaSnapshotTemplate.php | 36 + .../updateMediaSuperResolutionTemplate.php | 30 + .../sample/updateMediaTranscodeTemplate.php | 80 + .../updateMediaVideoMontageTemplate.php | 52 + .../updateMediaVideoProcessTemplate.php | 37 + .../updateMediaVoiceSeparateTemplate.php | 35 + .../sample/updateMediaWatermarkTemplate.php | 72 + .../qcloud/cos-sdk-v5/sample/uploadFolder.php | 42 + vendor/qcloud/cos-sdk-v5/src/Client.php | 577 + .../src/CommandToRequestTransformer.php | 379 + vendor/qcloud/cos-sdk-v5/src/Common.php | 69 + vendor/qcloud/cos-sdk-v5/src/Copy.php | 140 + vendor/qcloud/cos-sdk-v5/src/Descriptions.php | 12885 ++++++++++++++++ .../cos-sdk-v5/src/Exception/CosException.php | 5 + .../Exception/ServiceResponseException.php | 189 + .../cos-sdk-v5/src/ExceptionMiddleware.php | 71 + .../qcloud/cos-sdk-v5/src/ExceptionParser.php | 112 + .../BlindWatermarkTemplate.php | 87 + .../CIParamTransformation.php | 39 + .../CIProcessTransformation.php | 31 + .../ImageParamTemplate/ImageMogrTemplate.php | 374 + .../ImageQrcodeTemplate.php | 37 + .../ImageParamTemplate/ImageStyleTemplate.php | 33 + .../src/ImageParamTemplate/ImageTemplate.php | 18 + .../ImageParamTemplate/ImageViewTemplate.php | 115 + .../ImageWatermarkTemplate.php | 212 + .../PicOperationsTransformation.php | 64 + .../TextWatermarkTemplate.php | 180 + .../qcloud/cos-sdk-v5/src/MultipartUpload.php | 167 + .../qcloud/cos-sdk-v5/src/RangeDownload.php | 145 + .../cos-sdk-v5/src/Request/BodyLocation.php | 49 + .../cos-sdk-v5/src/ResultTransformer.php | 260 + vendor/qcloud/cos-sdk-v5/src/Serializer.php | 81 + vendor/qcloud/cos-sdk-v5/src/Service.php | 7407 +++++++++ vendor/qcloud/cos-sdk-v5/src/Signature.php | 124 + .../cos-sdk-v5/src/SignatureMiddleware.php | 23 + vendor/symfony/polyfill-php80/PhpToken.php | 103 + .../Resources/stubs/Attribute.php | 31 + .../Resources/stubs/PhpToken.php | 16 + .../Resources/stubs/UnhandledMatchError.php | 16 + .../translation-contracts/CHANGELOG.md | 5 + .../TranslatableInterface.php | 20 + 468 files changed, 45944 insertions(+), 1042 deletions(-) create mode 100644 crmeb/services/easywechat/batches/Client.php create mode 100644 crmeb/services/easywechat/batches/ServiceProvider.php create mode 100644 crmeb/services/easywechat/miniPayment/Client.php create mode 100644 crmeb/services/easywechat/miniPayment/ServiceProvider.php create mode 100644 crmeb/services/easywechat/msgseccheck/Client.php create mode 100644 crmeb/services/easywechat/msgseccheck/ServiceProvider.php create mode 100644 crmeb/services/easywechat/pay/Client.php create mode 100644 crmeb/services/easywechat/pay/ServiceProvider.php create mode 100644 crmeb/utils/Start.php create mode 100644 vendor/guzzlehttp/command/LICENSE create mode 100644 vendor/guzzlehttp/command/README.md create mode 100644 vendor/guzzlehttp/command/composer.json create mode 100644 vendor/guzzlehttp/command/src/Command.php create mode 100644 vendor/guzzlehttp/command/src/CommandInterface.php create mode 100644 vendor/guzzlehttp/command/src/Exception/CommandClientException.php create mode 100644 vendor/guzzlehttp/command/src/Exception/CommandException.php create mode 100644 vendor/guzzlehttp/command/src/Exception/CommandServerException.php create mode 100644 vendor/guzzlehttp/command/src/HasDataTrait.php create mode 100644 vendor/guzzlehttp/command/src/Result.php create mode 100644 vendor/guzzlehttp/command/src/ResultInterface.php create mode 100644 vendor/guzzlehttp/command/src/ServiceClient.php create mode 100644 vendor/guzzlehttp/command/src/ServiceClientInterface.php create mode 100644 vendor/guzzlehttp/command/src/ToArrayInterface.php create mode 100644 vendor/guzzlehttp/guzzle-services/.travis.yml create mode 100644 vendor/guzzlehttp/guzzle-services/CHANGELOG.md create mode 100644 vendor/guzzlehttp/guzzle-services/LICENSE create mode 100644 vendor/guzzlehttp/guzzle-services/Makefile create mode 100644 vendor/guzzlehttp/guzzle-services/README.md create mode 100644 vendor/guzzlehttp/guzzle-services/composer.json create mode 100644 vendor/guzzlehttp/guzzle-services/phpunit.xml.dist create mode 100644 vendor/guzzlehttp/guzzle-services/src/Description.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/DescriptionInterface.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/Deserializer.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/GuzzleClient.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/Handler/ValidatedDescriptionHandler.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/Operation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/Parameter.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/QuerySerializer/Rfc3986Serializer.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/AbstractLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/BodyLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/FormParamLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/HeaderLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/JsonLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/MultiPartLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/QueryLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/RequestLocationInterface.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/RequestLocation/XmlLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/AbstractLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/BodyLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/HeaderLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/JsonLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ReasonPhraseLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ResponseLocationInterface.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/StatusCodeLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/ResponseLocation/XmlLocation.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/SchemaFormatter.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php create mode 100644 vendor/guzzlehttp/guzzle-services/src/Serializer.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/Asset/Exception/CustomCommandException.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/Asset/Exception/OtherCustomCommandException.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/Asset/test.html create mode 100644 vendor/guzzlehttp/guzzle-services/tests/DescriptionTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/DeserializerTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/GuzzleClientTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/Handler/ValidatedDescriptionHandlerTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/OperationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/ParameterTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/QuerySerializer/Rfc3986SerializerTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/RequestLocation/BodyLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/RequestLocation/FormParamLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/RequestLocation/HeaderLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/RequestLocation/JsonLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/RequestLocation/MultiPartLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/RequestLocation/QueryLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/RequestLocation/XmlLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/BodyLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/HeaderLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/JsonLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/ReasonPhraseLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/StatusCodeLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/XmlLocationTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/SchemaFormatterTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/SchemaValidatorTest.php create mode 100644 vendor/guzzlehttp/guzzle-services/tests/SerializerTest.php create mode 100644 vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml create mode 100644 vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml create mode 100644 vendor/qcloud/cos-sdk-v5/CHANGELOG.md create mode 100644 vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/addHotLink.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/appendObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/bindCiService.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/copy.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/cosClient.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteWorkflow.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/describeMediaJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/describeMediaJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/describeMediaTemplates.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/describeWorkflow.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectAudio.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectDocument.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectImage.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectImages.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectLable.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectLiveVideo.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectText.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectVideo.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectVirus.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/document2dstType.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/download.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/fileJobs4Hash.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getActionSequence.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getCiService.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessBuckets.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaBuckets.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaQueues.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getFileCompressResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getFileHashCodeResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getFileProcessQueueList.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getFileUncompressResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getHotLink.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getLiveCode.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getOriginProtect.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getPrivateM3U8.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstance.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstances.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/iDCardOCR.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageAssessQualityProcess.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageAve.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageDetectCarProcess.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageDetectFace.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageExif.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageFaceEffect.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageInfo.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageMogr.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcess.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessBright.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessChannel.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessContrast.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessCrop.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessFormat.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatAvif.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatHeif.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatSvgc.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatTpg.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatWebp.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessGaussianBlur.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessGrayscale.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessImageView.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessQuality.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessRotate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessSharpen.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessSizeLimit.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessStrip.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessThumbnail.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkImage.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkText.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageRepairProcess.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageView.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/listBuckets.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/openFileProcessService.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/openOriginProtect.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/opticalOcrRecognition.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/picOperations.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putQrcode.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/qrcode.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/textWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/triggerWorkflow.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/unBindCiService.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateDocProcessQueue.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateFileProcessQueue.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaAnimationTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaConcatTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaHighSpeedHdTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaPicProcessTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaQueue.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaSnapshotTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaSuperResolutionTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaTranscodeTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoMontageTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoProcessTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaVoiceSeparateTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/updateMediaWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Client.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Common.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Copy.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Descriptions.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Exception/ServiceResponseException.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIProcessTransformation.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageViewTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/RangeDownload.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Serializer.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Service.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Signature.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php create mode 100644 vendor/symfony/polyfill-php80/PhpToken.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php create mode 100644 vendor/symfony/translation-contracts/CHANGELOG.md create mode 100644 vendor/symfony/translation-contracts/TranslatableInterface.php diff --git a/app/common.php b/app/common.php index d2e2494a..f614901e 100644 --- a/app/common.php +++ b/app/common.php @@ -593,6 +593,7 @@ if (!function_exists('image_to_base64')) { */ function image_to_base64($avatar = '', $timeout = 9) { + checkSuffix($avatar); try { $url = parse_url($avatar); $url = $url['host']; @@ -1024,14 +1025,15 @@ if (!function_exists('filter_emoji')) { } } -/** - * 高德经纬度改百度经纬度 - * @param $lng 经度 - * @param $lat 纬度 - * @return mixed +/* + * TODO 腾讯地图转换百度地图 GCJ02 转 BD09 + * 中国正常GCJ02坐标---->百度地图BD09坐标 + * 腾讯地图/高德地图用的也是GCJ02坐标 + * @param double $lat 纬度 + * @param double $lng 经度 */ -if (!function_exists('bd_encrypt')) { - function bd_encrypt($lng, $lat) +if (!function_exists('gcj02ToBd09')) { + function gcj02ToBd09($lng, $lat) { $x_pi = 3.14159265358979324 * 3000.0 / 180.0; $x = $lng; @@ -1039,9 +1041,9 @@ if (!function_exists('bd_encrypt')) { $z = sqrt($x * $x + $y * $y) - 0.00002 * sin($y * $x_pi); $theta = atan2($y, $x) - 0.000003 * cos($x * $x_pi); - $data['lng'] = $z * cos($theta) + 0.0065; - $data['lat'] = $z * sin($theta) + 0.006; - return $data; + $lng = $z * cos($theta) + 0.0065; + $lat = $z * sin($theta) + 0.006; + return [$lng,$lat]; } } @@ -1126,6 +1128,32 @@ if (!function_exists('aj_get_serevice')) { return $service; } } + +if (!function_exists('checkSuffix')) { + function checkSuffix($data) + { + $suffix = \think\facade\Config::get('upload.fileExt'); + if (is_array($data)){ + foreach ($data as $datum) { + if (strpos($datum,'phar://') !== false) + throw new \think\exception\ValidateException('操作失败'); + $result = pathinfo($datum); + if (isset($result['extension']) && !in_array($result['extension'],$suffix)) { + throw new \think\exception\ValidateException('文件后缀不允许'); + } + } + } else { + if (strpos($data,'phar://') !== false ) + throw new \think\exception\ValidateException('操作失败'); + $result = pathinfo($data); + if (isset($result['extension']) && !in_array($result['extension'],$suffix)) { + throw new \think\exception\ValidateException('文件后缀不允许'); + } + } + return ; + } +} + if (!function_exists('validateIDCard')) { function validateIDCard(string $idcard) diff --git a/app/common/dao/community/CommunityDao.php b/app/common/dao/community/CommunityDao.php index 2176c668..e14f4e03 100644 --- a/app/common/dao/community/CommunityDao.php +++ b/app/common/dao/community/CommunityDao.php @@ -15,6 +15,7 @@ namespace app\common\dao\community; use app\common\dao\BaseDao; use app\common\model\community\Community; +use app\common\model\system\Relevance; use app\common\repositories\system\RelevanceRepository; class CommunityDao extends BaseDao @@ -33,7 +34,6 @@ class CommunityDao extends BaseDao }); $query->where(true); }); - $query ->when(isset($where['keyword']) && $where['keyword'] !== '', function ($query) use($where) { $query->whereLike('Community.title',"%{$where['keyword']}%"); @@ -73,8 +73,12 @@ class CommunityDao extends BaseDao }) ->when(isset($where['category_id']) && $where['category_id'] !== '', function ($query) use($where) { $query->where('Community.category_id',$where['category_id']); - })->when(isset($where['no_category_id']) && $where['no_category_id'] ==69, function ($query) use($where) { - $query->where('Community.category_id','<>',69); + }) + ->when(isset($where['spu_id']) && $where['spu_id'] !== '', function ($query) use($where) { + $id = Relevance::where('right_id', $where['spu_id']) + ->where('type',RelevanceRepository::TYPE_COMMUNITY_PRODUCT) + ->column('left_id'); + $query->where('community_id','in', $id); }); $order = 'Community.create_time DESC'; diff --git a/app/common/dao/store/coupon/StoreCouponDao.php b/app/common/dao/store/coupon/StoreCouponDao.php index 3470427c..c8226263 100644 --- a/app/common/dao/store/coupon/StoreCouponDao.php +++ b/app/common/dao/store/coupon/StoreCouponDao.php @@ -128,17 +128,17 @@ class StoreCouponDao extends BaseDao $query->where('C.type', $where['type']); } }) - ->when(isset($where['send_type']) && $where['send_type'] != '', function($query) use($where){ + ->when(isset($where['send_type']) && $where['send_type'] !== '', function($query) use($where){ $query->where('C.send_type', $where['send_type']); }) - ->when(isset($where['not_svip']) && $where['not_svip'] != '', function($query) use($where){ + ->when(isset($where['not_svip']) && $where['not_svip'] !== '', function($query) use($where){ $query->where('C.send_type', '<>',StoreCouponRepository::GET_COUPON_TYPE_SVIP); }) ->when($uid, function($query) use($uid){ $couponId = StoreCouponUser::where('uid',$uid)->whereIn('status',[1,2])->column('coupon_id'); $query->whereNotIn('C.coupon_id', $couponId); }) - ->when(isset($where['mer_id']) && $where['mer_id'] != '', function($query) use($where){ + ->when(isset($where['mer_id']) && $where['mer_id'] !== '', function($query) use($where){ $query->where('C.mer_id', $where['mer_id']); }) ->where(function (BaseQuery $query) { diff --git a/app/common/dao/store/order/StoreOrderDao.php b/app/common/dao/store/order/StoreOrderDao.php index 8284e006..94af4f07 100644 --- a/app/common/dao/store/order/StoreOrderDao.php +++ b/app/common/dao/store/order/StoreOrderDao.php @@ -200,15 +200,6 @@ class StoreOrderDao extends BaseDao return $query; } - public function groupBuyingStatus(array $orderIds, $status) - { - if (!count($orderIds)) return 0; - $make = app()->make(StoreOrderStatusRepository::class); - foreach ($orderIds as $id){ - $make->status($id,$make::ORDER_STATUS_GROUP_SUCCESS,'拼团成功'); - } - return StoreOrder::getDB()->whereIn('order_id', $orderIds)->update(compact('status')); - } /** * @param $id diff --git a/app/common/dao/store/order/StoreOrderProductDao.php b/app/common/dao/store/order/StoreOrderProductDao.php index 0461cf44..d60cbba0 100644 --- a/app/common/dao/store/order/StoreOrderProductDao.php +++ b/app/common/dao/store/order/StoreOrderProductDao.php @@ -53,7 +53,7 @@ class StoreOrderProductDao extends BaseDao public function userOrderProduct($id, $uid) { return StoreOrderProduct::getDB()->where('uid', $uid)->where('order_product_id', $id)->with(['orderInfo' => function (Relation $query) { - $query->field('order_id,mer_id')->where('status', 2); + $query->field('order_id,order_sn,mer_id')->where('status', 2); }])->find(); } @@ -133,14 +133,11 @@ class StoreOrderProductDao extends BaseDao public function getUserPayProduct(?string $keyword, int $uid) { $query = StoreOrderProduct::hasWhere('spu',function($query) use($keyword){ - $query->when($keyword, function ($query) use($keyword) { $query->whereLike('store_name',"%{$keyword}%"); }); - $query->where('product_type',0); }); - $query->where('uid', $uid)->where('StoreOrderProduct.product_type',0); return $query; } diff --git a/app/common/dao/store/order/StoreOrderStatusDao.php b/app/common/dao/store/order/StoreOrderStatusDao.php index 1514b39c..050fcee1 100644 --- a/app/common/dao/store/order/StoreOrderStatusDao.php +++ b/app/common/dao/store/order/StoreOrderStatusDao.php @@ -43,9 +43,22 @@ class StoreOrderStatusDao extends BaseDao * @author xaboy * @day 2020/6/12 */ - public function search($id) + public function search($where) { - return $query = ($this->getModel()::getDB())->where('order_id', $id); + $query = ($this->getModel()::getDB()) + ->when(isset($where['id']) && $where['id'] !== '', function($query) use($where){ + $query->where('order_id', $where['id']); + }) + ->when(isset($where['type']) && $where['type'] !== '', function($query) use($where){ + $query->where('type', $where['type']); + }) + ->when(isset($where['user_type']) && $where['user_type'] !== '', function($query) use($where){ + $query->where('user_type', $where['user_type']); + }) + ->when(isset($where['date']) && $where['date'] !== '', function($query) use($where){ + getModelTime($query, $where['date'],'change_time'); + }); + return $query; } public function getTimeoutDeliveryOrder($end) diff --git a/app/common/dao/store/product/ProductDao.php b/app/common/dao/store/product/ProductDao.php index a898bd24..a90a7233 100644 --- a/app/common/dao/store/product/ProductDao.php +++ b/app/common/dao/store/product/ProductDao.php @@ -138,11 +138,6 @@ class ProductDao extends BaseDao else if ($where['hot_type'] == 'good') $query->where('is_benefit', 1); }) - ->when(isset($where['pid']) && $where['pid'] !== '', function ($query) use ($where) { - $storeCategoryRepository = app()->make(StoreCategoryRepository::class); - $ids = array_merge($storeCategoryRepository->findChildrenId((int)$where['pid']), [(int)$where['pid']]); - if (count($ids)) $query->whereIn('cate_id', $ids); - }) ->when(isset($where['us_status']) && $where['us_status'] !== '', function ($query) use ($where) { if ($where['us_status'] == 0) { $query->where('Product.is_show', 0)->where('Product.is_used', 1)->where('Product.status',1); @@ -162,6 +157,9 @@ class ProductDao extends BaseDao ->when(isset($where['sys_labels']) && $where['sys_labels'] !== '', function ($query) use ($where) { $query->whereLike('U.sys_labels', "%,{$where['sys_labels']},%"); }) + ->when(isset($where['svip_price_type']) && $where['svip_price_type'] !== '', function ($query) use ($where) { + $query->where('Product.svip_price_type',$where['svip_price_type']); + }) ->when(isset($where['order']), function ($query) use ($where, $merId) { if(in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales']) ){ if ($where['order'] == 'price_asc') { @@ -391,11 +389,12 @@ class ProductDao extends BaseDao * @author Qinii * @day 2020-07-09 */ - public function decCareCount(int $productId) + public function decCareCount(array $productId) { - ($this->getModel()::getDB())->where($this->getPk(), $productId)->where('care_count', '>', 0)->dec('care_count', 1)->update(); + ($this->getModel()::getDB())->whereIn($this->getPk(), $productId)->where('care_count', '>', 0)->dec('care_count', 1)->update(); } + /** * TODO api展示的商品条件 * @return array diff --git a/app/common/dao/store/product/ProductGroupUserDao.php b/app/common/dao/store/product/ProductGroupUserDao.php index 27984439..7a1b81b8 100644 --- a/app/common/dao/store/product/ProductGroupUserDao.php +++ b/app/common/dao/store/product/ProductGroupUserDao.php @@ -36,6 +36,6 @@ class ProductGroupUserDao extends BaseDao public function groupOrderIds($productGroupId) { - return ProductGroupUser::getDB()->where('group_buying_id', $productGroupId)->where('order_id', '>', 0)->column('order_id'); + return ProductGroupUser::getDB()->where('group_buying_id', $productGroupId)->where('order_id', '>', 0)->select(); } } diff --git a/app/common/dao/store/product/ProductSkuDao.php b/app/common/dao/store/product/ProductSkuDao.php index bbdaf011..bcb4f79e 100644 --- a/app/common/dao/store/product/ProductSkuDao.php +++ b/app/common/dao/store/product/ProductSkuDao.php @@ -23,9 +23,9 @@ class ProductSkuDao extends BaseDao return ProductSku::class; } - public function clear(array $id, int $type) + public function clear(int $id, int $type) { - $this->getModel()::getDB()->whereIn('active_id', $id)->where('active_type', $type)->delete(); + $this->getModel()::getDB()->where('active_id', $id)->where('active_type', $type)->delete(); } public function descStock(int $active_id, string $unique, int $desc) diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index e47540d3..8c595525 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -29,7 +29,7 @@ class SpuDao extends BaseDao { $order = 'P.sort DESC'; if(isset($where['order'])){ - if(in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales','is_benefit'])){ + if(in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales'])){ if ($where['order'] == 'price_asc') { $order = 'S.price ASC'; } else if ($where['order'] == 'price_desc') { @@ -80,18 +80,6 @@ class SpuDao extends BaseDao $query->whereIn('P.mer_id',$merId); }) - ->when(isset($where['merchant_category_id']) && $where['merchant_category_id'] !== '',function($query)use($where){ - $merId = app()->make(MerchantRepository::class)->search([ - 'merchant_category_id' => $where['merchant_category_id'], - 'status' => 1, - 'mer_state' => 1, - 'is_del' => 1, - ])->column('mer_id'); - $query->whereIn('P.mer_id',$merId); - }) - ->when(isset($where['is_good']) && $where['is_good'] !== '',function($query)use($where){ - $query->where('P.is_good',$where['is_good']); - }) ->when(isset($where['cate_pid']) && $where['cate_pid'], function ($query) use ($where) { $storeCategoryRepository = app()->make(StoreCategoryRepository::class); if (is_array($where['cate_pid'])) { diff --git a/app/common/dao/store/product/StoreDiscountProductDao.php b/app/common/dao/store/product/StoreDiscountProductDao.php index a1098a79..22caf722 100644 --- a/app/common/dao/store/product/StoreDiscountProductDao.php +++ b/app/common/dao/store/product/StoreDiscountProductDao.php @@ -27,11 +27,7 @@ class StoreDiscountProductDao extends BaseDao public function clear($id) { - return Db::transaction(function () use($id){ - $discount_product_id = $this->getModel()::getDb()->where('discount_id',$id)->column('discount_product_id'); - $this->getModel()::getDb()->where('discount_id',$id)->delete(); - app()->make(ProductSkuRepository::class)->clear($discount_product_id, 10); - }); + $this->getModel()::getDb()->where('discount_id',$id)->delete(); } } diff --git a/app/common/dao/store/service/StoreServiceDao.php b/app/common/dao/store/service/StoreServiceDao.php index 77a62a69..0e3e832a 100644 --- a/app/common/dao/store/service/StoreServiceDao.php +++ b/app/common/dao/store/service/StoreServiceDao.php @@ -163,7 +163,7 @@ class StoreServiceDao extends BaseDao public function getRandService($merId) { - $services = StoreService::getDB()->where('mer_id', $merId)->where('is_del', 0)->where('status', 1)->order('status DESC, sort DESC, create_time ASC') + $services = StoreService::getDB()->where('mer_id', $merId)->where('is_open',1)->where('is_del', 0)->where('status', 1)->order('status DESC, sort DESC, create_time ASC') ->hidden(['is_del'])->select(); if (!$services || !count($services)) return null; if (count($services) === 1) $services[0]; @@ -181,7 +181,7 @@ class StoreServiceDao extends BaseDao */ public function getValidServiceInfo($id) { - return StoreService::getDB()->where('service_id', $id)->where('status', 1)->where('is_del', 0)->hidden(['is_del'])->find(); + return StoreService::getDB()->where('service_id', $id)->where('is_open',1)->where('status', 1)->where('is_del', 0)->hidden(['is_del'])->find(); } /** diff --git a/app/common/dao/system/merchant/MerchantDao.php b/app/common/dao/system/merchant/MerchantDao.php index 7a343bc9..ae6db49c 100644 --- a/app/common/dao/system/merchant/MerchantDao.php +++ b/app/common/dao/system/merchant/MerchantDao.php @@ -100,9 +100,7 @@ class MerchantDao extends BaseDao $query->when($order, function ($query) use ($where, $order) { if ($order == 'rate') { $query->order('is_best DESC, product_score DESC,service_score DESC,postage_score DESC'); - } else if ($order == 'sales'){ - $query->order('sales DESC,is_best DESC,sort DESC'); - }else if ($order == 'location' && isset($where['location']['long'], $where['location']['lat'])) { + } else if ($order == 'location' && isset($where['location']['long'], $where['location']['lat'])) { $lng = (float)$where['location']['long']; $lat = (float)$where['location']['lat']; $query->whereNotNull('lat')->whereNotNull('long') @@ -168,9 +166,9 @@ class MerchantDao extends BaseDao * @param int $merId * @author Qinii */ - public function decCareCount(int $merId) + public function decCareCount(array $merId) { - ($this->getModel()::getDB())->where($this->getPk(), $merId)->where('care_count', '>', 0)->dec('care_count', 1)->update(); + ($this->getModel()::getDB())->whereIn($this->getPk(), $merId)->where('care_count', '>', 0)->dec('care_count', 1)->update(); } public function dateMerchantNum($date) diff --git a/app/common/dao/user/UserBillDao.php b/app/common/dao/user/UserBillDao.php index fc4bca8b..088cd0fe 100644 --- a/app/common/dao/user/UserBillDao.php +++ b/app/common/dao/user/UserBillDao.php @@ -112,11 +112,7 @@ class UserBillDao extends BaseDao public function lockBrokerage($uid) { $lst = UserBill::getDB()->where('category', 'brokerage') - ->whereIn('type', ['order_one', 'order_two']) - ->where('uid', $uid) - ->where('status', 0) - ->field('link_id,number') - ->select()->toArray(); + ->whereIn('type', ['order_one', 'order_two'])->where('uid', $uid)->where('status', 0)->field('link_id,number')->select()->toArray(); $refundPrice = 0; if (count($lst)) { $refundPrice = -1 * UserBill::getDB()->whereIn('link_id', array_column($lst, 'link_id'))->where('uid', $uid) @@ -234,9 +230,6 @@ class UserBillDao extends BaseDao ->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) { $query->where('mer_id', $where['mer_id']); }) - ->when(isset($where['source']) && $where['source'] !== '', function ($query) use ($where) { - $query->where('source', $where['source']); - }) ->when(isset($where['link_id']) && $where['link_id'] !== '', function ($query) use ($where) { $query->where('link_id', $where['link_id']); }); diff --git a/app/common/dao/user/UserDao.php b/app/common/dao/user/UserDao.php index 31da0c1d..be9e9159 100644 --- a/app/common/dao/user/UserDao.php +++ b/app/common/dao/user/UserDao.php @@ -350,7 +350,7 @@ class UserDao extends BaseDao public function decSpreadCount($uid) { - User::getDB()->where('uid', $uid)->update([ + User::getDB()->where('uid', $uid)->where('spread_count','>',0)->update([ 'spread_count' => Db::raw('spread_count - 1') ]); } diff --git a/app/common/dao/user/UserExtractDao.php b/app/common/dao/user/UserExtractDao.php index 95ffb0bb..8323d69c 100644 --- a/app/common/dao/user/UserExtractDao.php +++ b/app/common/dao/user/UserExtractDao.php @@ -44,8 +44,6 @@ class UserExtractDao extends BaseDao $query->where('UserExtract.real_name','%'.$where['real_name'].'%'); })->when(isset($where['date']) && $where['date'] != '',function($query)use($where){ getModelTime($query, $where['date']); - })->when(isset($where['source']) && $where['source'] != '',function($query)use($where){ - $query->where('UserExtract.source',$where['source']); })->order('UserExtract.create_time DESC'); return $query; diff --git a/app/common/dao/user/UserRechargeDao.php b/app/common/dao/user/UserRechargeDao.php index b280de03..e83ae529 100644 --- a/app/common/dao/user/UserRechargeDao.php +++ b/app/common/dao/user/UserRechargeDao.php @@ -16,6 +16,7 @@ namespace app\common\dao\user; use app\common\dao\BaseDao; use app\common\model\user\UserRecharge; +use app\common\repositories\store\order\StoreOrderRepository; use think\db\BaseQuery; /** @@ -40,7 +41,7 @@ class UserRechargeDao extends BaseDao public function createOrderId($uid) { $count = (int)UserRecharge::getDB()->where('uid', $uid)->where('create_time', '>=', date("Y-m-d"))->where('create_time', '<', date("Y-m-d", strtotime('+1 day')))->count(); - return 'wx' . date('YmdHis', time()) . ($uid . $count); + return StoreOrderRepository::TYPE_SN_USER_RECHARGE . date('YmdHis', time()) . ($uid . $count); } public function userRechargePrice($uid) diff --git a/app/common/middleware/MerchantCheckBaseInfoMiddleware.php b/app/common/middleware/MerchantCheckBaseInfoMiddleware.php index 6fc03c41..297113e1 100644 --- a/app/common/middleware/MerchantCheckBaseInfoMiddleware.php +++ b/app/common/middleware/MerchantCheckBaseInfoMiddleware.php @@ -43,7 +43,7 @@ class MerchantCheckBaseInfoMiddleware extends BaseMiddleware if ($cache->has($key)) return; - if (!$merchant->mer_avatar || !$merchant->mer_banner || !$merchant->mer_info || !$merchant->service_phone || !$merchant->mer_address) { + if (!$merchant->mer_avatar || !$merchant->mer_banner || !$merchant->mer_info || !$merchant->mer_address) { throw new ValidateException('您好,请前往左侧菜单【设置】-【商户基本信息】完善商户基本信息。'); } Cache::store('file')->set('mer_valid_' . $merchant->mer_id, 1, 3600 * 8); diff --git a/app/common/middleware/ServiceTokenMiddleware.php b/app/common/middleware/ServiceTokenMiddleware.php index c5b95ab2..1259e57f 100644 --- a/app/common/middleware/ServiceTokenMiddleware.php +++ b/app/common/middleware/ServiceTokenMiddleware.php @@ -61,8 +61,6 @@ class ServiceTokenMiddleware extends BaseMiddleware throw new AuthException('账号不存在'); if (!$admin['is_open']) throw new AuthException('账号未开启'); - if (!$admin['status']) - throw new AuthException('账号已被禁用'); if($admin->mer_id){ if (!$admin->merchant) throw new AuthException('商户不存在'); @@ -100,6 +98,9 @@ class ServiceTokenMiddleware extends BaseMiddleware $request->macro('adminInfo', function () use (&$admin) { return $admin; }); + $request->macro('userType', function () use (&$merchant) { + return 4; + }); } public function after(Response $response) diff --git a/app/common/model/store/order/StoreCart.php b/app/common/model/store/order/StoreCart.php index 666b0e18..6da947e2 100644 --- a/app/common/model/store/order/StoreCart.php +++ b/app/common/model/store/order/StoreCart.php @@ -93,7 +93,7 @@ class StoreCart extends BaseModel public function getProductDiscountAttrAttr() { - return app()->make(ProductSkuRepository::class)->getSearch(['active_id' => $this->source_id, 'unique' => $this->product_attr_unique])->find(); + return app()->make(ProductSkuRepository::class)->getSearch(['active_id' => $this->source_id, 'unique' => $this->product_attr_unique,'active_type'=> 10])->find(); } public function productAssistSet() diff --git a/app/common/model/store/order/StoreOrder.php b/app/common/model/store/order/StoreOrder.php index a01773cc..77ab9451 100644 --- a/app/common/model/store/order/StoreOrder.php +++ b/app/common/model/store/order/StoreOrder.php @@ -130,6 +130,12 @@ class StoreOrder extends BaseModel return $this->hasOne(StoreOrderProfitsharing::class, 'order_id', 'order_id')->where('type', 'presell'); } + // 核销订单的自订单列表 + public function takeOrderList() + { + return $this->hasMany(self::class,'main_id','order_id')->order('verify_time DESC'); + } + public function searchMerIdAttr($query, $value) { return $query->where('mer_id', $value); @@ -143,7 +149,7 @@ class StoreOrder extends BaseModel public function getOrderExtendAttr($val) { - return $val ? json_decode($val, true) : []; + return $val ? json_decode($val, true) : null; } public function getRefundExtensionOneAttr() diff --git a/app/common/model/store/order/StoreRefundOrder.php b/app/common/model/store/order/StoreRefundOrder.php index c3fb4ac6..d208fb15 100644 --- a/app/common/model/store/order/StoreRefundOrder.php +++ b/app/common/model/store/order/StoreRefundOrder.php @@ -79,7 +79,10 @@ class StoreRefundOrder extends BaseModel 'order_sn' => $this->order->order_sn, 'refund_order_sn' => $this->refund_order_sn, 'refund_price' => $this->refund_price, - 'pay_price' => $this->order->pay_price + 'pay_price' => $this->order->pay_price, + 'refund_message' => $this->refund_message, + 'open_id' => $this->user->wechat->routine_openid ?? null, + 'transaction_id' => $this->order->transaction_id, ]; } } diff --git a/app/common/model/store/product/Product.php b/app/common/model/store/product/Product.php index 1a75c944..d3dbd9e3 100644 --- a/app/common/model/store/product/Product.php +++ b/app/common/model/store/product/Product.php @@ -77,7 +77,7 @@ class Product extends BaseModel } else { $org_extension = bcmul(($this->attrValue()->order('price DESC')->value('price')) , systemConfig('extension_one_rate'),2); } - $spreadUser = (request()->isLogin() && request()->userType() == 1 ) ? request()->userInfo() : null; + $spreadUser = (request()->hasMacro('isLogin') && request()->isLogin() && request()->userType() == 1 ) ? request()->userInfo() : null; if ($spreadUser && $spreadUser->brokerage_level > 0 && $spreadUser->brokerage && $spreadUser->brokerage->extension_one_rate > 0) { $org_extension = bcmul($org_extension, 1 + $spreadUser->brokerage->extension_one_rate, 2); } @@ -90,7 +90,7 @@ class Product extends BaseModel } else { $org_extension = bcmul(($this->attrValue()->order('price ASC')->value('price')) , systemConfig('extension_one_rate'),2); } - $spreadUser = (request()->isLogin() && request()->userType() == 1 ) ? request()->userInfo() : null; + $spreadUser = (request()->hasMacro('isLogin') && request()->isLogin() && request()->userType() == 1 ) ? request()->userInfo() : null; if ($spreadUser && $spreadUser->brokerage_level > 0 && $spreadUser->brokerage && $spreadUser->brokerage->extension_one_rate > 0) { $org_extension = bcmul($org_extension, 1 + $spreadUser->brokerage->extension_one_rate, 2); } @@ -243,84 +243,6 @@ class Product extends BaseModel return $value ? explode(',',$value) : $value; } - /* - * ----------------------------------------------------------------------------------------------------------------- - * 关联模型 - * ----------------------------------------------------------------------------------------------------------------- - */ - public function merCateId() - { - return $this->hasMany(ProductCate::class,'product_id','product_id')->field('product_id,mer_cate_id'); - } - public function attr() - { - return $this->hasMany(ProductAttr::class,'product_id','product_id'); - } - public function attrValue() - { - return $this->hasMany(ProductAttrValue::class,'product_id','product_id'); - } - public function oldAttrValue() - { - return $this->hasMany(ProductAttrValue::class,'product_id','old_product_id'); - } - public function content() - { - return $this->hasOne(ProductContent::class,'product_id','product_id'); - } - protected function temp() - { - return $this->hasOne(ShippingTemplate::class,'shipping_template_id','temp_id'); - } - public function storeCategory() - { - return $this->hasOne(StoreCategory::class,'store_category_id','cate_id')->field('store_category_id,cate_name'); - } - public function merchant() - { - return $this->hasOne(Merchant::class,'mer_id','mer_id')->field('is_trader,type_id,mer_id,mer_name,mer_avatar,product_score,service_score,postage_score,service_phone,care_count'); - } - public function reply() - { - return $this->hasMany(ProductReply::class,'product_id','product_id')->order('create_time DESC'); - } - public function brand() - { - return $this->hasOne(StoreBrand::class,'brand_id','brand_id')->field('brand_id,brand_name'); - } - public function seckillActive() - { - return $this->hasOne(StoreSeckillActive::class,'product_id','product_id'); - } - public function issetCoupon() - { - return $this->hasOne(StoreCouponProduct::class, 'product_id', 'product_id')->alias('A') - ->rightJoin('StoreCoupon B', 'A.coupon_id = B.coupon_id')->where(function (BaseQuery $query) { - $query->where('B.is_limited', 0)->whereOr(function (BaseQuery $query) { - $query->where('B.is_limited', 1)->where('B.remain_count', '>', 0); - }); - })->where(function (BaseQuery $query) { - $query->where('B.is_timeout', 0)->whereOr(function (BaseQuery $query) { - $time = date('Y-m-d H:i:s'); - $query->where('B.is_timeout', 1)->where('B.start_time', '<', $time)->where('B.end_time', '>', $time); - }); - })->field('A.product_id,B.*')->where('status', 1)->where('type', 1)->where('send_type', 0)->where('is_del', 0) - ->order('sort DESC,coupon_id DESC')->hidden(['is_del', 'status']); - } - public function assist() - { - return $this->hasOne(ProductAssist::class,'product_id','product_id'); - } - public function productGroup() - { - return $this->hasOne(ProductGroup::class,'product_id','product_id'); - } - public function guarantee() - { - return $this->hasOne(GuaranteeTemplate::class,'guarantee_template_id','guarantee_template_id')->where('status',1)->where('is_del',0); - } - - /** * TODO 是否是会员 * @return bool @@ -329,10 +251,10 @@ class Product extends BaseModel */ public function getIsVipAttr() { - if (request()->isLogin()) { + if (request()->hasMacro('isLogin') && request()->isLogin()) { if (request()->userType() == 1) { $userInfo = request()->userInfo(); - return $userInfo->is_svip ? true : false; + return $userInfo->is_svip > 0 ? true : false; } else { return true; } @@ -406,6 +328,103 @@ class Product extends BaseModel return 0; } + public function getIsSvipPriceAttr() + { + if ($this->product_type == 0 && $this->mer_svip_status != 0) { + //默认比例 + if ($this->svip_price_type == 1) { + $rate = merchantConfig($this->mer_id,'svip_store_rate'); + $svip_store_rate = $rate > 0 ? bcdiv($rate,100,2) : 0; + $price = $this->attrValue()->order('price ASC')->value('price'); + return bcmul($price,$svip_store_rate,2); + } + //自定义 + if ($this->svip_price_type == 2) { + return $this->getData('svip_price'); + } + } + return 0; + } + + /* + * ----------------------------------------------------------------------------------------------------------------- + * 关联模型 + * ----------------------------------------------------------------------------------------------------------------- + */ + public function merCateId() + { + return $this->hasMany(ProductCate::class,'product_id','product_id')->field('product_id,mer_cate_id'); + } + public function attr() + { + return $this->hasMany(ProductAttr::class,'product_id','product_id'); + } + public function attrValue() + { + return $this->hasMany(ProductAttrValue::class,'product_id','product_id'); + } + public function oldAttrValue() + { + return $this->hasMany(ProductAttrValue::class,'product_id','old_product_id'); + } + public function content() + { + return $this->hasOne(ProductContent::class,'product_id','product_id'); + } + protected function temp() + { + return $this->hasOne(ShippingTemplate::class,'shipping_template_id','temp_id'); + } + public function storeCategory() + { + return $this->hasOne(StoreCategory::class,'store_category_id','cate_id')->field('store_category_id,cate_name'); + } + public function merchant() + { + return $this->hasOne(Merchant::class,'mer_id','mer_id')->field('is_trader,type_id,mer_id,mer_name,mer_avatar,product_score,service_score,postage_score,service_phone,care_count,is_margin'); + } + public function reply() + { + return $this->hasMany(ProductReply::class,'product_id','product_id')->order('create_time DESC'); + } + public function brand() + { + return $this->hasOne(StoreBrand::class,'brand_id','brand_id')->field('brand_id,brand_name'); + } + public function seckillActive() + { + return $this->hasOne(StoreSeckillActive::class,'product_id','product_id'); + } + public function issetCoupon() + { + return $this->hasOne(StoreCouponProduct::class, 'product_id', 'product_id')->alias('A') + ->rightJoin('StoreCoupon B', 'A.coupon_id = B.coupon_id')->where(function (BaseQuery $query) { + $query->where('B.is_limited', 0)->whereOr(function (BaseQuery $query) { + $query->where('B.is_limited', 1)->where('B.remain_count', '>', 0); + }); + })->where(function (BaseQuery $query) { + $query->where('B.is_timeout', 0)->whereOr(function (BaseQuery $query) { + $time = date('Y-m-d H:i:s'); + $query->where('B.is_timeout', 1)->where('B.start_time', '<', $time)->where('B.end_time', '>', $time); + }); + })->field('A.product_id,B.*')->where('status', 1)->where('type', 1)->where('send_type', 0)->where('is_del', 0) + ->order('sort DESC,coupon_id DESC')->hidden(['is_del', 'status']); + } + public function assist() + { + return $this->hasOne(ProductAssist::class,'product_id','product_id'); + } + public function productGroup() + { + return $this->hasOne(ProductGroup::class,'product_id','product_id'); + } + public function guarantee() + { + return $this->hasOne(GuaranteeTemplate::class,'guarantee_template_id','guarantee_template_id')->where('status',1)->where('is_del',0); + } + + + /* * ----------------------------------------------------------------------------------------------------------------- @@ -456,8 +475,9 @@ class Product extends BaseModel } public function searchPidAttr($query, $value) { - $cateId = app()->make(StoreCategoryRepository::class)->allChildren(intval($value)); - $query->whereIn('cate_id', $cateId); + $childrenId = app()->make(StoreCategoryRepository::class)->findChildrenId((int)$value); + $ids = array_merge($childrenId, [(int)$value]); + $query->whereIn('cate_id', $ids); } public function searchStockAttr($query, $value) { diff --git a/app/common/model/store/product/ProductAttrValue.php b/app/common/model/store/product/ProductAttrValue.php index 1731aae2..77b8860a 100644 --- a/app/common/model/store/product/ProductAttrValue.php +++ b/app/common/model/store/product/ProductAttrValue.php @@ -60,17 +60,27 @@ class ProductAttrValue extends BaseModel return $this->getData('svip_price'); } + public function getIsSvipPriceAttr() + { + if ($this->product->product_type == 0 && $this->product->svip_price_type == 1) { + $rate = merchantConfig($this->product->mer_id,'svip_store_rate'); + $svip_store_rate = $rate > 0 ? bcdiv($rate,100,2) : 0; + return bcmul($this->price, $svip_store_rate,2); + } + return '未设置'; + } + public function getBcExtensionOneAttr() { if(!intval(systemConfig('extension_status'))) return 0; - if($this->extension_one > 0) return $this->extension_one; + if($this->product->extension_type == 1) return $this->extension_one; return floatval(round(bcmul(systemConfig('extension_one_rate'), $this->price, 3),2)); } public function getBcExtensionTwoAttr() { if(!intval(systemConfig('extension_status'))) return 0; - if($this->extension_two > 0) return $this->extension_two; + if($this->product->extension_type == 1) return $this->extension_two; return floatval(round(bcmul(systemConfig('extension_two_rate'), $this->price, 3),2)); } diff --git a/app/common/model/store/product/Spu.php b/app/common/model/store/product/Spu.php index 581bdffc..c6fbe82b 100644 --- a/app/common/model/store/product/Spu.php +++ b/app/common/model/store/product/Spu.php @@ -152,6 +152,11 @@ class Spu extends BaseModel return $this->product->svip_price; } + public function getIsSvipPriceAttr() + { + return $this->product->is_svip_price; + } + /* * ----------------------------------------------------------------------------------------------------------------- * 关联表 diff --git a/app/common/model/store/product/StoreDiscountProduct.php b/app/common/model/store/product/StoreDiscountProduct.php index 36b21a20..d6e330df 100644 --- a/app/common/model/store/product/StoreDiscountProduct.php +++ b/app/common/model/store/product/StoreDiscountProduct.php @@ -11,6 +11,7 @@ namespace app\common\model\store\product; use app\common\model\BaseModel; +use app\common\repositories\store\product\ProductSkuRepository; class StoreDiscountProduct extends BaseModel { @@ -32,7 +33,7 @@ class StoreDiscountProduct extends BaseModel public function productSku() { - return $this->hasMany(ProductSku::class,'active_product_id', 'discount_product_id'); + return $this->hasMany(ProductSku::class,'active_product_id', 'discount_product_id')->where('active_type',ProductSkuRepository::ACTIVE_TYPE_DISCOUNTS); } public function searchProductIdAttr($query, $value) diff --git a/app/common/model/system/merchant/Merchant.php b/app/common/model/system/merchant/Merchant.php index e3f41df3..54639bf9 100644 --- a/app/common/model/system/merchant/Merchant.php +++ b/app/common/model/system/merchant/Merchant.php @@ -55,7 +55,7 @@ class Merchant extends BaseModel if (!$value) return []; return explode(',',$value); } - + public function product() { return $this->hasMany(Product::class, 'mer_id', 'mer_id'); @@ -66,7 +66,6 @@ class Merchant extends BaseModel return $this->hasMany(SystemConfigValue::class, 'mer_id', 'mer_id'); } - public function showProduct() { return $this->hasMany(Product::class, 'mer_id', 'mer_id') @@ -85,7 +84,7 @@ class Merchant extends BaseModel { $list = Product::where('mer_id', $this['mer_id']) ->where((new ProductDao())->productShow()) - ->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,cate_id,unit_name') + ->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,cate_id') ->order('sort DESC, create_time DESC') ->limit(3) ->select()->append(['show_svip_info']); diff --git a/app/common/model/user/User.php b/app/common/model/user/User.php index f3a1c2a4..a410de0f 100644 --- a/app/common/model/user/User.php +++ b/app/common/model/user/User.php @@ -209,14 +209,17 @@ class User extends BaseModel public function service() { return $this->hasOne(StoreService::class, 'uid', 'uid') - ->where('mer_id', '<>', 0)->field('service_id,uid,nickname,avatar,customer,mer_id,is_verify,is_goods')->where('is_del', 0)->where('status', 1) + ->where('mer_id', '<>', 0) + ->where('is_del', 0) + ->where('is_open', 1) + ->field('service_id,uid,nickname,avatar,customer,mer_id,is_verify,is_goods,is_open') ->order('is_verify DESC,customer DESC'); } public function topService() { return $this->hasOne(StoreService::class, 'uid', 'uid') - ->where('mer_id', 0)->field('service_id,uid,nickname,avatar,customer,mer_id,is_verify,is_goods')->where('is_del', 0)->where('status', 1) + ->where('mer_id', 0)->field('service_id,uid,nickname,avatar,customer,mer_id,is_verify,is_goods')->where('is_del', 0) ->order('is_verify DESC,customer DESC'); } diff --git a/app/common/model/user/UserExtract.php b/app/common/model/user/UserExtract.php index 85ad3a64..dccd5782 100644 --- a/app/common/model/user/UserExtract.php +++ b/app/common/model/user/UserExtract.php @@ -32,4 +32,15 @@ class UserExtract extends BaseModel return $this->hasOne(User::class,'uid','uid'); } + public function searchUidAttr($query, $value) + { + $query->where('uid',$value); + } + + public function searchExtractTypeAttr($query, $value) + { + $query->where('extract_type',$value); + } + + } diff --git a/app/common/repositories/community/CommunityRepository.php b/app/common/repositories/community/CommunityRepository.php index d5888bcc..2874a401 100644 --- a/app/common/repositories/community/CommunityRepository.php +++ b/app/common/repositories/community/CommunityRepository.php @@ -202,7 +202,7 @@ class CommunityRepository extends BaseRepository $where['uid'] = $userInfo->uid; $where['community_ids'] = $this->dao->joinUser($where)->column('community_id'); } else { // 条件视频 - if ($first) $where['topic_id'] = $first['topic_id']; + if (!isset($where['uid']) && $first) $where['topic_id'] = $first['topic_id']; } $where['not_id'] = $where['community_id']; unset($where['community_id']); @@ -307,22 +307,26 @@ class CommunityRepository extends BaseRepository foreach ($where as $item) { switch ($item['product_type']){ case 0: - $id = $item['product_id']; + $sid = $item['product_id']; // nobreak; case 1: - $id = $item['product_id']; + $sid = $item['product_id']; break; case 2: - $id = $item['activity_id']; + $sid = $item['activity_id']; break; case 3: - $id = $item['cart_info']['productAssistSet']['product_assist_id']; + $sid = $item['cart_info']['productAssistSet']['product_assist_id']; break; case 4: - $id = $item['cart_info']['product']['productGroup']['product_group_id']; + $sid = $item['cart_info']['product']['productGroup']['product_group_id']; break; + default: + $sid = $item['product_id']; + break; + } - $data[] = $make->getSpuData($id, $item['product_type'],0); + $data[] = $make->getSpuData($sid, $item['product_type'],0); } return $data; } @@ -525,20 +529,21 @@ class CommunityRepository extends BaseRepository { $where = array_merge(['spu_id' => $spuId], self::IS_SHOW_WHERE); return $this->dao->getSearch($where) - ->field('community_id,title,image') + ->order('create_time DESC') + ->field('community_id,title,image,is_type') ->limit(3)->select(); } public function qrcode($id, $type,$user) { - $res = $this->dao->search(['is_type' => self::COMMUNIT_TYPE_VIDEO,'community_id' => $id])->find(); - if (!$res) throw new ValidateException('数据不存在'); + $res = $this->dao->search(['is_type' => self::COMMUNIT_TYPE_VIDEO,'community_id' => $id, 'status' => 1, 'is_show' => 1])->find(); + if (!$res) return false; $make = app()->make(QrcodeService::class); if ($type == 'routine') { $name = md5('rcwx' . $id . $type . $user->uid . $user['is_promoter'] . date('Ymd')) . '.jpg'; $params = 'id=' . $id . '&spid=' . $user['uid']; - $link = '/pages/short_video/nvueSwiper/index?id='; - $make->getRoutineQrcodePath($name, $link, $params); + $link = 'pages/short_video/nvueSwiper/index'; + return $make->getRoutineQrcodePath($name, $link, $params); } else { $name = md5('cwx' . $id . $type . $user->uid . $user['is_promoter'] . date('Ymd')) . '.jpg'; $link = 'pages/short_video/nvueSwiper/index'; diff --git a/app/common/repositories/delivery/DeliveryOrderRepository.php b/app/common/repositories/delivery/DeliveryOrderRepository.php index 2b962938..d97740f8 100644 --- a/app/common/repositories/delivery/DeliveryOrderRepository.php +++ b/app/common/repositories/delivery/DeliveryOrderRepository.php @@ -145,8 +145,16 @@ class DeliveryOrderRepository extends BaseRepository $res = DeliverySevices::create($order['station_type'])->cancelOrder($data); $deduct_fee = $res['deduct_fee'] ?? 0; $this->cancelAfter($order, $deduct_fee, $mark); + //订单记录 $statusRepository = app()->make(StoreOrderStatusRepository::class); - $statusRepository->status($order['order_id'], $statusRepository::ORDER_DELIVERY_CITY_CANCEL, '已取消'); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $statusRepository::TYPE_ORDER, + 'change_message' => '同城配送订单已取消', + 'change_type' => $statusRepository::ORDER_DELIVERY_CITY_CANCEL, + ]; + $statusRepository->createAdminLog($orderStatus); }); } @@ -283,20 +291,27 @@ class DeliveryOrderRepository extends BaseRepository $res->status = $status; $res->reason = $reason; $res->save(); - - $message = '订单已配送【'. $this->statusData[$status].'】'; - app()->make(StoreOrderStatusRepository::class)->status($res['order_id'], $this->message[$status], $message); - - if ($status == 2 && !empty($data)) $make->update($res['order_id'],$data); - - + //订单记录 + $statusRepository = app()->make(StoreOrderStatusRepository::class); + $message = '订单同城配送【'. $this->statusData[$status].'】'; + $orderStatus = [ + 'order_id' => $orderData['order_id'], + 'order_sn' => $orderData['order_sn'], + 'type' => $statusRepository::TYPE_ORDER, + 'change_message' => $message, + 'change_type' => $this->message[$status], + ]; + $statusRepository->createSysLog($orderStatus); + if ($status == 2 && !empty($data)) + $make->update($res['order_id'],$data); if ($status == 4){ $order = $make->get($res['order_id']); $user = app()->make(UserRepository::class)->get($order['uid']); $make->update($res['order_id'],['status' => 2]); $make->takeAfter($order, $user); } - if ($status == -1) $this->cancelAfter($res, $deductFee , $reason); + if ($status == -1) + $this->cancelAfter($res, $deductFee , $reason); } } @@ -314,11 +329,16 @@ class DeliveryOrderRepository extends BaseRepository //地址转经纬度 try{ $addres = lbs_address($station['city_name'], $order['user_address']); + if($type == DeliverySevices::DELIVERY_TYPE_UU) { + [$location['lng'],$location['lat']] = gcj02ToBd09($addres['location']['lng'],$addres['location']['lat']); + } else { + $location = $addres['location']; + } }catch (\Exception $e) { throw new ValidateException('获取经纬度失败'); } - $getPriceParams = $this->getPriceParams($station, $order, $addres['location'],$type); + $getPriceParams = $this->getPriceParams($station, $order,$location,$type); $orderSn = $this->getOrderSn(); $getPriceParams['origin_id'] = $orderSn; $getPriceParams['callback_url'] = $callback_url; diff --git a/app/common/repositories/store/broadcast/BroadcastGoodsRepository.php b/app/common/repositories/store/broadcast/BroadcastGoodsRepository.php index c9d1bf28..171a1ccb 100644 --- a/app/common/repositories/store/broadcast/BroadcastGoodsRepository.php +++ b/app/common/repositories/store/broadcast/BroadcastGoodsRepository.php @@ -259,7 +259,7 @@ class BroadcastGoodsRepository extends BaseRepository $goods = $goods->toArray(); $miniProgramService = MiniProgramService::create(); - $path = app()->make(DownloadImageService::class)->downloadImage($goods['cover_img'])['path']; + $path = './public' . app()->make(DownloadImageService::class)->downloadImage($goods['cover_img'],'def','',1)['path']; $data = [ 'name' => $goods['name'], 'priceType' => 1, @@ -278,7 +278,7 @@ class BroadcastGoodsRepository extends BaseRepository public function wxUpdate($id,$data) { $miniProgramService = MiniProgramService::create(); - $path = app()->make(DownloadImageService::class)->downloadImage($data['cover_img'])['path']; + $path = './public' . app()->make(DownloadImageService::class)->downloadImage($data['cover_img'],'def','',1)['path']; $params = [ "goodsId" => $id, 'name' => $data['name'], diff --git a/app/common/repositories/store/broadcast/BroadcastRoomRepository.php b/app/common/repositories/store/broadcast/BroadcastRoomRepository.php index 94f91934..b9978e85 100644 --- a/app/common/repositories/store/broadcast/BroadcastRoomRepository.php +++ b/app/common/repositories/store/broadcast/BroadcastRoomRepository.php @@ -201,7 +201,7 @@ class BroadcastRoomRepository extends BaseRepository { return Elm::createForm(Route::buildUrl('systemBroadcastRoomApply', compact('id'))->build(), [ Elm::radio('status', '审核状态', '1')->options([['value' => '-1', 'label' => '未通过'], ['value' => '1', 'label' => '通过']])->control([ - ['value' => -1, 'rule' => [ + ['value' => '-1', 'rule' => [ Elm::textarea('msg', '未通过原因', '信息有误,请完善')->required() ]] ]), @@ -251,9 +251,10 @@ class BroadcastRoomRepository extends BaseRepository $room = $room->toArray(); $miniProgramService = MiniProgramService::create(); - $coverImg = app()->make(DownloadImageService::class)->downloadImage($room['cover_img'])['path']; - $shareImg = app()->make(DownloadImageService::class)->downloadImage($room['share_img'])['path']; - $feedsImg = app()->make(DownloadImageService::class)->downloadImage($room['feeds_img'])['path']; + $DownloadImageService = app()->make(DownloadImageService::class); + $coverImg = './public' . $DownloadImageService->downloadImage($room['cover_img'],'def','',1)['path']; + $shareImg = './public' . $DownloadImageService->downloadImage($room['share_img'],'def','',1)['path']; + $feedsImg = './public' . $DownloadImageService->downloadImage($room['feeds_img'],'def','',1)['path']; $data = [ 'startTime' => strtotime($room['start_time']), 'endTime' => strtotime($room['end_time']), @@ -268,12 +269,9 @@ class BroadcastRoomRepository extends BaseRepository 'closeKf' => $room['close_kf'], 'closeReplay' => $room['replay_status'] == 1 ? 0 : 1, 'isFeedsPublic' => $room['is_feeds_public'] == 1 ? 0 : 1, -// 'coverImg' => $miniProgramService->material()->uploadImage($coverImg)->media_id, -// 'shareImg' => $miniProgramService->material()->uploadImage($shareImg)->media_id, -// 'feedsImg' => $miniProgramService->material()->uploadImage($feedsImg)->media_id, - 'coverImg' => $coverImg, - 'shareImg' => $shareImg, - 'feedsImg' => $feedsImg, + 'coverImg' => $miniProgramService->material()->uploadImage($coverImg)->media_id, + 'shareImg' => $miniProgramService->material()->uploadImage($shareImg)->media_id, + 'feedsImg' => $miniProgramService->material()->uploadImage($feedsImg)->media_id, ]; @unlink($coverImg); @unlink($shareImg); diff --git a/app/common/repositories/store/coupon/StoreCouponRepository.php b/app/common/repositories/store/coupon/StoreCouponRepository.php index 74e2c7cd..bcd007cf 100644 --- a/app/common/repositories/store/coupon/StoreCouponRepository.php +++ b/app/common/repositories/store/coupon/StoreCouponRepository.php @@ -333,12 +333,18 @@ class StoreCouponRepository extends BaseRepository 'coupon_id' => $coupon['coupon_id'], 'mer_id' => $coupon['mer_id'] ]; - if ($coupon['coupon_type'] == 1) { - $data['start_time'] = $coupon['use_start_time']; - $data['end_time'] = $coupon['use_end_time']; + if ($coupon['send_type'] == self::GET_COUPON_TYPE_SVIP) { + $data['start_time'] = date('Y-m-d 00:00:00',time()); + $firstday = date('Y-m-01', time()); + $data['end_time'] = date('Y-m-d 23:59:59', strtotime("$firstday +1 month -1 day")); } else { - $data['start_time'] = date('Y-m-d H:i:s'); - $data['end_time'] = date('Y-m-d H:i:s', strtotime("+ {$coupon['coupon_time']}day")); + if ($coupon['coupon_type'] == 1) { + $data['start_time'] = $coupon['use_start_time']; + $data['end_time'] = $coupon['use_end_time']; + } else { + $data['start_time'] = date('Y-m-d H:i:s'); + $data['end_time'] = date('Y-m-d H:i:s', strtotime("+ {$coupon['coupon_time']}day")); + } } return $data; } diff --git a/app/common/repositories/store/order/PresellOrderRepository.php b/app/common/repositories/store/order/PresellOrderRepository.php index ae046fb0..6a1aff56 100644 --- a/app/common/repositories/store/order/PresellOrderRepository.php +++ b/app/common/repositories/store/order/PresellOrderRepository.php @@ -52,19 +52,6 @@ class PresellOrderRepository extends BaseRepository $this->dao = $dao; } - /** - * @return string - * @author xaboy - * @day 2020/6/9 - */ - public function getNewOrderId() - { - list($msec, $sec) = explode(' ', microtime()); - $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); - $orderId = 'ps' . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); - return $orderId; - } - public function createOrder($uid, $orderId, $price, $final_start_time, $final_end_time) { return $this->dao->create([ @@ -73,7 +60,7 @@ class PresellOrderRepository extends BaseRepository 'final_start_time' => $final_start_time, 'final_end_time' => $final_end_time, 'pay_price' => $price, - 'presell_order_sn' => $this->getNewOrderId() + 'presell_order_sn' => app()->make(StoreOrderRepository::class)->getNewOrderId(StoreOrderRepository::TYPE_SN_PRESELL) ]); } @@ -142,12 +129,15 @@ class PresellOrderRepository extends BaseRepository } $order->order->save(); $order->save(); + //订单记录 + $statusRepository = app()->make(StoreOrderStatusRepository::class); $orderStatus = [ 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $statusRepository::TYPE_ORDER, 'change_message' => '订单尾款支付成功', - 'change_type' => 'presell' + 'change_type' => $statusRepository::ORDER_STATUS_PRESELL, ]; - $i = 1; $finance = []; @@ -284,7 +274,7 @@ class PresellOrderRepository extends BaseRepository app()->make(ProductPresellSkuRepository::class)->incCount($order->order->orderProduct[0]['activity_id'], $order->order->orderProduct[0]['product_sku'], 'two_pay'); app()->make(UserMerchantRepository::class)->updatePayTime($order->uid, $order->mer_id, $order->pay_price, false); app()->make(FinancialRecordRepository::class)->insertAll($finance); - app()->make(StoreOrderStatusRepository::class)->create($orderStatus); + $statusRepository->createUserLog($orderStatus); }); if ($order->user->spread_uid) { Queue::push(UserBrokerageLevelJob::class, ['uid' => $order->user->spread_uid, 'type' => 'spread_money', 'inc' => $order->pay_price]); @@ -297,19 +287,23 @@ class PresellOrderRepository extends BaseRepository { $order = $this->dao->getWhere(['presell_order_id' => $id, 'paid' => 0]); if (!$order) return; + //订单记录 + $statusRepository = app()->make(StoreOrderStatusRepository::class); $orderStatus = [ 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $statusRepository::TYPE_ORDER, 'change_message' => '预售订单超时支付自动关闭', - 'change_type' => 'presell_close' + 'change_type' => $statusRepository::ORDER_STATUS_PRESELL_CLOSE, ]; event('order.presll.fail.before', compact('order')); $productRepository = app()->make(ProductRepository::class); - Db::transaction(function () use ($productRepository, $order, $orderStatus) { - app()->make(StoreOrderStatusRepository::class)->create($orderStatus); + Db::transaction(function () use ($productRepository, $order, $orderStatus,$statusRepository) { + $statusRepository->createSysLog($orderStatus); $order->order->status = 11; $order->status = 0; - $order->save(); + $order->save();+ $order->order->save(); foreach ($order->order->orderProduct as $cart) { $productRepository->orderProductIncStock($order->order, $cart); diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index f659ccb6..5d433ec1 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -143,7 +143,8 @@ class StoreGroupOrderRepository extends BaseRepository 'balance' => $make->get($groupOrder->uid)->integral ]); } - + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); foreach ($groupOrder->orderList as $order) { if ($order->activity_type == 3 && $order->presellOrder) { $order->presellOrder->status = 0; @@ -153,12 +154,17 @@ class StoreGroupOrderRepository extends BaseRepository $order->save(); $orderStatus[] = [ 'order_id' => $order->order_id, - 'change_type' => 'cancel', - 'change_message' => '取消订单' . ($uid ? '' : '[自动]') + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '取消订单' . ($uid ? '' : '[自动]'), + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_CANCEL, + 'uid' => 0, + 'nickname' => '系统', + 'user_type' => $storeOrderStatusRepository::U_TYPE_SYSTEM, ]; } $groupOrder->save(); - app()->make(StoreOrderStatusRepository::class)->insertAll($orderStatus); + $storeOrderStatusRepository->batchCreateLog($orderStatus); }); Queue::push(CancelGroupOrderJob::class, $id); } diff --git a/app/common/repositories/store/order/StoreOrderCreateDgRepository.php b/app/common/repositories/store/order/StoreOrderCreateDgRepository.php index b195de83..f600cbd8 100644 --- a/app/common/repositories/store/order/StoreOrderCreateDgRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateDgRepository.php @@ -1063,7 +1063,7 @@ class StoreOrderCreateDgRepository extends StoreOrderRepository 'is_virtual' => $order_model ? 1 : 0, 'extension_one' => $total_extension_one, 'extension_two' => $total_extension_two, - 'order_sn' => $this->getNewOrderId() . ($k + 1), + 'order_sn' => $this->getNewOrderId('dg') . ($k + 1), 'uid' => $uid, 'spread_uid' => $spreadUid, 'top_uid' => $topUid, @@ -1098,7 +1098,7 @@ class StoreOrderCreateDgRepository extends StoreOrderRepository } $groupOrder = [ 'uid' => $uid, - 'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId() . '0'), + 'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId('dg') . '0'), 'total_postage' => $totalPostage, 'total_price' => $orderInfo['total_price'], 'total_num' => $totalNum, @@ -1263,7 +1263,7 @@ class StoreOrderCreateDgRepository extends StoreOrderRepository 'final_start_time' => $cart['productPresell']['final_start_time'], 'final_end_time' => $cart['productPresell']['final_end_time'], 'pay_price' => $allFinalPrice, - 'presell_order_sn' => $presellOrderRepository->getNewOrderId() + 'presell_order_sn' => $presellOrderRepository->getNewOrderId('dg') ]); } app()->make(ProductPresellSkuRepository::class)->incCount($cart['source_id'], $cart['productAttr']['unique'], 'one_take'); diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index ee0dce07..4d50dab4 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -211,6 +211,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository if ($cart['product_type'] == 10 && $cart['productDiscountAttr']) { $cart['productAttr']['price'] = $cart['productDiscountAttr']['active_price']; + $cart['productAttr']['show_svip_price'] = false; } if ($cart['cart_num'] <= 0) { @@ -221,11 +222,12 @@ class StoreOrderCreateRepository extends StoreOrderRepository $price = bcmul($cart['cart_num'], $this->cartByPrice($cart), 2); $cart['total_price'] = $price; $cart['postage_price'] = 0; + $cart['svip_discount'] = 0; $total_price = bcadd($total_price, $price, 2); $total_num += $cart['cart_num']; $_price = bcmul($cart['cart_num'], $this->cartByCouponPrice($cart), 2); $cart['svip_coupon_merge'] = 1; - if ($cart['productAttr']['show_svip_price']) { + if ($cart['productAttr']['show_svip_price'] && !$cart['product_type']) { $svip_discount = max(bcmul($cart['cart_num'], bcsub($cart['productAttr']['org_price'] ?? 0, $cart['productAttr']['price'], 2), 2), 0); if ($svip_coupon_merge != '1') { $_price = 0; @@ -237,6 +239,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository $cart['allow_price'] = $_price; $temp1 = $cart['product']['temp']; $cart['temp_number'] = 0; + $total_svip_discount = bcadd($total_svip_discount, $svip_discount, 2); + $cart['svip_discount'] = $svip_discount; if (!isset($product_cart[$cart['product_id']])) $product_cart[$cart['product_id']] = [$cart['cart_id']]; @@ -315,7 +319,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository $postageRule[$tempId]['region'] = $regionRule; } unset($cart); - $total_svip_discount = bcadd($total_svip_discount, $svip_discount, 2); if (!$isTake) { //计算运费 @@ -522,11 +525,12 @@ class StoreOrderCreateRepository extends StoreOrderRepository //单个商品实际支付金额 $cart['coupon_price'] = bcsub($_cartTotalPrice, $cartTotalPrice, 2); $cart['true_price'] = $cartTotalPrice; - $cart['svip_discount'] = $svip_discount; } unset($cart, $_k); $total_true_price = bcadd($_pay_price, $total_true_price, 2); - $orderDeliveryStatus = $orderDeliveryStatus && $deliveryStatus; + if(count($merchantCartList) > 1 || count($merchantCart['list']) > 1){ + $orderDeliveryStatus = $orderDeliveryStatus && $deliveryStatus; + } $merchantCart['order'] = [ 'true_price' => $_pay_price, 'platform_coupon_price' => 0, @@ -921,7 +925,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository } $orderType = $orderInfo['order_type']; - if ($orderType && $orderType< 98 && (count($orderInfo['order']) > 1 || ($orderType != 10 && count($orderInfo['order'][0]['list']) > 1))) { + if ($orderType && $orderType<=98 && (count($orderInfo['order']) > 1 || ($orderType != 10 && count($orderInfo['order'][0]['list']) > 1))) { throw new ValidateException('活动商品请单独购买'); } @@ -1106,7 +1110,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository 'is_virtual' => $is_virtual, 'extension_one' => $total_extension_one, 'extension_two' => $total_extension_two, - 'order_sn' => $this->getNewOrderId() . ($k + 1), + 'order_sn' => $this->getNewOrderId('wx') . ($k + 1), 'uid' => $uid, 'spread_uid' => $spreadUid, 'top_uid' => $topUid, @@ -1191,7 +1195,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository 'commission_rate' => $shareRate, 'order_type' => $merchantCart['order']['isTake'] ? 1 : 0, 'is_virtual' => $order_model ? 1 : 0, - 'order_sn' => $this->getNewOrderId() . ($k + 1), + 'order_sn' => $this->getNewOrderId('wx') . ($k + 1), 'uid' => $uid, 'spread_uid' => $spreadUid, 'top_uid' => $topUid, @@ -1234,7 +1238,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository $groupOrder = [ 'uid' => $uid, - 'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId() . '0'), + 'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId(StoreOrderRepository::TYPE_SN_ORDER) . '0'), 'is_virtual' => $order_model ? 1 : 0, 'total_postage' => $totalPostage, 'total_price' => $orderInfo['total_price'], @@ -1262,6 +1266,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository $productRepository = app()->make(ProductRepository::class); $storeOrderProductRepository = app()->make(StoreOrderProductRepository::class); $couponUserRepository = app()->make(StoreCouponUserRepository::class); + //订单记录 $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); $userMerchantRepository = app()->make(UserMerchantRepository::class); @@ -1372,8 +1377,13 @@ class StoreOrderCreateRepository extends StoreOrderRepository $orderStatus[] = [ 'order_id' => $_order->order_id, + 'order_sn' => $_order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, 'change_message' => '订单生成', - 'change_type' => 'create' + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_CREATE, + 'uid' => $user->uid, + 'nickname' => $user->nickname, + 'user_type' => $storeOrderStatusRepository::U_TYPE_USER, ]; foreach ($cartInfo['list'] as $cart) { @@ -1401,7 +1411,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository 'final_start_time' => $cart['productPresell']['final_start_time'], 'final_end_time' => $cart['productPresell']['final_end_time'], 'pay_price' => $allFinalPrice, - 'presell_order_sn' => $presellOrderRepository->getNewOrderId() + 'presell_order_sn' => $this->getNewOrderId(StoreOrderRepository::TYPE_SN_PRESELL) ]); } app()->make(ProductPresellSkuRepository::class)->incCount($cart['source_id'], $cart['productAttr']['unique'], 'one_take'); @@ -1463,7 +1473,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository if (count($bills) > 0) { app()->make(UserBillRepository::class)->insertAll($bills); } - $storeOrderStatusRepository->insertAll($orderStatus); + $storeOrderStatusRepository->batchCreateLog($orderStatus); $storeOrderProductRepository->insertAll($orderProduct); event('order.create', compact('groupOrder')); return $groupOrder; diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index ba6a3a57..fc0df385 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -51,6 +51,7 @@ use crmeb\services\SwooleTaskService; use Exception; use FormBuilder\Factory\Elm; use FormBuilder\Form; +use http\Exception\InvalidArgumentException; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; @@ -75,6 +76,12 @@ class StoreOrderRepository extends BaseRepository */ const PAY_TYPE = ['balance', 'weixin', 'routine', 'h5', 'alipay', 'alipayQr', 'weixinQr']; + const TYPE_SN_ORDER = 'wxo'; + const TYPE_SN_PRESELL = 'wxp'; + const TYPE_SN_USER_ORDER = 'wxs'; + const TYPE_SN_USER_RECHARGE = 'wxu'; + + const TYPE_SN_REFUND = 'rwx'; /** * StoreOrderRepository constructor. * @param StoreOrderDao $dao @@ -114,10 +121,9 @@ class StoreOrderRepository extends BaseRepository } /** - * 余额支付 * @param User $user * @param StoreGroupOrder $groupOrder - * @return mixed + * @return mixed * @author xaboy * @day 2020/6/9 */ @@ -127,21 +133,20 @@ class StoreOrderRepository extends BaseRepository throw new ValidateException('未开启余额支付'); if ($user['now_money'] < $groupOrder['pay_price']) throw new ValidateException('余额不足,请更换支付方式'); - - Db::transaction(function () use ($user, $groupOrder) { - $user->now_money = bcsub($user->now_money, $groupOrder['pay_price'], 2); - $user->save(); - $userBillRepository = app()->make(UserBillRepository::class); - $userBillRepository->decBill($user['uid'], 'now_money', 'pay_product', [ - 'link_id' => $groupOrder['group_order_id'], - 'status' => 1, - 'title' => '购买商品', - 'number' => $groupOrder['pay_price'], - 'mark' => '余额支付支付' . floatval($groupOrder['pay_price']) . '元购买商品', - 'balance' => $user->now_money - ]); - $this->paySuccess($groupOrder); - }); + Db::transaction(function () use ($user, $groupOrder) { + $user->now_money = bcsub($user->now_money, $groupOrder['pay_price'], 2); + $user->save(); + $userBillRepository = app()->make(UserBillRepository::class); + $userBillRepository->decBill($user['uid'], 'now_money', 'pay_product', [ + 'link_id' => $groupOrder['group_order_id'], + 'status' => 1, + 'title' => '购买商品', + 'number' => $groupOrder['pay_price'], + 'mark' => '余额支付支付' . floatval($groupOrder['pay_price']) . '元购买商品', + 'balance' => $user->now_money + ]); + $this->paySuccess($groupOrder); + }); return app('json')->status('success', '余额支付成功', ['order_id' => $groupOrder['group_order_id']]); } @@ -199,6 +204,8 @@ class StoreOrderRepository extends BaseRepository $uid = $groupOrder->uid; $i = 1; $isVipCoupon = app()->make(StoreGroupOrderRepository::class)->isVipCoupon($groupOrder); + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); $svipDiscount = 0; foreach ($groupOrder->orderList as $_k => $order) { $order->paid = 1; @@ -241,8 +248,13 @@ class StoreOrderRepository extends BaseRepository $order->save(); $orderStatus[] = [ 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, 'change_message' => '订单支付成功', - 'change_type' => 'pay_success' + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_PAY_SUCCCESS, + 'uid' => $order->uid, + 'nickname' => $order->user->nickname, + 'user_type' => $storeOrderStatusRepository::U_TYPE_USER, ]; //TODO 成为推广员 @@ -437,9 +449,9 @@ class StoreOrderRepository extends BaseRepository // ]); if ($groupOrder->user->spread_uid) { + Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_pay_num', 'inc' => 1]); Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_money', 'inc' => $groupOrder->pay_price]); - } - + } app()->make(UserRepository::class)->update($groupOrder->uid, [ 'pay_count' => Db::raw('pay_count+' . count($groupOrder->orderList)), 'pay_price' => Db::raw('pay_price+' . $groupOrder->pay_price), @@ -450,7 +462,7 @@ class StoreOrderRepository extends BaseRepository $storeOrderProfitsharingRepository->insertAll($profitsharing); } $financialRecordRepository->insertAll($finance); - app()->make(StoreOrderStatusRepository::class)->insertAll($orderStatus); + $storeOrderStatusRepository->batchCreateLog($orderStatus); if (count($groupOrder['give_coupon_ids']) > 0) $groupOrder['give_coupon_ids'] = app()->make(StoreCouponRepository::class)->getGiveCoupon($groupOrder['give_coupon_ids'])->column('coupon_id'); $groupOrder->save(); @@ -510,11 +522,11 @@ class StoreOrderRepository extends BaseRepository * @author xaboy * @day 2020/6/9 */ - public function getNewOrderId() + public function getNewOrderId($type) { list($msec, $sec) = explode(' ', microtime()); $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); - $orderId = 'wx' . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); + $orderId = $type . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); return $orderId; } @@ -658,7 +670,8 @@ class StoreOrderRepository extends BaseRepository }, 'receipt' => function ($query) { return $query->field('order_id,order_receipt_id'); - } + }, + 'takeOrderList.orderProduct' ]; if ($uid) { $where['uid'] = $uid; @@ -695,6 +708,8 @@ class StoreOrderRepository extends BaseRepository } ]) ->find(); + if (!$data) + throw new ValidateException('数据不存在'); if ($data['status']) throw new ValidateException('该订单已全部核销'); return $data; @@ -722,12 +737,6 @@ class StoreOrderRepository extends BaseRepository */ public function computed(StoreOrder $order, User $user) { - - // \think\facade\Log::record('收获开始~'); - // \think\facade\Log::record($order); - // \think\facade\Log::record('收获结束~'); - // exit; - $userBillRepository = app()->make(UserBillRepository::class); if ($order->spread_uid) { $spreadUid = $order->spread_uid; @@ -789,15 +798,11 @@ class StoreOrderRepository extends BaseRepository * @author xaboy * @day 2020/8/3 */ - public function takeAfter(StoreOrder $order, User $user) + public function takeAfter(StoreOrder $order, ?User $user) { Db::transaction(function () use ($user, $order) { - $this->computed($order, $user); - //TODO 确认收货 - $statusRepository = app()->make(StoreOrderStatusRepository::class); - - $statusRepository->status($order->order_id, $statusRepository::ORDER_STATUS_TAKE, $order->order_type == 1 ? '已核销' :'已收货'); + if ($user) $this->computed($order, $user); Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_TAKE_SUCCESS', 'id' => $order->order_id]); Queue::push(SendSmsJob::class, ['tempId' => 'ADMIN_TAKE_DELIVERY_CODE', 'id' => $order->order_id]); app()->make(MerchantRepository::class)->computedLockMoney($order); @@ -821,16 +826,31 @@ class StoreOrderRepository extends BaseRepository throw new ValidateException('订单不存在'); if ($order['status'] != 1 || $order['order_type']) throw new ValidateException('订单状态有误'); - if (!$user) $user = $order->user; - if (!$user) { - throw new ValidateException('用户不存在'); + $func = 'createUserLog'; + if (!$user){ + $func = 'createSysLog'; + $user = $order->user; } +// if (!$user) { +// +// throw new ValidateException('用户不存在'); +// } $order->status = 2; $order->verify_time = date('Y-m-d H:i:s'); event('order.take.before', compact('order')); - Db::transaction(function () use ($order, $user) { + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '已收货', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_TAKE, + ]; + Db::transaction(function () use ($order, $user,$storeOrderStatusRepository,$orderStatus,$func) { $this->takeAfter($order, $user); $order->save(); + $storeOrderStatusRepository->{$func}($orderStatus); }); event('order.take', compact('order')); } @@ -1004,7 +1024,7 @@ class StoreOrderRepository extends BaseRepository * @author Qinii * @day 12/15/20 */ - public function eidt(int $id, array $data) + public function eidt(int $id, array $data, $service_id = 0) { /** @@ -1039,18 +1059,31 @@ class StoreOrderRepository extends BaseRepository //总单实际支付邮费 $_group['pay_postage'] = $this->bcmathPrice($orderGroup['pay_postage'], $order['pay_postage'], $data['pay_postage']); event('order.changePrice.before', compact('order', 'data')); - Db::transaction(function () use ($id, $data, $orderGroup, $order, $_group) { + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '订单价格修改', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_CHANGE, + ]; + Db::transaction(function () use ($id, $data, $orderGroup, $order, $_group,$storeOrderStatusRepository,$orderStatus,$service_id) { $orderGroup->total_price = $_group['total_price']; $orderGroup->pay_price = $_group['pay_price']; $orderGroup->pay_postage = $_group['pay_postage']; - $orderGroup->group_order_sn = $this->getNewOrderId() . '0'; + $orderGroup->group_order_sn = $this->getNewOrderId(StoreOrderRepository::TYPE_SN_ORDER) . '0'; $orderGroup->save(); $this->dao->update($id, $data); $this->changOrderProduct($id, $data); - $statusRepository = app()->make(StoreOrderStatusRepository::class); - $statusRepository->status($id, $statusRepository::ORDER_STATUS_CHANGE, '订单信息修改'); + if ($service_id) { + $storeOrderStatusRepository->createServiceLog($service_id,$orderStatus); + } else { + $storeOrderStatusRepository->createAdminLog($orderStatus); + } if ($data['pay_price'] != $order['pay_price']) Queue::push(SendSmsJob::class, ['tempId' => 'PRICE_REVISION_CODE', 'id' => $id]); }); event('order.changePrice', compact('order', 'data')); @@ -1144,7 +1177,7 @@ class StoreOrderRepository extends BaseRepository 'order_id' => $id, ]; $ret = $this->dao->getWhere($where); - if ($ret['is_virtual']!=0 && $ret['is_virtual']<98 ) throw new ValidateException('虚拟商品只能虚拟发货'); + if ($ret['is_virtual']!=0 && $ret['is_virtual']<=98 ) throw new ValidateException('虚拟商品只能虚拟发货'); $cargo = ''; $count = 0; foreach ($ret->orderProduct as $item) { @@ -1175,7 +1208,6 @@ class StoreOrderRepository extends BaseRepository $make = app()->make(StoreImportDeliveryRepository::class); $data = []; $num = 0; - foreach ($params['order_id'] as $item) { $ret = $this->dao->getWhere(['order_id' => $params['order_id']]); $imp = [ @@ -1187,19 +1219,12 @@ class StoreOrderRepository extends BaseRepository 'mer_id' => $merId ]; - if ( - !$ret || - $ret['mer_id'] != $merId || - $ret['is_del'] != 0 || - $ret['paid'] != 1 || - $ret['delivery_type'] != 0 - ) { + if (!$ret || $ret['status'] != 1 || $ret['mer_id'] != $merId || $ret['is_del'] != 0 || $ret['paid'] != 1 || $ret['delivery_type'] != 0 ) { $imp['status'] = 0; $imp['mark'] = '订单信息不存在或状态错误'; } else { - - switch ($params['delivery_type']) { - case 4: //电子面单 + try { + if ($params['delivery_type'] == 4) { $dump = [ 'temp_id' => $params['temp_id'], 'from_tel' => $params['from_tel'], @@ -1208,31 +1233,21 @@ class StoreOrderRepository extends BaseRepository 'delivery_name' => $params['delivery_name'], ]; $dump = $this->orderDumpInfo($item, $dump, $merId); - try { - $ret = $this->dump($item, $merId, $dump); - $num++; - $imp['delivery_id'] = $ret['delivery_id']; - $imp['delivery_name'] = $ret['delivery_name']; - $imp['status'] = 1; - } catch (Exception $exception) { - $imp['status'] = 0; - $imp['mark'] = $exception->getMessage(); - } - break; - default: - try { - $this->delivery($item, $merId,[ - 'delivery_id' => $params['delivery_id'], - 'delivery_type' => $params['delivery_type'], - 'delivery_name' => $params['delivery_name'], - ]); - $num++; - $imp['status'] = 1; - } catch (Exception $exception) { - $imp['status'] = 0; - $imp['mark'] = $exception->getMessage(); - } - break; + $ret = $this->dump($item, $merId, $dump); + $imp['delivery_id'] = $ret['delivery_id']; + $imp['delivery_name'] = $ret['delivery_name']; + } else { + $this->delivery($item, $merId,[ + 'delivery_id' => $params['delivery_id'], + 'delivery_type' => $params['delivery_type'], + 'delivery_name' => $params['delivery_name'], + ]); + } + $num++; + $imp['status'] = 1; + } catch (Exception $exception) { + $imp['status'] = 0; + $imp['mark'] = $exception->getMessage(); } } $data[] = $imp; @@ -1254,7 +1269,7 @@ class StoreOrderRepository extends BaseRepository * @author Qinii * @day 7/26/21 */ - public function dump(int $id, int $merId, array $data) + public function dump(int $id, int $merId, array $data, $service_id = 0) { $make = app()->make(MerchantRepository::class); $make->checkCrmebNum($merId, 'dump'); @@ -1269,7 +1284,7 @@ class StoreOrderRepository extends BaseRepository 'delivery_type' => 4, 'delivery_name' => $data['delivery_name'], 'delivery_id' => $result['kuaidinum'], - 'remark' => $data['remark'], + 'remark' => $data['remark'] ?? '', ]; $dump = [ @@ -1279,8 +1294,8 @@ class StoreOrderRepository extends BaseRepository 'order_sn' => $data['order_sn'], 'to_name' => $data['to_name'], ]; - Db::transaction(function () use ($merId, $id, $delivery, $make, $dump) { - $this->delivery($id, $merId, $delivery); + Db::transaction(function () use ($merId, $id, $delivery, $make, $dump, $service_id) { + $this->delivery($id, $merId, $delivery,$service_id); $arr = [ 'type' => 'mer_dump', 'num' => -1, @@ -1292,22 +1307,22 @@ class StoreOrderRepository extends BaseRepository return $delivery; } - public function runDelivery($id, $merId, $data, $split, $method) + public function runDelivery($id, $merId, $data, $split, $method,$service_id = 0) { - return Db::transaction(function () use ($id, $merId, $data, $split, $method) { + return Db::transaction(function () use ($id, $merId, $data, $split, $method,$service_id) { if ($split['is_split'] && !empty($split['split'])) { foreach ($split['split'] as $v) { $splitData[$v['id']] = $v['num']; } $order = $this->dao->get($id); - $newOrder = app()->make(StoreOrderSplitRepository::class)->splitOrder($order, $splitData); + $newOrder = app()->make(StoreOrderSplitRepository::class)->splitOrder($order, $splitData,$service_id); if ($newOrder){ $id = $newOrder->order_id; } else { throw new ValidateException('商品不能全部拆单'); } } - return $this->{$method}($id, $merId, $data); + return $this->{$method}($id, $merId, $data,$service_id); }); } @@ -1319,12 +1334,13 @@ class StoreOrderRepository extends BaseRepository * @author Qinii * @day 7/26/21 */ - public function delivery($id, $merId, $data) + public function delivery($id, $merId, $data, $service_id = 0) { $data['status'] = 1; $order = $this->dao->get($id); - if ($order['is_virtual'] && $data['delivery_type'] != 3 && $order['is_virtual'] <98) + if ($order['is_virtual'] && $data['delivery_type'] != 3) throw new ValidateException('虚拟商品只能虚拟发货'); + //订单记录 $statusRepository = app()->make(StoreOrderStatusRepository::class); switch ($data['delivery_type']) { case 1: @@ -1359,13 +1375,35 @@ class StoreOrderRepository extends BaseRepository event('order.delivery.before', compact('order', 'data')); $this->dao->update($id, $data); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $statusRepository::TYPE_ORDER, + 'change_message' => $change_message, + 'change_type' => $change_type, + ]; + if ($service_id) { + $statusRepository->createServiceLog($service_id,$orderStatus); + } else { + $statusRepository->createAdminLog($orderStatus); + } + + //虚拟发货后用户直接确认收获 if($data['status'] == 2){ $user = app()->make(UserRepository::class)->get($order['uid']); + //订单记录 $this->takeAfter($order,$user); - } + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $statusRepository::TYPE_ORDER, + 'change_message' => '虚拟发货后', + 'change_type' => $statusRepository::ORDER_STATUS_TAKE, + ]; + $statusRepository->createSysLog($orderStatus); - $statusRepository->status($id, $change_type, $change_message); + } if (isset($temp_code)) Queue::push(SendSmsJob::class, ['tempId' => $temp_code, 'id' => $order->order_id]); event('order.delivery', compact('order', 'data')); @@ -1380,18 +1418,29 @@ class StoreOrderRepository extends BaseRepository * @author Qinii * @day 2/16/22 */ - public function cityDelivery(int $id, int $merId, array $data) + public function cityDelivery(int $id, int $merId, array $data, $service_id) { $make = app()->make(DeliveryOrderRepository::class); $order = $this->dao->get($id); if ($order['is_virtual']) throw new ValidateException('虚拟商品只能虚拟发货'); $make->create($id, $merId, $data, $order); - + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); $this->dao->update($id, ['delivery_type' => 5, 'status' => 1,'remark' => $data['remark']]); - $statusRepository = app()->make(StoreOrderStatusRepository::class); - $statusRepository->status($id, $statusRepository::ORDER_DELIVERY_CITY, '订单已配送【同城配送】'); + $orderStatus = [ + 'order_id' => $id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '订单配送【同城配送】', + 'change_type' => $storeOrderStatusRepository::ORDER_DELIVERY_SELF, + ]; + if ($service_id) { + $storeOrderStatusRepository->createServiceLog($service_id,$orderStatus); + } else { + $storeOrderStatusRepository->createAdminLog($orderStatus); + } Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_DELIVER_SUCCESS', 'id' => $id]); } @@ -1404,7 +1453,7 @@ class StoreOrderRepository extends BaseRepository $whre['mer_id'] = $merId; $whre['is_system_del'] = 0; } - return $this->dao->getWhere($where, '*', [ + $res = $this->dao->getWhere($where, '*', [ 'orderProduct', 'user' => function ($query) { $query->field('uid,real_name,nickname,is_svip,svip_endtime,phone'); @@ -1412,13 +1461,24 @@ class StoreOrderRepository extends BaseRepository 'refundOrder' => function ($query) { $query->field('order_id,extension_one,extension_two,refund_price,integral')->where('status', 3); }, - 'finalOrder',] - )->append(['refund_extension_one', 'refund_extension_two']); + 'finalOrder', + 'TopSpread' => function ($query) { + $query->field('uid,nickname,avatar'); + }, + 'spread' => function ($query) { + $query->field('uid,nickname,avatar'); + }, + ] + ); + if (!$res) throw new ValidateException('数据不存在'); + $res['integral'] = (int)$res['integral']; + return $res->append(['refund_extension_one', 'refund_extension_two']); } - public function getOrderStatus($id, $page, $limit) + public function getOrderStatus($where, $page, $limit) { - return app()->make(StoreOrderStatusRepository::class)->search($id, $page, $limit); + $where['type'] = StoreOrderStatusRepository::TYPE_ORDER; + return app()->make(StoreOrderStatusRepository::class)->search($where, $page, $limit); } public function remarkForm($id) @@ -1428,7 +1488,7 @@ class StoreOrderRepository extends BaseRepository $form->setRule([ Elm::text('remark', '备注', $data['remark'])->required(), ]); - return $form->setTitle('修改备注'); + return $form->setTitle('订单备注'); } public function adminMarkForm($id) @@ -1438,7 +1498,7 @@ class StoreOrderRepository extends BaseRepository $form->setRule([ Elm::text('admin_mark', '备注', $data['admin_mark'])->required(), ]); - return $form->setTitle('修改备注'); + return $form->setTitle('订单备注'); } /** @@ -1464,6 +1524,9 @@ class StoreOrderRepository extends BaseRepository $query->field('group_order_id,group_order_sn'); }, 'finalOrder', + 'user' => function ($query) { + $query->field('uid,nickname,avatar'); + }, ])->page($page, $limit)->select()->append(['refund_extension_one', 'refund_extension_two']); return compact('count', 'list'); @@ -1574,6 +1637,9 @@ class StoreOrderRepository extends BaseRepository 'spread' => function ($query) { $query->field('uid,nickname,avatar'); }, + 'user' => function ($query) { + $query->field('uid,nickname,avatar'); + }, ]); $count = $query->count(); $list = $query->page($page, $limit)->select()->append(['refund_extension_one', 'refund_extension_two']); @@ -1750,6 +1816,8 @@ class StoreOrderRepository extends BaseRepository $order->presell_price = $order->pay_price; } } + $order->takeOrderCount = count($order['takeOrderList']); + unset($order['takeOrderList']); } return compact( 'count','list'); @@ -1910,15 +1978,30 @@ class StoreOrderRepository extends BaseRepository foreach ($data['data'] as $v) { $splitData[$v['id']] = $v['num']; } - $spl = app()->make(StoreOrderSplitRepository::class)->splitOrder($order, $splitData); + $spl = app()->make(StoreOrderSplitRepository::class)->splitOrder($order, $splitData, $serviceId, 1); if ($spl) $order = $spl; $order->status = 2; $order->verify_time = date('Y-m-d H:i:s'); $order->verify_service_id = $serviceId; event('order.verify.before', compact('order')); - Db::transaction(function () use ($order) { + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + Db::transaction(function () use ($order,$storeOrderStatusRepository,$serviceId) { $this->takeAfter($order, $order->user); $order->save(); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '订单已核销', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_TAKE, + ]; + if ($serviceId){ + $storeOrderStatusRepository->createServiceLog($serviceId,$orderStatus); + } else { + $storeOrderStatusRepository->createAdminLog($orderStatus); + } + }); event('order.verify', compact('order')); } @@ -2083,8 +2166,7 @@ class StoreOrderRepository extends BaseRepository public function orderRefundAllAfter($order) { - $statusRepository = app()->make(StoreOrderStatusRepository::class); - $statusRepository->status($order['order_id'], $statusRepository::ORDER_STATUS_REFUND_ALL, '订单已全部退款'); + if ($order->activity_type == 10) { app()->make(StoreDiscountRepository::class)->incStock($order->orderProduct[0]['activity_id']); } @@ -2113,6 +2195,17 @@ class StoreOrderRepository extends BaseRepository } } + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '订单已全部退款', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_REFUND_ALL, + ]; + $storeOrderStatusRepository->createSysLog($orderStatus); + event('order.refundAll', compact('order')); } @@ -2137,12 +2230,20 @@ class StoreOrderRepository extends BaseRepository public function delOrder($order, $info = '订单删除') { - Db::transaction(function () use ($info, $order) { + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => $info, + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_DELETE, + ]; + $productRepository = app()->make(ProductRepository::class); + Db::transaction(function () use ($info, $order, $orderStatus, $storeOrderStatusRepository,$productRepository) { $order->is_del = 1; $order->save(); - $statusRepository = app()->make(StoreOrderStatusRepository::class); - $statusRepository->status($order->order_id, $statusRepository::ORDER_STATUS_DELETE, $info); - $productRepository = app()->make(ProductRepository::class); + $storeOrderStatusRepository->createUserLog($orderStatus); foreach ($order->orderProduct as $cart) { $productRepository->orderProductIncStock($order, $cart); } @@ -2314,7 +2415,28 @@ class StoreOrderRepository extends BaseRepository }); if (file_exists($arrary['path'])) unlink($arrary['path']); } - + /** + * TODO 根据订单查询相关联的自订单 + * @param $id + * @param $merId + * @return \think\Collection + * @author Qinii + * @day 2023/2/22 + */ + public function childrenList($id,$merId) + { + $data = $this->dao->get($id); + $query = $this->dao->getSearch([])->with(['orderProduct'])->where('order_id','<>',$id); + if ($merId) $query->where('mer_id',$merId); + if ($data['main_id']) { + $query->where(function($query) use($data,$id){ + $query->where('main_id',$data['main_id'])->whereOr('order_id',$data['main_id']); + }); + } else { + $query->where('main_id',$id); + } + return $query->select(); + } public function setProduct(array $arrary, $merId) { //读取excel diff --git a/app/common/repositories/store/order/StoreOrderSplitRepository.php b/app/common/repositories/store/order/StoreOrderSplitRepository.php index 47e49b31..7ff387f5 100644 --- a/app/common/repositories/store/order/StoreOrderSplitRepository.php +++ b/app/common/repositories/store/order/StoreOrderSplitRepository.php @@ -26,22 +26,22 @@ use think\facade\Db; */ class StoreOrderSplitRepository extends StoreOrderRepository { - public function splitOrder(StoreOrder $order, array $rule) + public function splitOrder(StoreOrder $order, array $rule, $service_id = 0, $type = null) { - return app()->make(LockService::class)->exec('order.split.' . $order->order_id, function () use ($rule, $order) { - return $this->execSplitOrder($order, $rule); + return app()->make(LockService::class)->exec('order.split.' . $order->order_id, function () use ($rule, $order,$service_id,$type) { + return $this->execSplitOrder($order, $rule, $service_id,$type); }); } - public function execSplitOrder(StoreOrder $order, array $rule) + public function execSplitOrder(StoreOrder $order, array $rule, $service_id = 0, $type = null) { if ($order['status'] != 0) { throw new ValidateException('订单已发货'); } - if ($order['activity_type'] == 2) { + if ($order['activity_type'] == 2 && !$type) { throw new ValidateException('预售订单不能拆单'); } - return Db::transaction(function () use ($order, $rule) { + return Db::transaction(function () use ($order, $rule,$service_id) { $newOrderId = 0; $newOrder = $order->getOrigin(); $newOrder['total_num'] = 0; @@ -199,6 +199,29 @@ class StoreOrderSplitRepository extends StoreOrderRepository if ($flag) { $this->orderRefundAllAfter($order); } + $statusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $statusRepository::TYPE_ORDER, + 'change_message' => '生成子订单:'.$newOrder->order_sn, + 'change_type' => $statusRepository::ORDER_STATUS_SPLIT, + ]; + $newOrderStatus = [ + 'order_id' => $newOrder->order_id, + 'order_sn' => $newOrder->order_sn, + 'type' => $statusRepository::TYPE_ORDER, + 'change_message' => '生成子订单', + 'change_type' => $statusRepository::ORDER_STATUS_SPLIT, + ]; + + if ($service_id) { + $statusRepository->createServiceLog($service_id,$orderStatus); + $statusRepository->createServiceLog($service_id,$newOrderStatus); + } else { + $statusRepository->createAdminLog($orderStatus); + $statusRepository->createAdminLog($newOrderStatus); + } return $newOrder; }); } diff --git a/app/common/repositories/store/order/StoreOrderStatusRepository.php b/app/common/repositories/store/order/StoreOrderStatusRepository.php index a7674627..72294d6a 100644 --- a/app/common/repositories/store/order/StoreOrderStatusRepository.php +++ b/app/common/repositories/store/order/StoreOrderStatusRepository.php @@ -13,9 +13,10 @@ namespace app\common\repositories\store\order; - use app\common\dao\store\order\StoreOrderStatusDao; use app\common\repositories\BaseRepository; +use app\common\repositories\store\service\StoreServiceRepository; +use app\common\repositories\store\service\StoreServiceUserRepository; /** * Class StoreOrderStatusRepository @@ -26,21 +27,57 @@ use app\common\repositories\BaseRepository; */ class StoreOrderStatusRepository extends BaseRepository { + //订单日志 + public const TYPE_ORDER = 'order'; + //退款单日志 + public const TYPE_REFUND = 'refund'; + //商品日志 +// public const TYPE_PRODUCT = 'product'; + //操作者类型 + public const U_TYPE_SYSTEM = 0; + public const U_TYPE_USER = 1; + public const U_TYPE_ADMIN = 2; + public const U_TYPE_MERCHANT = 3; + public const U_TYPE_SERVICE = 4; - + //订单变动类型 + //取消 const ORDER_STATUS_CANCEL = 'cancel'; + //改价 const ORDER_STATUS_CHANGE = 'change'; + //创建 const ORDER_STATUS_CREATE = 'create'; + //删除 const ORDER_STATUS_DELETE = 'delete'; + //收货 const ORDER_STATUS_TAKE = 'take'; + //拆单 + const ORDER_STATUS_SPLIT = 'split'; + //完成 const ORDER_STATUS_OVER = 'over'; - const ORDER_STATUS_PRESELL= 'presell'; - const ORDER_STATUS_REFUND_ALL = 'refund_all'; const ORDER_STATUS_AUTO_OVER = 'auto_over'; + //预售订单 + const ORDER_STATUS_PRESELL= 'presell'; const ORDER_STATUS_PRESELL_CLOSE = 'presell_close'; - const ORDER_STATUS_PAY_SUCCCESS = 'pay_success'; + //全部退款 + const ORDER_STATUS_REFUND_ALL = 'refund_all'; + //支付成功 + const ORDER_STATUS_PAY_SUCCCESS = 'pay_success'; + //拼图成功 const ORDER_STATUS_GROUP_SUCCESS = 'group_success'; + //申请退款 + const CHANGE_REFUND_CREATGE = 'refund_create'; + //已发货 + const CHANGE_BACK_GOODS = 'back_goods'; + //退款申请已通过 + const CHANGE_REFUND_AGREE = 'refund_agree'; + //退款成功 + const CHANGE_REFUND_PRICE = 'refund_price'; + //订单退款已拒绝 + const CHANGE_REFUND_REFUSE = 'refund_refuse'; + //用户取消退款 + const CHANGE_REFUND_CANCEL = 'refund_cancel'; /* 2 => '待取货', @@ -64,7 +101,6 @@ class StoreOrderStatusRepository extends BaseRepository const ORDER_DELIVERY_CITY_REFUNDING = 'delivery_5_9'; - /** * StoreOrderStatusRepository constructor. * @param StoreOrderStatusDao $dao @@ -87,11 +123,52 @@ class StoreOrderStatusRepository extends BaseRepository return $this->dao->create(compact('order_id', 'change_message', 'change_type')); } - public function search($id,$page, $limit) + public function search($where,$page, $limit) { - $query = $this->dao->search($id); + $query = $this->dao->search($where)->order('change_time DESC'); $count = $query->count(); $list = $query->page($page, $limit)->select(); return compact('count','list'); } + + public function createAdminLog(array $data) + { + $request = request(); + $data['user_type'] = $request->userType(); + $data['uid'] = $request->adminId(); + $data['nickname'] = $request->adminInfo()->real_name; + return $this->dao->create($data); + } + + public function createServiceLog($service_id, array $data) + { + $service = app()->make(StoreServiceRepository::class)->getWhere(['service_id' => $service_id]); + $data['user_type'] = self::U_TYPE_SERVICE; + $data['uid'] = $service_id; + $data['nickname'] = $service->nickname; + return $this->dao->create($data); + } + + public function createUserLog(array $data) + { + $data['user_type'] = self::U_TYPE_USER; + $data['uid'] = request()->uid(); + $data['nickname'] = request()->userInfo()->nickname; + return $this->dao->create($data); + } + + public function createSysLog(array $data) + { + $data['user_type'] = self::U_TYPE_SYSTEM; + $data['uid'] = 0; + $data['nickname'] = '系统'; + return $this->dao->create($data); + } + + public function batchCreateLog($data) + { + if(!empty($data)) { + return $this->dao->insertAll($data); + } + } } diff --git a/app/common/repositories/store/order/StoreRefundOrderRepository.php b/app/common/repositories/store/order/StoreRefundOrderRepository.php index 67763bc4..523acd0e 100644 --- a/app/common/repositories/store/order/StoreRefundOrderRepository.php +++ b/app/common/repositories/store/order/StoreRefundOrderRepository.php @@ -118,10 +118,19 @@ class StoreRefundOrderRepository extends BaseRepository */ public function userDel($id, $uid) { - Db::transaction(function () use ($uid, $id) { + $ret = $this->dao->get($id); + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $ret->refund_order_id, + 'order_sn' => $ret->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + 'change_message' => '创建退款单', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_DELETE, + ]; + Db::transaction(function () use ($uid, $id,$storeOrderStatusRepository,$orderStatus) { $this->dao->userDel($uid, $id); - $make = app()->make(StoreRefundStatusRepository::class); - $make->status($id, $make::CHANGE_DELETE, '删除记录'); + $storeOrderStatusRepository->createUserLog($orderStatus); }); } @@ -182,7 +191,7 @@ class StoreRefundOrderRepository extends BaseRepository $data['order_id'] = $products[0]['order_id']; $data['uid'] = $products[0]['uid']; $data['mer_id'] = $order['mer_id']; - $data['refund_order_sn'] = $this->getNewOrderId(); + $data['refund_order_sn'] = app()->make(StoreOrderRepository::class)->getNewOrderId(StoreOrderRepository::TYPE_SN_REFUND); $data['refund_num'] = $totalRefundNum; $data['extension_one'] = $total_extension_one; $data['extension_two'] = $total_extension_two; @@ -190,7 +199,10 @@ class StoreRefundOrderRepository extends BaseRepository $data['integral'] = $totalIntegral; $data['platform_refund_price'] = $totalPlatformRefundPrice; $data['refund_postage'] = $totalPostage; - return Db::transaction(function () use ($refundProduct, $data, $products, $order, &$refund_order_id) { + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + + return Db::transaction(function () use ($refundProduct, $data, $products, $order, &$refund_order_id,$storeOrderStatusRepository,$refund_message) { event('refund.creates.before', compact('data')); $refund = $this->dao->create($data); $refund_order_id = $refund->refund_order_id; @@ -199,8 +211,14 @@ class StoreRefundOrderRepository extends BaseRepository $product->is_refund = 1; $product->save(); } - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($refund->refund_order_id, $statusRepository::CHANGE_CREATE, '创建批量退款单'); + $orderStatus = [ + 'order_id' => $refund->refund_order_id, + 'order_sn' => $order->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + 'change_message' => $refund_message, + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_CREATE, + ]; + $storeOrderStatusRepository->createSysLog($orderStatus); app()->make(StoreRefundProductRepository::class)->insertAll($refundProduct); return $refund; }); @@ -304,7 +322,7 @@ class StoreRefundOrderRepository extends BaseRepository $data['order_id'] = $products[0]['order_id']; $data['uid'] = $products[0]['uid']; $data['mer_id'] = $order['mer_id']; - $data['refund_order_sn'] = $this->getNewOrderId(); + $data['refund_order_sn'] = app()->make(StoreOrderRepository::class)->getNewOrderId(StoreOrderRepository::TYPE_SN_REFUND); $data['refund_num'] = $totalRefundNum; $data['extension_one'] = $total_extension_one; $data['extension_two'] = $total_extension_two; @@ -312,6 +330,7 @@ class StoreRefundOrderRepository extends BaseRepository $data['integral'] = $totalIntegral; $data['platform_refund_price'] = $totalPlatformRefundPrice; $data['refund_postage'] = $totalPostage; + return Db::transaction(function () use ($refundProduct, $data, $products, $order, &$refund_order_id) { event('refund.creates.before', compact('data')); $refund = $this->dao->create($data); @@ -321,8 +340,6 @@ class StoreRefundOrderRepository extends BaseRepository $product->is_refund = 1; $product->save(); } - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($refund->refund_order_id, $statusRepository::CHANGE_CREATE, '创建批量退款单'); app()->make(StoreRefundProductRepository::class)->insertAll($refundProduct); $this->applyRefundAfter($refund, $order); return $refund; @@ -332,6 +349,24 @@ class StoreRefundOrderRepository extends BaseRepository public function applyRefundAfter($refund, $order) { event('refund.create', compact('refund', 'order')); + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $refund->refund_order_id, + 'order_sn' => $refund->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + 'change_message' => '创建退款单', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_CREATE, + ]; + $storeOrderStatusRepository->createUserLog($orderStatus); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '申请退款', + 'change_type' => $storeOrderStatusRepository::CHANGE_REFUND_CREATGE, + ]; + $storeOrderStatusRepository->createUserLog($orderStatus); Queue::push(SendSmsJob::class, ['tempId' => 'ADMIN_RETURN_GOODS_CODE', 'id' => $refund->refund_order_id]); SwooleTaskService::merchant('notice', [ 'type' => 'new_refund_order', @@ -424,10 +459,11 @@ class StoreRefundOrderRepository extends BaseRepository $data['uid'] = $product['uid']; $data['mer_id'] = $order['mer_id']; - $data['refund_order_sn'] = $this->getNewOrderId(); + $data['refund_order_sn'] = app()->make(StoreOrderRepository::class)->getNewOrderId(StoreOrderRepository::TYPE_SN_REFUND); $data['refund_num'] = $num; $data['extension_one'] = $total_extension_one; $data['extension_two'] = $total_extension_two; + return Db::transaction(function () use ($order, $data, $product, $productId, $num) { event('refund.create.before', compact('data')); $refund = $this->dao->create($data); @@ -443,26 +479,12 @@ class StoreRefundOrderRepository extends BaseRepository $product->refund_num -= $num; $product->is_refund = 1; $product->save(); - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($refund->refund_order_id, $statusRepository::CHANGE_CREATE, '创建退款单'); $this->applyRefundAfter($refund, $order); return $refund; }); } - /** - * @return string - * @author xaboy - * @day 2020/6/9 - */ - public function getNewOrderId() - { - list($msec, $sec) = explode(' ', microtime()); - $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); - $orderId = 'rwx' . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); - return $orderId; - } /** * @param array $where @@ -680,10 +702,19 @@ class StoreRefundOrderRepository extends BaseRepository throw new ValidateException('退款单状态有误'); $refund->status = 2; $refund->status_time = date('Y-m-d H:i:s'); - Db::transaction(function () use ($refund, $data, $id, $uid) { + + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $refund->refund_order_id, + 'order_sn' => $refund->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + 'change_message' => '退款单退回商品已发货', + 'change_type' => $storeOrderStatusRepository::CHANGE_BACK_GOODS, + ]; + Db::transaction(function () use ($refund, $data, $id, $uid,$storeOrderStatusRepository,$orderStatus) { $refund->save($data); - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($id, $statusRepository::CHANGE_BACK_GOODS, '已发货'); + $storeOrderStatusRepository->createUserLog($orderStatus); event('refund.backGoods',compact('uid','id','data')); }); Queue::push(SendSmsJob::class, [ @@ -754,17 +785,41 @@ class StoreRefundOrderRepository extends BaseRepository * @author Qinii * @day 2020-06-13 */ - public function refuse($id, $data) + public function refuse($id, $data, $service_id = 0) { - Db::transaction(function () use ($id, $data) { - $res = $this->getWhere(['refund_order_id' => $id], '*', ['refundProduct.product']); + $refund = $this->getWhere(['refund_order_id' => $id], '*', ['refundProduct.product']); + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $refund->order_id, + 'order_sn' => $refund->order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '订单退款已拒绝:'.$refund->refund_order_sn, + 'change_type' => $storeOrderStatusRepository::CHANGE_REFUND_REFUSE, + ]; + $refundOrderStatus = [ + 'order_id' => $refund->refund_order_id, + 'order_sn' => $refund->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + 'change_message' => '订单退款已拒绝', + 'change_type' => $storeOrderStatusRepository::CHANGE_REFUND_REFUSE, + ]; + + Db::transaction(function () use ($id, $data,$refund,$service_id,$storeOrderStatusRepository,$orderStatus,$refundOrderStatus) { + $data['status_time'] = date('Y-m-d H:i:s'); - $this->getProductRefundNumber($res, -1); + $this->getProductRefundNumber($refund, -1); $this->dao->update($id, $data); - $refund = $res; + + if ($service_id) { + $storeOrderStatusRepository->createServiceLog($service_id,$orderStatus); + $storeOrderStatusRepository->createServiceLog($service_id,$refundOrderStatus); + } else { + $storeOrderStatusRepository->createAdminLog($orderStatus); + $storeOrderStatusRepository->createAdminLog($refundOrderStatus); + } + event('refund.refuse',compact('id','refund')); - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($id, $statusRepository::CHANGE_REFUND_REFUSE, '订单退款已拒绝'); Queue::push(SendSmsJob::class, ['tempId' => 'REFUND_FAIL_CODE', 'id' => $id]); }); } @@ -778,31 +833,43 @@ class StoreRefundOrderRepository extends BaseRepository * @author Qinii * @day 2020-06-13 */ - public function agree(int $id, array $data, int $adminId) + public function agree(int $id, array $data, $service_id = 0) { + //已退款金额 $_refund_price = $this->checkRefundPrice($id); - Db::transaction(function () use ($id, $data, $adminId, $_refund_price) { - $res = $this->dao->getWhere(['refund_order_id' => $id], '*', ['refundProduct.product']); - $this->getProductRefundNumber($res, 1); - $refund = $res; - if ($res['refund_type'] == 1) { + $refund = $this->dao->getWhere(['refund_order_id' => $id], '*', ['refundProduct.product']); + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $refund->refund_order_id, + 'order_sn' => $refund->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + ]; + Db::transaction(function () use ($id, $data, $_refund_price, $refund,$storeOrderStatusRepository,$orderStatus,$service_id) { + $this->getProductRefundNumber($refund, 1); + if ($refund['refund_type'] == 1) { //TODO 退款单同意退款 $refund = $this->doRefundPrice($id, $_refund_price); $data['status'] = 3; - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($id, $statusRepository::CHANGE_REFUND_PRICE, '退款成功'); + $orderStatus['change_message'] = '退款成功'; + $orderStatus['change_type'] = $storeOrderStatusRepository::ORDER_STATUS_CREATE; $this->refundAfter($refund); } - if ($res['refund_type'] == 2) { + if ($refund['refund_type'] == 2) { $data['status'] = 1; - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($id, $statusRepository::CHANGE_REFUND_AGREE, '退款申请已通过,请将商品寄回'); + $orderStatus['change_message'] = '退款申请已通过,请将商品寄回'; + $orderStatus['change_type'] = $storeOrderStatusRepository::CHANGE_REFUND_AGREE; Queue::push(SendSmsJob::class, ['tempId' => 'REFUND_SUCCESS_CODE', 'id' => $id]); } $data['status_time'] = date('Y-m-d H:i:s'); $this->dao->update($id, $data); + if ($service_id) { + $storeOrderStatusRepository->createServiceLog($service_id,$orderStatus); + } else { + $storeOrderStatusRepository->createAdminLog($orderStatus); + } event('refund.agree', compact('id', 'refund')); }); } @@ -870,6 +937,7 @@ class StoreRefundOrderRepository extends BaseRepository 'type' => 1, 'order_id' => $orderId, ]; + return $this->dao->search($where)->when($refundOrderId, function ($query) use ($refundOrderId) { $query->where('refund_order_id', '<>', $refundOrderId); })->column('refund_order_id'); @@ -1079,16 +1147,28 @@ class StoreRefundOrderRepository extends BaseRepository * @author Qinii * @day 2020-06-13 */ - public function adminRefund($id, $admin) + public function adminRefund($id, $service_id = null) { - Db::transaction(function () use ($admin, $id) { + $refund = $this->dao->getWhere(['refund_order_id' => $id], '*', ['refundProduct.product']); + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $refund->refund_order_id, + 'order_sn' => $refund->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + 'change_message' => '退款成功', + 'change_type' => $storeOrderStatusRepository::CHANGE_REFUND_PRICE, + ]; + Db::transaction(function () use ($service_id, $id,$refund,$storeOrderStatusRepository,$orderStatus) { $data['status'] = 3; $data['status_time'] = date('Y-m-d H:i:s'); - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($id, $statusRepository::CHANGE_REFUND_PRICE, '退款成功' . ($admin ? '' : '[自动]')); $this->dao->update($id, $data); - $res = $this->dao->getWhere(['refund_order_id' => $id], '*', ['refundProduct.product']); - $this->getProductRefundNumber($res, 1, true); + if ($service_id) { + $storeOrderStatusRepository->createServiceLog($service_id,$orderStatus); + } else { + $storeOrderStatusRepository->createAdminLog($orderStatus); + } + $this->getProductRefundNumber($refund, 1, true); $refund = $this->doRefundPrice($id, 0); if ($refund) $this->refundAfter($refund); }); @@ -1134,7 +1214,10 @@ class StoreRefundOrderRepository extends BaseRepository 'data' => [ 'refund_id' => $res->refund_order_sn, 'pay_price' => $res->order->groupOrder->pay_price, - 'refund_price' => $res->refund_price + 'refund_price' => $res->refund_price, + 'refund_message' => $res->refund_message, + 'open_id' => $res->user->wechat->routine_openid ?? null, + 'transaction_id' => $res->order->transaction_id, ] ]; } @@ -1469,15 +1552,25 @@ class StoreRefundOrderRepository extends BaseRepository public function cancel(int $id, $user) { //状态 0:待审核 -1:审核未通过 1:待退货 2:待收货 3:已退款 - $res = $this->dao->getWhere(['refund_order_id' => $id, 'uid' => $user->uid],'*', ['refundProduct.product']); - if (!$res) throw new ValidateException('数据不存在'); - if (!in_array($res['status'],[self::REFUND_STATUS_WAIT, self::REFUND_STATUS_BACK])) + $refund = $this->dao->getWhere(['refund_order_id' => $id, 'uid' => $user->uid],'*', ['refundProduct.product']); + if (!$refund) throw new ValidateException('数据不存在'); + if (!in_array($refund['status'],[self::REFUND_STATUS_WAIT, self::REFUND_STATUS_BACK])) throw new ValidateException('当前状态不可取消'); - Db::transaction(function () use ($id, $res) { - $this->getProductRefundNumber($res, -1); + + //退款订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $refund->refund_order_id, + 'order_sn' => $refund->refund_order_sn, + 'type' => $storeOrderStatusRepository::TYPE_REFUND, + 'change_message' => '用户取消退款', + 'change_type' => $storeOrderStatusRepository::CHANGE_REFUND_CANCEL, + ]; + + Db::transaction(function () use ($id, $refund,$storeOrderStatusRepository,$orderStatus) { + $this->getProductRefundNumber($refund, -1); $this->dao->update($id, ['status_time' => date('Y-m-d H:i:s'), 'status' => self::REFUND_STATUS_CANCEL]); - $statusRepository = app()->make(StoreRefundStatusRepository::class); - $statusRepository->status($id, $statusRepository::CHANGE_REFUND_CANCEL, '用户取消退款'); + $storeOrderStatusRepository->createUserLog($orderStatus); }); } } diff --git a/app/common/repositories/store/product/ProductAssistRepository.php b/app/common/repositories/store/product/ProductAssistRepository.php index 185637e3..30109a83 100644 --- a/app/common/repositories/store/product/ProductAssistRepository.php +++ b/app/common/repositories/store/product/ProductAssistRepository.php @@ -504,7 +504,7 @@ class ProductAssistRepository extends BaseRepository 'data' => [ 'title' => $data['status'] == -2 ? '下架提醒' : '审核结果', 'message' => $message, - 'id' => $id[0] + 'id' => $id ] ], $ret->mer_id); app()->make(SpuRepository::class)->changeStatus($id,3); diff --git a/app/common/repositories/store/product/ProductCopyRepository.php b/app/common/repositories/store/product/ProductCopyRepository.php index 04b59dea..ca4bcda8 100644 --- a/app/common/repositories/store/product/ProductCopyRepository.php +++ b/app/common/repositories/store/product/ProductCopyRepository.php @@ -44,23 +44,24 @@ class ProductCopyRepository extends BaseRepository public function getProduct($url,$merId) { $key = $merId.'_url_'.$url; - if ($result= Cache::get($key)) return $result; - if (systemConfig('copy_product_status') == 2) { - $resultData['data'] = app()->make(CrmebServeServices::class)->copy()->goods($url); - $resultData['status'] = 200; - } else { + if (systemConfig('copy_product_status') == 1) { $resultData = $this->useApi($url); + } else { + $resultData['data'] = app()->make(CrmebServeServices::class)->copy()->goods($url); + $resultData['status'] = true; } - if ($resultData['status']) { + if ($resultData['status'] && $resultData['status']) { $result = $this->getParamsData($resultData['data']); - Cache::set($key,$result); - $this->add(['type' => 'copy', 'num' => 1, 'info' => $url , 'mer_id'=> $merId, 'message' => '采集商品',],$merId); + $this->add(['type' => 'copy', 'num' => -1, 'info' => $url , 'mer_id' => $merId, 'message' => '采集商品',],$merId); return $result; } else { + if (isset($resultData['msg'])) + throw new ValidateException('接口错误信息:'.$resultData['msg']); throw new ValidateException('采集失败,请更换链接重试!'); } + } /** @@ -217,7 +218,8 @@ class ProductCopyRepository extends BaseRepository ]); $make = app()->make(AttachmentRepository::class); $serve = app()->make(DownloadImageService::class); - $type = systemConfig('upload_type'); + $type = (int)systemConfig('upload_type') ?: 1; + if (is_array($data)) { foreach ($data as $datum) { $arcurl = is_int(strpos($datum, 'http')) ? $datum : 'http://' . ltrim( $datum, '\//'); @@ -310,7 +312,7 @@ class ProductCopyRepository extends BaseRepository if(systemConfig('copy_product_status')){ $data = [ 'type' => 'sys', - 'num' => systemConfig('copy_product_defaul'), + 'num' => systemConfig('copy_product_defaul') ?? 0, 'message' => '赠送次数', ]; $this->add($data,$merId); diff --git a/app/common/repositories/store/product/ProductGroupBuyingRepository.php b/app/common/repositories/store/product/ProductGroupBuyingRepository.php index 420e473f..e7b33925 100644 --- a/app/common/repositories/store/product/ProductGroupBuyingRepository.php +++ b/app/common/repositories/store/product/ProductGroupBuyingRepository.php @@ -10,10 +10,12 @@ // +---------------------------------------------------------------------- namespace app\common\repositories\store\product; +use app\common\model\store\order\StoreOrder; use app\common\model\store\product\ProductGroupBuying; use app\common\repositories\BaseRepository; use app\common\dao\store\product\ProductGroupBuyingDao; use app\common\repositories\store\order\StoreOrderRepository; +use app\common\repositories\store\order\StoreOrderStatusRepository; use app\common\repositories\store\order\StoreRefundOrderRepository; use app\common\repositories\user\UserRepository; use crmeb\jobs\CancelGroupBuyingJob; @@ -191,9 +193,33 @@ class ProductGroupBuyingRepository extends BaseRepository app()->make(ProductGroupRepository::class)->incField($res['product_group_id'], 'success_num', 1); $productGroupUserRepository = app()->make(ProductGroupUserRepository::class); $productGroupUserRepository->updateStatus($res['group_buying_id']); - $orderIds = $productGroupUserRepository->groupOrderIds($res['group_buying_id']); - app()->make(StoreOrderRepository::class)->groupBuyingStatus($orderIds, 0); - Queue::push(SendSmsJob::class,['tempId' => 'USER_BALANCE_CHANGE', 'id' => $res->group_buying_id]); + $user = $productGroupUserRepository->groupOrderIds($res['group_buying_id']); + $storeOrderStatusRepository = app()->make(storeOrderStatusRepository::class); + $data = $orderIds = []; + foreach ($user as $item) { + $data[] = [ + 'order_id' => $item['order_id'], + 'order_sn' => $item['orderInfo']['order_sn'], + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '拼团成功', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_GROUP_SUCCESS, + 'uid' => 0, + 'nickname' => '系统', + 'user_type' => $storeOrderStatusRepository::U_TYPE_SYSTEM, + ]; + $orderIds[] = $item['order_id']; + } + if ($data && $orderIds) { + Db::transaction(function () use ($storeOrderStatusRepository, $orderIds, $data, $res) { + $storeOrderStatusRepository->batchCreateLog($data); + app()->make(StoreOrderRepository::class) + ->getSearch([]) + ->whereIn('order_id', $orderIds) + ->update(['status' => 0]); + Queue::push(SendSmsJob::class, ['tempId' => 'USER_BALANCE_CHANGE', 'id' => $res->group_buying_id]); + }); + } + } diff --git a/app/common/repositories/store/product/ProductGroupRepository.php b/app/common/repositories/store/product/ProductGroupRepository.php index e93092b5..48e6189e 100644 --- a/app/common/repositories/store/product/ProductGroupRepository.php +++ b/app/common/repositories/store/product/ProductGroupRepository.php @@ -488,7 +488,7 @@ class ProductGroupRepository extends BaseRepository 'data' => [ 'title' => $data['status'] == -2 ? '下架提醒' : '审核结果', 'message' => $message, - 'id' => $id[0] + 'id' => $id ] ], $ret->mer_id); app()->make(SpuRepository::class)->changeStatus($id,4); diff --git a/app/common/repositories/store/product/ProductPresellRepository.php b/app/common/repositories/store/product/ProductPresellRepository.php index 4a614daa..c4fe3a83 100644 --- a/app/common/repositories/store/product/ProductPresellRepository.php +++ b/app/common/repositories/store/product/ProductPresellRepository.php @@ -17,6 +17,7 @@ use app\common\model\store\product\ProductLabel; use app\common\repositories\BaseRepository; use app\common\repositories\store\order\StoreOrderProductRepository; use app\common\repositories\store\order\StoreOrderRepository; +use crmeb\jobs\ChangeSpuStatusJob; use crmeb\services\SwooleTaskService; use think\exception\ValidateException; use think\facade\Db; @@ -503,7 +504,6 @@ class ProductPresellRepository extends BaseRepository $item->product->product_type = 0; $item->product->save(); queue(ChangeSpuStatusJob::class, ['id' => $item->product_presell_id, 'product_type' => 2]); - // app()->make(SpuRepository::class)->changeStatus($item->product_presell_id, 2); } }); } @@ -526,6 +526,7 @@ class ProductPresellRepository extends BaseRepository if (!$ret) throw new ValidateException('数据不存在'); event('product.presellStatus.before', compact('id', 'data')); + $this->dao->update($id, $data); event('product.presellStatus', compact('id', 'data')); @@ -536,9 +537,10 @@ class ProductPresellRepository extends BaseRepository 'data' => [ 'title' => $data['status'] == -2 ? '下架提醒' : '审核结果', 'message' => $message, - 'id' => $id[0] + 'id' => $id ] ], $ret->mer_id); + app()->make(SpuRepository::class)->changeStatus($id,2); } } diff --git a/app/common/repositories/store/product/ProductReplyRepository.php b/app/common/repositories/store/product/ProductReplyRepository.php index 0fc9fac4..1f7d8c23 100644 --- a/app/common/repositories/store/product/ProductReplyRepository.php +++ b/app/common/repositories/store/product/ProductReplyRepository.php @@ -249,8 +249,16 @@ class ProductReplyRepository extends BaseRepository $orderProduct->orderInfo->status = 3; $orderProduct->orderInfo->save(); //TODO 交易完成 - $statusRepository = app()->make(StoreOrderStatusRepository::class); - $statusRepository->status($orderProduct->orderInfo->order_id, $statusRepository::ORDER_STATUS_OVER, '交易完成'); + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $orderProduct->orderInfo->order_id, + 'order_sn' => $orderProduct->orderInfo->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '交易完成', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_OVER, + ]; + $storeOrderStatusRepository->createSysLog($orderStatus); } }); SwooleTaskService::merchant('notice', [ diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index e556955c..81922ddc 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -73,8 +73,8 @@ class ProductRepository extends BaseRepository ['svip_price_type',0], ['params',[]], ]; - protected $admin_filed = 'Product.product_id,Product.mer_id,brand_id,spec_type,unit_name,mer_status,rate,reply_count,store_info,cate_id,Product.image,slider_image,Product.store_name,Product.keyword,Product.sort,U.rank,Product.is_show,Product.sales,Product.price,extension_type,refusal,cost,ot_price,stock,is_gift_bag,Product.care_count,Product.status,is_used,Product.create_time,Product.product_type,old_product_id,star,ficti,integral_total,integral_price_total,sys_labels,param_temp_id'; - protected $filed = 'Product.product_id,Product.mer_id,brand_id,unit_name,spec_type,mer_status,rate,reply_count,store_info,cate_id,Product.image,slider_image,Product.store_name,Product.keyword,Product.sort,Product.is_show,Product.sales,Product.price,extension_type,refusal,cost,ot_price,stock,is_gift_bag,Product.care_count,Product.status,is_used,Product.create_time,Product.product_type,old_product_id,integral_total,integral_price_total,mer_labels,Product.is_good,Product.is_del,type,param_temp_id'; + protected $admin_filed = 'Product.product_id,Product.mer_id,brand_id,spec_type,unit_name,mer_status,rate,reply_count,store_info,cate_id,Product.image,slider_image,Product.store_name,Product.keyword,Product.sort,U.rank,Product.is_show,Product.sales,Product.price,extension_type,refusal,cost,ot_price,stock,is_gift_bag,Product.care_count,Product.status,is_used,Product.create_time,Product.product_type,old_product_id,star,ficti,integral_total,integral_price_total,sys_labels,param_temp_id,mer_svip_status,svip_price,svip_price_type'; + protected $filed = 'Product.product_id,Product.mer_id,brand_id,unit_name,spec_type,mer_status,rate,reply_count,store_info,cate_id,Product.image,slider_image,Product.store_name,Product.keyword,Product.sort,Product.is_show,Product.sales,Product.price,extension_type,refusal,cost,ot_price,stock,is_gift_bag,Product.care_count,Product.status,is_used,Product.create_time,Product.product_type,old_product_id,integral_total,integral_price_total,mer_labels,Product.is_good,Product.is_del,type,param_temp_id,mer_svip_status,svip_price,svip_price_type'; const NOTIC_MSG = [ 1 => [ @@ -553,6 +553,7 @@ class ProductRepository extends BaseRepository $price = $stock = $ot_price = $cost = $svip_price = 0; try { foreach ($data['attrValue'] as $value) { + $_svip_price = 0; $sku = ''; if (isset($value['detail']) && !empty($value['detail']) && is_array($value['detail'])) { $sku = implode(',', $value['detail']); @@ -568,9 +569,11 @@ class ProductRepository extends BaseRepository $ot_price_ = $value['ot_price']; $sprice = ($value['price'] < 0) ? 0 : $value['price']; } - if (isset($value['svip_price']) && $data['svip_price_type']) { + if ($data['svip_price_type'] == 2) { + $_svip_price = $value['svip_price']; $svip_price = !$svip_price ? $value['svip_price'] : (($svip_price > $value['svip_price']) ? $value['svip_price'] : $svip_price); } + $cost = !$cost ? $value['cost'] : (($cost > $value['cost']) ?$cost: $value['cost']); $price = !$price ? $sprice : (($price > $sprice) ? $sprice : $price); $ot_price = !$ot_price ? $ot_price_ : (($ot_price > $ot_price_) ? $ot_price : $ot_price_); @@ -593,7 +596,7 @@ class ProductRepository extends BaseRepository "sku" => $sku, "unique" => $unique, 'sales' => $isUpdate ? ($oldSku[$sku]['sales'] ?? 0) : 0, - 'svip_price' => $svip_price, + 'svip_price' => $_svip_price, 'mer_id' => $merId, ]; $stock = $stock + intval($value['stock']); @@ -1351,6 +1354,8 @@ class ProductRepository extends BaseRepository 'check' => false ]; } + $attr[$key]['product_id'] = $item['product_id']; + $attr[$key]['attr_name'] = $item['attr_name']; $attr[$key]['attr_value'] = $arr; $attr[$key]['attr_values'] = $values; } @@ -1551,7 +1556,7 @@ class ProductRepository extends BaseRepository if ($status == 1 && $product['product_type'] == 3) throw new ValidateException('商品正在参与助力活动'); $this->dao->update($id,[$field => $status]); - app()->make(SpuRepository::class)->changeStatus($id,0); + app()->make(SpuRepository::class)->changeStatus($id,$product->product_type); } public function batchSwitchShow($id, $status, $field, $merId = 0) @@ -1562,6 +1567,7 @@ class ProductRepository extends BaseRepository if (!$products) throw new ValidateException('数据不存在'); foreach ($products as $product) { + $product_type = $product['product_type']; if ($merId && $product['mer_id'] !== $merId) throw new ValidateException('商品不属于您'); if ($status == 1 && $product['product_type'] == 2) @@ -1570,7 +1576,7 @@ class ProductRepository extends BaseRepository throw new ValidateException('ID:'.$product->product_id . ' 商品正在参与助力活动'); } $this->dao->updates($id,[$field => $status]); - Queue::push(ChangeSpuStatusJob::class,['id' => $id,'product_type'=>0]); + Queue::push(ChangeSpuStatusJob::class,['id' => $id,'product_type'=> $product_type]); } /** @@ -1585,7 +1591,6 @@ class ProductRepository extends BaseRepository $product = $this->getSearch([])->find($id); $this->dao->update($id, $data); $status = $data['status']; - $product_type = $product->product_type; $type = self::NOTIC_MSG[$data['status']][$product['product_type']]; $message = '您有1个' . ($product['product_type'] ? '秒杀商品' : '商品') . self::NOTIC_MSG[$data['status']]['msg']; SwooleTaskService::merchant('notice', [ @@ -1596,7 +1601,7 @@ class ProductRepository extends BaseRepository 'id' => $product['product_id'] ] ], $product['mer_id']); - app()->make(SpuRepository::class)->changeStatus($id,$product_type); + app()->make(SpuRepository::class)->changeStatus($id,$product->product_type); } /** @@ -1611,6 +1616,7 @@ class ProductRepository extends BaseRepository { $productData = $this->getSearch([])->where('product_id','in', $id)->select(); foreach ($productData as $product) { + $product_type = $product['product_type']; $type = self::NOTIC_MSG[$data['status']][$product['product_type']]; $message = '您有1个' . ($product['product_type'] ? '秒杀商品' : '商品') . self::NOTIC_MSG[$data['status']]['msg']; SwooleTaskService::merchant('notice', [ @@ -1623,7 +1629,7 @@ class ProductRepository extends BaseRepository ], $product['mer_id']); } $this->dao->updates($id, $data); - Queue(ChangeSpuStatusJob::class, ['id' => $id, 'product_type' => $product['product_type']]); + Queue(ChangeSpuStatusJob::class, ['id' => $id, 'product_type' => $product_type]); event('product.status',compact('id','data')); } @@ -1749,15 +1755,15 @@ class ProductRepository extends BaseRepository $form = Elm::createForm(Route::buildUrl('systemStoreProductAddFicti', ['id' => $id])->build()); $res = $this->dao->getWhere(['product_id' => $id], 'ficti,sales'); $form->setRule([ - Elm::input('number', '现有虚拟销量', $res['ficti'])->readonly(true), + Elm::input('number', '现有已售数量', $res['ficti'])->readonly(true), Elm::radio('type', '修改类型', 1) ->setOptions([ ['value' => 1, 'label' => '增加'], ['value' => 2, 'label' => '减少'], ]), - Elm::number('ficti', '修改虚拟销量数', 0), + Elm::number('ficti', '修改已售数量', 0), ]); - return $form->setTitle('修改虚拟销量数'); + return $form->setTitle('修改已售数量'); } /** @@ -2164,7 +2170,7 @@ class ProductRepository extends BaseRepository { $data = $this->dao->getWhere(['product_id' => $id, 'mer_id' => $merId]); if (!$data) throw new ValidateException('数据不存在'); - return app()->make(ProductAttrValueRepository::class)->getSearch(['product_id' => $id])->select(); + return app()->make(ProductAttrValueRepository::class)->getSearch(['product_id' => $id])->select()->append(['is_svip_price']); } public function checkParams($data,$merId,$id = null) diff --git a/app/common/repositories/store/product/ProductSkuRepository.php b/app/common/repositories/store/product/ProductSkuRepository.php index c6a059c3..80a49914 100644 --- a/app/common/repositories/store/product/ProductSkuRepository.php +++ b/app/common/repositories/store/product/ProductSkuRepository.php @@ -24,6 +24,7 @@ class ProductSkuRepository extends BaseRepository $this->dao = $dao; } + const ACTIVE_TYPE_DISCOUNTS = 10; public function save(int $id, int $productId, array $data, $activeProductId = 0) { $storeProductServices = app()->make(ProductAttrValueRepository::class); @@ -34,7 +35,7 @@ class ProductSkuRepository extends BaseRepository 'active_id' => $id, 'active_product_id' => $activeProductId, 'product_id' => $productId, - 'active_type' => 10, + 'active_type' => self::ACTIVE_TYPE_DISCOUNTS, 'price' => $skuData['price'], 'active_price' => $item['active_price'] ?? $skuData['price'], 'unique' => $item['unique'], diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index a0db5004..cbdc6c88 100644 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -178,12 +178,11 @@ class SpuRepository extends BaseRepository $count = $query->count(); $list = $query->page($page, $limit)->setOption('field', [])->field($this->productFiled)->select(); - $append = ['stop_time','show_svip_info','svip_price']; + $append = ['stop_time','svip_price','show_svip_info','is_svip_price']; if ($productMake->getUserIsPromoter($userInfo)) $append[] = 'max_extension'; $list->append($append); $list = $this->getBorderList($list); - return compact('count', 'list'); } @@ -427,7 +426,7 @@ class SpuRepository extends BaseRepository break; case 4: $_make = app()->make(ProductGroupRepository::class); - $wher[$_make->getPk()] = $id; + $where[$_make->getPk()] = $id; $res = $_make->getWhere([$_make->getPk() => $id]); $where = [ 'activity_id' => $id, @@ -436,15 +435,18 @@ class SpuRepository extends BaseRepository ]; break; default: + $where = [ + 'activity_id' => 0, + 'product_id' => $id, + 'product_type' => 0, + ]; break; } } catch (\Exception $e) { throw new ValidateException('数据不存在'); } - if ($merId) $where['mer_id'] = $merId; $result = $this->dao->getSearch($where)->find(); - if (!$result) throw new ValidateException('数据不存在'); return $result; } diff --git a/app/common/repositories/store/product/StoreDiscountRepository.php b/app/common/repositories/store/product/StoreDiscountRepository.php index 183c3ab0..27aef010 100644 --- a/app/common/repositories/store/product/StoreDiscountRepository.php +++ b/app/common/repositories/store/product/StoreDiscountRepository.php @@ -59,7 +59,7 @@ class StoreDiscountRepository extends BaseRepository $res = activeProductSku($discountsProduct, 'discounts'); $item['count'] = count($res['data']); $count = count(explode(',',$item['product_ids'])); - if ((!$item['type'] && $count == $item['count']) || ($item['type'] && $count > 1)) { + if ((!$item['type'] && $count == $item['count']) || ($item['type'] && $count > 0)) { $item['max_price'] = $res['price']; $item['discountsProduct'] = $res['data']; $list[] = $item; @@ -120,8 +120,6 @@ class StoreDiscountRepository extends BaseRepository $discountsData['is_show'] = $data['is_show']; $discountsData['mer_id'] = $data['mer_id']; $product_ids = []; - - $storeDiscountsProductsServices = app()->make(StoreDiscountProductRepository::class); $productRepository = app()->make(ProductRepository::class); foreach ($data['products'] as $product) { @@ -145,17 +143,17 @@ class StoreDiscountRepository extends BaseRepository } $discountsData['product_ids'] = implode(',', $product_ids); - - return Db::transaction(function () use($data, $discountsData, $storeDiscountsProductsServices){ + return Db::transaction(function () use($data, $discountsData){ if (isset($data['discount_id'])) { $discountsId = $data['discount_id']; $this->dao->update($discountsId, $discountsData); - $storeDiscountsProductsServices->clear($discountsId); + app()->make(StoreDiscountProductRepository::class)->clear($discountsId); + app()->make(ProductSkuRepository::class)->clear($discountsId, ProductSkuRepository::ACTIVE_TYPE_DISCOUNTS); } else { $res = $this->dao->create($discountsData); $discountsId = $res['discount_id']; } - $this->saveProduct($discountsId, $data['products'], $data['mer_id']); + return $this->saveProduct($discountsId, $data['products'], $data['mer_id']); }); } diff --git a/app/common/repositories/store/service/StoreServiceRepository.php b/app/common/repositories/store/service/StoreServiceRepository.php index b4702e76..519ec35f 100644 --- a/app/common/repositories/store/service/StoreServiceRepository.php +++ b/app/common/repositories/store/service/StoreServiceRepository.php @@ -83,7 +83,7 @@ class StoreServiceRepository extends BaseRepository $pwd->required(); $confirm_pwd->required(); } - $adminRule = []; + $adminRule = $filed = []; if($merId){ $adminRule = [ Elm::switches('customer', '订单管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), @@ -98,7 +98,14 @@ class StoreServiceRepository extends BaseRepository ] ]) ]; + } + $filed = [ + "value" => 1, + "rule" => [ + "customer","is_goods","is_verify","notify" + ] + ]; $adminRule[] = Elm::number('sort', '排序', 0)->precision(0)->max(99999); $prefix = $merId ? config('admin.merchant_prefix') : config('admin.admin_prefix'); return Elm::createForm(Route::buildUrl('merchantServiceCreate')->build(), array_merge([ @@ -107,7 +114,7 @@ class StoreServiceRepository extends BaseRepository Elm::input('nickname', '客服昵称')->required(), Elm::input('account', '客服账号')->required(), $pwd, $confirm_pwd, - Elm::switches('is_open', '账号状态', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), + Elm::switches('is_open', '账号状态', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12)->control([$filed]), Elm::switches('status', '客服状态', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), ], $adminRule))->setTitle('添加客服'); } @@ -146,12 +153,15 @@ class StoreServiceRepository extends BaseRepository * @author xaboy * @day 2020/5/29 */ - public function getChatService($merId, $uid) + public function getChatService($merId, $uid = 0) { - $logRepository = app()->make(StoreServiceLogRepository::class); - $lastServiceId = $logRepository->getLastServiceId($merId, $uid); $service = null; - if ($lastServiceId) + if ($uid) { + $logRepository = app()->make(StoreServiceLogRepository::class); + $lastServiceId = $logRepository->getLastServiceId($merId, $uid); + } + + if (isset($lastServiceId) && $lastServiceId) $service = $this->getValidServiceInfo($lastServiceId); if ($service) return $service; $service = $this->dao->getRandService($merId); @@ -162,7 +172,6 @@ class StoreServiceRepository extends BaseRepository { $order = $is_sys ? 'ASC' : 'DESC'; $where['uid'] = $uid; - $where['status'] = 1; $list = $this->search($where)->with(['merchant' => function ($query) { $query->field('mer_id,mer_avatar,mer_name'); }])->order('mer_id '.$order)->select()->hidden(['pwd'])->toArray(); diff --git a/app/common/repositories/store/service/StoreServiceUserRepository.php b/app/common/repositories/store/service/StoreServiceUserRepository.php index f52255b2..34f03320 100644 --- a/app/common/repositories/store/service/StoreServiceUserRepository.php +++ b/app/common/repositories/store/service/StoreServiceUserRepository.php @@ -100,9 +100,10 @@ class StoreServiceUserRepository extends BaseRepository public function merUserList($merId, $uid, $page, $limit) { $service = app()->make(StoreServiceRepository::class)->getService($uid, $merId); - if (!$service || !$service['status']) + if (!$service) throw new ValidateException('没有权限'); - + if (!$service['status']) + throw new ValidateException('客服已离线,清开启客服状态'); return $this->serviceUserList(['service_id' => $service->service_id], $merId, $page, $limit); } @@ -111,13 +112,19 @@ class StoreServiceUserRepository extends BaseRepository { $query = $this->dao->search($where)->group('uid')->order('last_time DESC'); $count = $query->count(); - $list = $query->page($page, $limit)->with(['user' => function ($query) { - $query->field('uid,avatar,nickname,user_type,sex,is_promoter,phone,now_money,phone,birthday,spread_uid')->with(['spread' => function ($query) { - $query->field('uid,avatar,nickname,cancel_time'); - }]); - }, 'mark' => function ($query) use ($merId) { - $query->where('mer_id', $merId)->bind(['mark' => 'extend_value']); - }, 'last'])->setOption('field', [])->field('*,max(last_log_id) as last_log_id,sum(service_unread) as num')->select()->toArray(); + $list = $query->page($page, $limit)->with([ + 'user' => function ($query) { + $query->field('uid,avatar,nickname,user_type,sex,is_promoter,phone,now_money,phone,birthday,spread_uid')->with([ + 'spread' => function ($query) { + $query->field('uid,avatar,nickname,cancel_time'); + } + ]); + }, + 'mark' => function ($query) use ($merId) { + $query->where('mer_id', $merId)->bind(['mark' => 'extend_value']); + }, + 'last' + ])->setOption('field', [])->field('*,max(last_log_id) as last_log_id,sum(service_unread) as num')->select()->toArray(); if (count($list) && is_null($list[0]['service_user_id'])) { $list = []; } diff --git a/app/common/repositories/system/CacheRepository.php b/app/common/repositories/system/CacheRepository.php index 2614f152..ead67414 100644 --- a/app/common/repositories/system/CacheRepository.php +++ b/app/common/repositories/system/CacheRepository.php @@ -212,7 +212,6 @@ HTML; { return []; $re = (Cache::get('AAAAAA')); - //halt($re); unset($re['省市编码']); if (!$re) throw new ValidateException('无数据'); $shen = []; diff --git a/app/common/repositories/system/config/ConfigRepository.php b/app/common/repositories/system/config/ConfigRepository.php index 2507d5cc..5f73362f 100644 --- a/app/common/repositories/system/config/ConfigRepository.php +++ b/app/common/repositories/system/config/ConfigRepository.php @@ -108,17 +108,18 @@ class ConfigRepository extends BaseRepository if ($config['required']) $component->required(); - $component->appendRule('suffix', [ - 'type' => 'div', - 'style' => ['color' => '#999999'], - 'domProps' => [ - 'innerHTML' => $config['info'], - ] - ]); - if ($config['config_props'] ?? '') { $props = @parse_ini_string($config['config_props'], false, INI_SCANNER_TYPED); if (is_array($props)) { + $guidance_uri = $props['guidance_uri'] ?? ''; + $guidance_image = $props['guidance_image'] ?? ''; + if ($guidance_image) { + $config['guidance'] = [ + 'uri' => $guidance_uri, + 'image' => $guidance_image, + ]; + } + unset($props['guidance_image'], $props['guidance_uri']); $component->props($props); if (isset($props['required']) && $props['required']) { $component->required(); @@ -128,6 +129,16 @@ class ConfigRepository extends BaseRepository } } } + if ($config['info']) { + $component->appendRule('suffix', [ + 'type' => 'guidancePop', + 'props' => [ + 'info' => $config['info'], + 'url' => $config['guidance']['uri'] ?? '', + 'image' => $config['guidance']['image'] ?? '', + ] + ]); + } return $component; } diff --git a/app/common/repositories/system/financial/FinancialRepository.php b/app/common/repositories/system/financial/FinancialRepository.php index 349efd12..04148751 100644 --- a/app/common/repositories/system/financial/FinancialRepository.php +++ b/app/common/repositories/system/financial/FinancialRepository.php @@ -128,7 +128,7 @@ class FinancialRepository extends BaseRepository 'type' => 'span', 'title' => '商户名称:', 'native' => false, - 'children' => [$merchant->mer_name] + 'children' => ["$merchant->mer_name"] ], [ 'type' => 'span', @@ -151,13 +151,13 @@ class FinancialRepository extends BaseRepository 'type' => 'span', 'title' => '商户余额:', 'native' => false, - 'children' => [$merchant->mer_money] + 'children' => ["$merchant->mer_money"] ], [ 'type' => 'span', 'native' => false, 'title' => '商户可提现金额:', - 'children' => [$_extract] + 'children' => ["$_extract"] ], Elm::radio('financial_type', '转账类型:', $merchant->financial_type) diff --git a/app/common/repositories/system/merchant/MerchantIntentionRepository.php b/app/common/repositories/system/merchant/MerchantIntentionRepository.php index 65701980..c2550529 100644 --- a/app/common/repositories/system/merchant/MerchantIntentionRepository.php +++ b/app/common/repositories/system/merchant/MerchantIntentionRepository.php @@ -104,7 +104,6 @@ class MerchantIntentionRepository extends BaseRepository $create = $data['create_mer'] == 1; unset($data['create_mer']); $intention = $this->search(['mer_intention_id' => $id])->find(); - $smsData = []; if (!$intention) throw new ValidateException('信息不存在'); if ($intention->status) @@ -124,29 +123,22 @@ class MerchantIntentionRepository extends BaseRepository 'category_id' => $intention['merchant_category_id'], 'type_id' => $intention['mer_type_id'], 'real_name' => $intention['name'], - 'uid'=>$intention['uid'], 'status' => 1, 'is_audit' => 1, 'is_bro_room' => $config['broadcast_room_type'] == 1 ? 0 : 1, 'is_bro_goods' => $config['broadcast_goods_type'] == 1 ? 0 : 1, 'mer_password' => $password, 'is_margin' => $margin['is_margin'] ?? -1, - 'margin' => $margin['margin'] ?? 0, - 'area_id' => $intention['area_id'] ?? 0, - 'geo_street' => $intention['street_id'] ?? 0, - 'village_id' => $intention['village_id'] ?? 0, - 'is_nmsc' => $intention['is_nmsc'] ?? 0, + 'margin' => $margin['margin'] ?? 0 + ]; + $data['fail_msg'] = ''; + $smsData = [ + 'date' => date('m月d日', strtotime($intention->create_time)), + 'mer' => $intention['mer_name'], + 'phone' => $intention['phone'], + 'pwd' => $password ?? '', + 'site_name' => systemConfig('site_name'), ]; - if ($data['status'] == 1) { - $data['fail_msg'] = ''; - $smsData = [ - 'date' => date('m月d日', strtotime($intention->create_time)), - 'mer' => $intention['mer_name'], - 'phone' => $intention['phone'], - 'pwd' => $password ?? '', - 'site_name' => systemConfig('site_name'), - ]; - } } if ($data['status'] == 2) { $smsData = [ diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index 7ee0d434..3ed6091b 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -343,7 +343,7 @@ class MerchantRepository extends BaseRepository { $merchant = $this->dao->apiGetOne($id)->hidden([ "real_name", "mer_phone", "reg_admin_id", "sort", "is_del", "is_audit", "is_best", "mer_state", "bank", "bank_number", "bank_name", 'update_time', - 'financial_alipay', 'financial_bank', 'financial_wechat', 'financial_type' + 'financial_alipay', 'financial_bank', 'financial_wechat', 'financial_type','mer_take_phone' ]); $merchant->append(['type_name', 'isset_certificate', 'services_type']); $merchant['care'] = false; diff --git a/app/common/repositories/system/serve/ServeMealRepository.php b/app/common/repositories/system/serve/ServeMealRepository.php index 1bd438de..89065960 100644 --- a/app/common/repositories/system/serve/ServeMealRepository.php +++ b/app/common/repositories/system/serve/ServeMealRepository.php @@ -87,13 +87,4 @@ class ServeMealRepository extends BaseRepository $this->dao->getSearch($param)->finid(); } - - public function setOrderSn() - { - list($msec, $sec) = explode(' ', microtime()); - $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); - $orderId = 'cs' . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); - return $orderId; - } - } diff --git a/app/common/repositories/system/serve/ServeOrderRepository.php b/app/common/repositories/system/serve/ServeOrderRepository.php index 172d760e..77dce61d 100644 --- a/app/common/repositories/system/serve/ServeOrderRepository.php +++ b/app/common/repositories/system/serve/ServeOrderRepository.php @@ -15,6 +15,7 @@ use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\AddShortUrlResponseBody\data; use app\common\dao\system\serve\ServeOrderDao; use app\common\model\system\serve\ServeOrder; use app\common\repositories\BaseRepository; +use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\store\product\ProductCopyRepository; use app\common\repositories\system\merchant\MerchantRepository; use app\common\repositories\user\UserRepository; @@ -136,7 +137,7 @@ class ServeOrderRepository extends BaseRepository $param = $res['param']; if(!$result = Cache::store('file')->get($key)){ - $order_sn = $this->setOrderSn(null); + $order_sn = app()->make(StoreOrderRepository::class)->getNewOrderId('cs'); $param['order_sn'] = $order_sn; $param['body'] = $order_sn; $payType = $data['pay_type'] == 1 ? 'weixinQr' : 'alipayQr'; @@ -216,13 +217,6 @@ class ServeOrderRepository extends BaseRepository return ; } - public function setOrderSn($profix) - { - list($msec, $sec) = explode(' ', microtime()); - $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); - $orderId = ($profix ?:'cs') . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); - return $orderId; - } public function getList(array $where, int $page, int $limit) { diff --git a/app/common/repositories/user/UserExtractRepository.php b/app/common/repositories/user/UserExtractRepository.php index d4308574..90f258df 100644 --- a/app/common/repositories/user/UserExtractRepository.php +++ b/app/common/repositories/user/UserExtractRepository.php @@ -187,24 +187,33 @@ class UserExtractRepository extends BaseRepository $brokerage_price = 0; if($data['status'] == -1) $brokerage_price = bcadd($user['brokerage_price'] ,$extract['extract_price'],2); - + $type = systemConfig('sys_extension_type'); $ret = []; - if ($data['status'] == 1 && $extract['extract_type'] == 3) { - $openid = app()->make(WechatUserRepository::class)->idByOpenId((int)$user['wechat_user_id']); - if (!$openid) { - $openid = app()->make(WechatUserRepository::class)->idByRoutineId((int)$user['wechat_user_id']); - } - if (!$openid) throw new ValidateException('非微信用户不支持付款到零钱'); + $service = null; + $func = null; + if ($data['status'] == 1 && $extract['extract_type'] == 3 && in_array($type,[1,2])) { + $func = $type == 1 ? 'merchantPay' : 'companyPay'; $ret = [ - 'openid' => $openid, 'sn' => $extract['extract_sn'], - 'price' => $extract['extract_price'] + 'price' => $extract['extract_price'], + 'mark' => '企业付款给用户:'.$user->nickname, + 'batch_name' => '企业付款给用户:'.$user->nickname ]; + $openid = app()->make(WechatUserRepository::class)->idByOpenId((int)$user['wechat_user_id']); + if ($openid) { + $ret['openid'] = $openid; + $service = WechatService::create(); + } else { + $routineOpenid = app()->make(WechatUserRepository::class)->idByRoutineId((int)$user['wechat_user_id']); + if (!$routineOpenid) throw new ValidateException('非微信用户不支持付款到零钱'); + $ret['openid'] = $routineOpenid; + $service = MiniProgramService::create(); + } } - Db::transaction(function()use($id,$data,$ret,$user,$brokerage_price){ + Db::transaction(function()use($id,$data,$user,$brokerage_price,$ret,$service,$func){ event('user.extractStatus.before',compact('id','data')); - if ($ret) WechatService::create()->merchantPay($ret); + if ($ret) $service->{$func}($ret); if($brokerage_price){ $user->brokerage_price = $brokerage_price; $user->save(); @@ -223,4 +232,9 @@ class UserExtractRepository extends BaseRepository $sn = 'ue' . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); return $sn; } + + public function getHistoryBank($uid) + { + return $this->dao->getSearch(['uid' => $uid,'extract_type' => 0])->order('create_time DESC')->field('real_name,bank_code,bank_address,bank_name')->find(); + } } diff --git a/app/common/repositories/user/UserOrderRepository.php b/app/common/repositories/user/UserOrderRepository.php index 5641758e..6c2a7d37 100644 --- a/app/common/repositories/user/UserOrderRepository.php +++ b/app/common/repositories/user/UserOrderRepository.php @@ -17,6 +17,7 @@ namespace app\common\repositories\user; use app\common\dao\user\LabelRuleDao; use app\common\dao\user\UserOrderDao; use app\common\repositories\BaseRepository; +use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\system\groupData\GroupDataRepository; use crmeb\jobs\SendSmsJob; use crmeb\services\PayService; @@ -59,20 +60,6 @@ class UserOrderRepository extends BaseRepository return compact('count', 'list'); } - /** - * TODO 获取订单号 - * @return string - * @author Qinii - * @day 2022/11/12 - */ - public function setOrderSn() - { - list($msec, $sec) = explode(' ', microtime()); - $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); - $orderId = 'wxs' . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); - return $orderId; - } - /** * @param $data * @return mixed @@ -81,7 +68,7 @@ class UserOrderRepository extends BaseRepository */ public function add($res, $user, $params) { - $order_sn = $this->setOrderSn(); + $order_sn = app()->make(StoreOrderRepository::class)->getNewOrderId(StoreOrderRepository::TYPE_SN_USER_ORDER); $data = [ 'title' => $res['value']['svip_name'], 'link_id' => $res->group_data_id, @@ -108,7 +95,7 @@ class UserOrderRepository extends BaseRepository $info = $this->dao->create($data); if ($data['pay_price']){ try { - $service = new PayService($type,$body); + $service = new PayService($type,$body, 'user_order'); $config = $service->pay($user); return app('json')->status($type, $config + ['order_id' => $info->order_id]); } catch (\Exception $e) { @@ -178,7 +165,7 @@ class UserOrderRepository extends BaseRepository $ret->end_time = $svip_endtime; $ret->save(); $date = $info->svip_type == 3 ? '终身会员' : $svip_endtime; - Queue::push(SendSmsJob::class,['tempId' => 'SVIP_PAY_SUCCESS','id' => ['phone' => $user->phone, 'date' => $date]]); + if ($user->phone) Queue::push(SendSmsJob::class,['tempId' => 'SVIP_PAY_SUCCESS','id' => ['phone' => $user->phone, 'date' => $date]]); return ; } } diff --git a/app/common/repositories/user/UserRelationRepository.php b/app/common/repositories/user/UserRelationRepository.php index 8136d837..0ba5c8b3 100644 --- a/app/common/repositories/user/UserRelationRepository.php +++ b/app/common/repositories/user/UserRelationRepository.php @@ -101,24 +101,28 @@ class UserRelationRepository extends BaseRepository public function search(array $where, int $page, int $limit) { $with = []; - if($where['type'] == 1) $with = ['spu']; + if($where['type'] == 1) $with = [ + 'spu' + ]; if($where['type'] == 10) $with = [ 'merchant' => function($query){ - $query->field('mer_id,type_id,mer_name,mer_avatar,sales,mer_info,care_count'); + $query->where('status',1)->where('mer_state',1)->where('is_del',0)->field('mer_id,type_id,mer_name,mer_avatar,sales,mer_info,care_count,status,is_del,mer_state'); } ]; $query = $this->dao->search($where); $query->with($with)->order('create_time DESC'); $count = $query->count(); $list = $query->page($page, $limit)->select(); - $make = app()->make(ProductRepository::class); - foreach ($list as $item) { - if(isset($item['spu']['product_type']) && $item['spu']['product_type'] == 1){ - $item['spu']['stop_time'] = $item->stop_time; - unset($item['spu']['seckillActive']); - } - if (isset($item['merchant']) && $item['merchant'] ) { - $item['merchant']['showProduct'] = $item['merchant']['AllRecommend']; + foreach ($list as &$item) { + if ($item['type'] == 1) { + if(isset($item['spu']['product_type']) && $item['spu']['product_type'] == 1){ + $item['spu']['stop_time'] = $item->stop_time; + unset($item['spu']['seckillActive']); + } + } else { + if (isset($item['merchant']) && $item['merchant']) { + $item['merchant']['showProduct'] = $item['merchant']['AllRecommend']; + } } } return compact('count', 'list'); @@ -166,31 +170,27 @@ class UserRelationRepository extends BaseRepository } /** - * @param array $data + * TODO 批量删除 + * @param array $ids + * @param $uid + * @param $type * @author Qinii + * @day 2023/2/16 */ - public function destory(array $data,$lst = 0) + public function batchDestory(array $ids,$uid, $type = 1) { - if($lst){ - $id = $data['type_id']; - $make = app()->make(ProductRepository::class); - }else{ - if(in_array($data['type'],[0,1,2,3,4])) { - $spu = $this->getSpu($data); - $data['type_id'] = $spu->spu_id; - $id = $spu['product_id']; - $data['type'] = 1; - $make = app()->make(ProductRepository::class); - } - if($data['type'] == 10){ - $id = $data['type_id']; - $make = app()->make(MerchantRepository::class); + if ($type == 10) { + app()->make(MerchantRepository::class)->decCareCount($ids); + $type_id = $ids; + } else { + foreach ($ids as $id) { + $spu = $this->getSpu(['type_id' => $id, 'type' => $type]); + $type_id[] = $spu->spu_id; } + $type = 1; + app()->make(ProductRepository::class)->decCareCount($ids); } - return Db::transaction(function()use($data,$make,$id){ - $make->decCareCount($id); - $this->dao->destory($data); - }); + return $this->dao->search(['uid' => $uid,'type' => $type])->where('type_id','in',$type_id)->delete(); } /** diff --git a/app/common/repositories/user/UserRepository.php b/app/common/repositories/user/UserRepository.php index ed0876f3..f3e70165 100644 --- a/app/common/repositories/user/UserRepository.php +++ b/app/common/repositories/user/UserRepository.php @@ -495,6 +495,9 @@ class UserRepository extends BaseRepository $request = request(); if ($user) { +// if ($wechatUser['nickname'] == '微信用户') { +// unset($wechatUser['nickname'],$wechatUser['headimgurl']); +// } $user->save(array_filter([ 'nickname' => $wechatUser['nickname'] ?? '', 'avatar' => $wechatUser['headimgurl'] ?? '', @@ -1388,6 +1391,10 @@ class UserRepository extends BaseRepository app()->make(StoreServiceRepository::class)->getSearch([])->where('uid', $uid)->update(['uid' => 0, 'status' => 0, 'is_open' => 0]); $this->getSearch([])->where('spread_uid', $uid)->update(['spread_uid' => 0]); $this->delBrokerageTop($uid); + //TODO 推广人月榜 + Cache::zrem('s_top_' . date('Y-m'), $uid); + //TODO 推广人周榜 + Cache::zrem('s_top_' . monday(), $uid); app()->make(CommunityRepository::class)->destoryByUid($uid); }); } @@ -1397,16 +1404,27 @@ class UserRepository extends BaseRepository $formData = $this->dao->get($id); if (!$formData) throw new ValidateException('数据不存在'); $form = Elm::createForm(Route::buildUrl('systemUserSvipUpdate', ['id' => $id])->build()); - $form->setRule([ + $rule = [ Elm::switches('is_svip', '付费会员', $formData->is_svip > 0 ? 1 : 0)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开'), - Elm::radio('type', '修改类型', 1)->options([ + ]; + if ($formData->is_svip == 3) { + $rule[] = Elm::input('is_svip_type', '会员类型','永久会员')->disabled(true)->appendRule('suffix', [ + 'type' => 'div', + 'style' => ['color' => '#999999'], + 'domProps' => [ + 'innerHTML' =>'永久会员,若关闭后再次开启将不再是永久会员,请谨慎操作', + ] + ]); + } else { + $rule[] = Elm::radio('type', '修改类型', 1)->options([ ['label' => '增加', 'value' => 1], ['label' => '减少', 'value' => 0], - ])->requiredNum(), - Elm::number('add_time', '付费会员期限(天)')->required()->min(1), - Elm::input('end_time', '当前有效期期限', $formData->is_svip > 0 ? $formData->svip_endtime : 0)->disabled(true), - ]); - return $form->setTitle( '编辑付费会员期限' ); + ])->requiredNum(); + $rule[] = Elm::number('add_time', '会员期限(天)')->required()->min(1); + $rule[] = Elm::input('end_time', '当前有效期期限', $formData->is_svip > 0 ? $formData->svip_endtime : 0)->disabled(true); + } + $form->setRule($rule); + return $form->setTitle( '编辑付费会员期限'); } /** @@ -1441,7 +1459,7 @@ class UserRepository extends BaseRepository $res = [ 'title' => $data['is_svip'] == 0 ? '平台取消会员资格' : ($data['type'] ? '平台赠送' : '平台扣除'), 'link_id' => 0, - 'order_sn' => $make->setOrderSn(), + 'order_sn' => app()->make(StoreOrderRepository::class)->getNewOrderId(StoreOrderRepository::TYPE_SN_USER_ORDER), 'pay_price' => 0, 'order_info' => json_encode($data,JSON_UNESCAPED_UNICODE), 'uid' => $id, @@ -1461,4 +1479,20 @@ class UserRepository extends BaseRepository $user->save(); }); } + + public function updateBaseInfo($data, $user) + { + Db::transaction(function() use($data, $user){ + $user->save(array_filter([ + 'nickname' => $data['nickname'] ?? '', + 'avatar' => $data['avatar'] ?? '', + ])); + if (isset($user->wechat) ) { + $user->wechat->save(array_filter([ + 'nickname' => $data['nickname'] ?? '', + 'headimgurl' => $data['avatar'] ?? '', + ])); + } + }); + } } diff --git a/app/common/repositories/wechat/WechatUserRepository.php b/app/common/repositories/wechat/WechatUserRepository.php index 50bd0c33..50b1c1d3 100644 --- a/app/common/repositories/wechat/WechatUserRepository.php +++ b/app/common/repositories/wechat/WechatUserRepository.php @@ -125,8 +125,8 @@ class WechatUserRepository extends BaseRepository $wechatUser = $this->dao->routineIdByWechatUser($routineOpenid); return Db::transaction(function () use ($createUser, $routineInfo, $wechatUser) { if ($wechatUser) { - // $routineInfo['nickname'] = $wechatUser['nickname']; - // $routineInfo['headimgurl'] = $wechatUser['headimgurl']; + $routineInfo['nickname'] = $wechatUser['nickname']; + $routineInfo['headimgurl'] = $wechatUser['headimgurl']; $wechatUser->save($routineInfo); } else { $wechatUser = $this->dao->create($routineInfo); diff --git a/app/controller/admin/order/Order.php b/app/controller/admin/order/Order.php index 3bc60109..e5050711 100644 --- a/app/controller/admin/order/Order.php +++ b/app/controller/admin/order/Order.php @@ -146,7 +146,9 @@ class Order extends BaseController public function status($id) { [$page, $limit] = $this->getPage(); - return app('json')->success($this->repository->getOrderStatus($id, $page, $limit)); + $where = $this->request->params(['date','user_type']); + $where['id'] = $id; + return app('json')->success($this->repository->getOrderStatus($where, $page, $limit)); } /** @@ -187,4 +189,16 @@ class Order extends BaseController return app('json')->success($data); } + /** + * TODO + * @param $id + * @return \think\response\Json + * @author Qinii + * @day 2023/2/22 + */ + public function childrenList($id) + { + $data = $this->repository->childrenList($id, 0); + return app('json')->success($data); + } } diff --git a/app/controller/admin/store/StoreBrandCategory.php b/app/controller/admin/store/StoreBrandCategory.php index 644620d9..0897e2e3 100644 --- a/app/controller/admin/store/StoreBrandCategory.php +++ b/app/controller/admin/store/StoreBrandCategory.php @@ -59,7 +59,6 @@ class StoreBrandCategory extends BaseController public function create(validate $validate) { $data = $this->checkParams($validate); - if ($data['pid'] && !$this->repository->merExists($this->request->merId(), $data['pid'])) return app('json')->fail('上级分类不存在'); if ($data['pid'] && !$this->repository->checkLevel($data['pid'])) diff --git a/app/controller/admin/store/StoreProduct.php b/app/controller/admin/store/StoreProduct.php index b5ae18e3..c98142ff 100644 --- a/app/controller/admin/store/StoreProduct.php +++ b/app/controller/admin/store/StoreProduct.php @@ -49,7 +49,7 @@ class StoreProduct extends BaseController public function lst() { [$page, $limit] = $this->getPage(); - $where = $this->request->params(['cate_id', 'keyword', ['type', 1], 'mer_cate_id', 'pid','store_name','is_trader','us_status','product_id','star','sys_labels','hot_type']); + $where = $this->request->params(['cate_id', 'keyword', ['type', 1], 'mer_cate_id', 'pid','store_name','is_trader','us_status','product_id','star','sys_labels','hot_type','svip_price_type']); $mer_id = $this->request->param('mer_id',''); $merId = $mer_id ? $mer_id : null; $where['is_gift_bag'] = 0; @@ -207,10 +207,10 @@ class StoreProduct extends BaseController { $data = $this->request->params(['type','ficti']); if(!in_array($data['type'],[1,2])) return app('json')->fail('类型错误'); - if(!$data['ficti'] || $data['ficti'] < 0) return app('json')->fail('虚拟销量必须大于0'); + if(!$data['ficti'] || $data['ficti'] < 0) return app('json')->fail('已售数量必须大于0'); $res = $this->repository->getWhere(['product_id' => $id],'ficti,sales'); if(!$res) return app('json')->fail('数据不存在'); - if($data['type'] == 2 && $res['ficti'] < $data['ficti']) return app('json')->fail('虚拟销量不足'); + if($data['type'] == 2 && $res['ficti'] < $data['ficti']) return app('json')->fail('已售数量不足'); $ficti = ($data['type'] == 1) ? $data['ficti'] : '-' . $data['ficti']; $data = [ 'ficti' => $res['ficti'] + $ficti, diff --git a/app/controller/admin/system/config/Config.php b/app/controller/admin/system/config/Config.php index 19b9b302..7a8f963b 100644 --- a/app/controller/admin/system/config/Config.php +++ b/app/controller/admin/system/config/Config.php @@ -248,18 +248,6 @@ class Config extends BaseController return app('json')->success(['src' => $res]); } - /** - * TODO - * @author Qinii - * @day 2023/1/5 - */ - public function specificFileUpload() - { - $file = $this->request->file('file'); - $type = $this->request->param('fiel_type'); - halt($type,$file); - } - public function uploadWechatSet() { $name = $this->request->param('wechat_chekc_file'); @@ -343,7 +331,7 @@ class Config extends BaseController { $data['routine_name'] = systemConfig('routine_name'); $data['routine_appId'] = systemConfig('routine_appId'); - $data['url'] = 'https://wiki.crmeb.net/web/mer/mer/1771'; + $data['url'] = 'https://doc.crmeb.com/mer/mer2/4491'; $data['site_url'] = rtrim(systemConfig('site_url'), '/') . '/pages/index/index'; return app('json')->success($data); } diff --git a/app/controller/admin/system/diy/Diy.php b/app/controller/admin/system/diy/Diy.php index 2e40aa6c..8bd3b30b 100644 --- a/app/controller/admin/system/diy/Diy.php +++ b/app/controller/admin/system/diy/Diy.php @@ -78,17 +78,13 @@ class Diy extends BaseController $infoDiy = $id ? $this->repository->getWhere(['id' => $id, 'mer_id' => $data['mer_id']]) : []; if ($infoDiy && $infoDiy['is_default']) return app('json')->fail('默认模板不能修改'); - if ($infoDiy && $infoDiy['is_diy']) { - foreach ($value as $key => &$item) { + if ($infoDiy) { + foreach ($value as $k => $item) { if ($item['name'] === 'goodList') { if (isset($item['selectConfig']['list'])) { unset($item['selectConfig']['list']); } if (isset($item['goodsList']['list']) && is_array($item['goodsList']['list'])) { - $limitMax = config('database.page.limitMax', 50); - if (isset($item['numConfig']['val']) && isset($item['tabConfig']['tabVal']) && $item['tabConfig']['tabVal'] == 0 && $item['numConfig']['val'] > $limitMax) { - return app('json')->fail('您设置得商品个数超出系统限制,最大限制' . $limitMax . '个商品'); - } $item['goodsList']['ids'] = array_column($item['goodsList']['list'], 'product_id'); unset($item['goodsList']['list']); } @@ -99,6 +95,7 @@ class Diy extends BaseController } elseif ($item['name'] === 'promotionList') { unset($item['productList']['list']); } + $value[$k] = $item; } $data['value'] = json_encode($value); } else { @@ -127,7 +124,7 @@ class Diy extends BaseController } elseif (isset($value['selectList']['list']) && is_array($value['selectList']['list'])) { unset($value['goodsList']['list']); } - $data['value'] = json_encode($value,JSON_UNESCAPED_UNICODE); + $data['value'] = json_encode($value, JSON_UNESCAPED_UNICODE); } $data['version'] = '1.0'; return app('json')->success($id ? '修改成功' : '保存成功', diff --git a/app/controller/admin/system/merchant/Merchant.php b/app/controller/admin/system/merchant/Merchant.php index 8fe0a68a..e935fa0a 100644 --- a/app/controller/admin/system/merchant/Merchant.php +++ b/app/controller/admin/system/merchant/Merchant.php @@ -118,6 +118,7 @@ class Merchant extends BaseController { if (!$this->repository->exists($id)) return app('json')->fail('数据不存在'); + return app('json')->success(formToData($this->repository->updateForm($id))); } diff --git a/app/controller/admin/system/service/StoreService.php b/app/controller/admin/system/service/StoreService.php index b975d836..f487eee2 100644 --- a/app/controller/admin/system/service/StoreService.php +++ b/app/controller/admin/system/service/StoreService.php @@ -167,7 +167,7 @@ class StoreService extends BaseController $status = $this->request->param('status'); if (!$this->repository->merExists($this->request->merId(), $id)) return app('json')->fail('数据不存在'); - $this->repository->update($id, ['status' => $status == 1 ? 1 : 0]); + $this->repository->update($id, ['is_open' => $status == 1 ? 1 : 0]); return app('json')->success('修改成功'); } diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index e95a1126..66c7946f 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -18,6 +18,7 @@ use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\store\order\StoreRefundOrderRepository; use app\common\repositories\system\notice\SystemNoticeConfigRepository; use app\common\repositories\user\UserRepository; +use app\common\repositories\user\UserSignRepository; use app\common\repositories\wechat\CustomTemplate; use app\common\repositories\wechat\RoutineQrcodeRepository; use app\common\repositories\wechat\WechatUserRepository; @@ -43,6 +44,7 @@ use think\facade\Log; use think\facade\Queue; use crmeb\jobs\SendSmsJob; use think\facade\Db; + /** * Class Auth * @package app\controller\api @@ -53,6 +55,9 @@ class Auth extends BaseController { public function test() { + $data = ['tempId' => 'ORDER_CREATE', 'id' => 658]; + $a = app()->make(WechatTemplateMessageService::class)->sendTemplate($data); + halt($a); $data = [ 'first' => '您有新的生成订单请注意查看', 'keyword1' => '手动阀手动阀', @@ -60,9 +65,9 @@ class Auth extends BaseController 'keyword3' => '环境开会艰苦环境', 'remark' => '查看详情' ]; - $openid='ob5SYwbHHYQUS5mpzKEz4lo7zowA'; - $templateId='8g6xSS-WPaP4Jm1Fwno4uqRxpo4TLYyiVwudL4svUPc'; - $a= (new CustomTemplate)->post($data,$openid,$templateId); + $openid = 'ob5SYwbHHYQUS5mpzKEz4lo7zowA'; + $templateId = '8g6xSS-WPaP4Jm1Fwno4uqRxpo4TLYyiVwudL4svUPc'; + $a = (new CustomTemplate)->post($data, $openid, $templateId); halt($a); // Queue::push(SendSmsJob::class,$data); // $status = app()->make(SystemNoticeConfigRepository::class)->getNoticeStatusByConstKey($data['tempId']); @@ -156,36 +161,31 @@ class Auth extends BaseController $data['total_consume'] = $user['pay_price']; $data['extension_status'] = systemConfig('extension_status'); if (systemConfig('member_status')) $data['member_icon'] = $this->request->userInfo()->member->brokerage_icon ?? ''; - if ($data['is_svip'] == 3) $data['svip_endtime'] = date('Y-m-d H:i:s',strtotime("+100 year")); - - $find = Db::name('user')->find($user['uid']); + if ($data['is_svip'] == 3) $data['svip_endtime'] = date('Y-m-d H:i:s', strtotime("+100 year")); $data['no_update'] = 1; + $msg = Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id', $user['uid'])->find(); - if ($find){ - $msg = Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id', $user['uid'])->find(); - if ($msg){ - $data['no_update']=0; - } - $data['group_id']=$find['group_id']; + if ($msg) { + $data['no_update'] = 0; } + $data['group_id'] = $user['group_id']; // 新增返回商户后台登录地址 - $data['merchant_login'] = $this->request->domain().'/merchant'; + $data['merchant_login'] = $this->request->domain() . '/merchant'; $data['is_wsxx'] = 0; - $data['mer_info']=[]; + $data['mer_info'] = []; // 判断是否是商户,并且有没有完善信息 //这里有点小问题以后要修改 - $store_service=Db::name('store_service')->where('uid',$data['uid'])->find(); - if ($store_service){ - $mer_arr = Db::name('merchant')->where('mer_id',$store_service['mer_id'])->where('is_del',0)->where('status',1)->field('type_id,mer_avatar,mer_banner,mer_info,service_phone,mer_address,uid,mer_name')->find(); - if($mer_arr && $mer_arr['mer_avatar']!=''&& $mer_arr['mer_banner'] !='' && $mer_arr['mer_info'] && $mer_arr['service_phone']!=''&& $mer_arr['mer_address']!=''){ + $store_service = Db::name('store_service')->where('uid', $data['uid'])->find(); + if ($store_service) { + $mer_arr = Db::name('merchant')->where('mer_id', $store_service['mer_id'])->where('is_del', 0)->where('status', 1)->field('type_id,mer_avatar,mer_banner,mer_info,service_phone,mer_address,uid,mer_name')->find(); + if ($mer_arr && $mer_arr['mer_avatar'] != '' && $mer_arr['mer_banner'] != '' && $mer_arr['mer_info'] && $mer_arr['service_phone'] != '' && $mer_arr['mer_address'] != '') { $data['is_wsxx'] = 1; } - $data['mer_info']=$mer_arr; + $data['mer_info'] = $mer_arr; } - return app('json')->success($data); } @@ -375,8 +375,8 @@ class Auth extends BaseController { $data = $this->request->params(['phone', 'sms_code', 'spread', 'auth_token',['user_type','h5']]); $validate->sceneSmslogin()->check($data); - $sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login'); - if (!$sms_code) return app('json')->fail('验证码不正确'); + $sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login'); + if (!$sms_code) return app('json')->fail('验证码不正确'); $user = $repository->accountByUser($data['phone']); $auth = $this->parseAuthToken($data['auth_token']); Db::startTrans(); @@ -408,7 +408,7 @@ class Auth extends BaseController Db::rollback(); return app('json')->error($e->getMessage()); } - if ($auth && !$user['wechat_user_id']){ + if ($auth && !$user['wechat_user_id']) { $repository->syncBaseAuth($auth, $user); } $user = $repository->mainUser($user); @@ -416,18 +416,18 @@ class Auth extends BaseController $tokenInfo = $repository->createToken($user); $repository->loginAfter($user); - $user['no_update']=1; + $user['no_update'] = 1; $user['group_ids'] = $user['group_id']; - $msg=Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id',$user['uid'])->find(); - if ($msg){ - $user['no_update']=0; - $ddd['phone'] = $data['phone']; - Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id',$user['uid'])->update($ddd); - } + $msg = Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id', $user['uid'])->find(); + if ($msg) { + $user['no_update'] = 0; + $ddd['phone'] = $data['phone']; + Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id', $user['uid'])->update($ddd); + } - if ($user['phone']==''){ - Db::name('user')->where('uid',$user['uid'])->update(['phone'=>$user['account']]); - $user['phone']=$user['account']; + if ($user['phone'] == '') { + Db::name('user')->where('uid', $user['uid'])->update(['phone' => $user['account']]); + $user['phone'] = $user['account']; } return app('json')->success($repository->returnToken($user, $tokenInfo)); } @@ -610,15 +610,15 @@ class Auth extends BaseController if ($auth['auth']['spread'] ?? 0) { $userRepository->bindSpread($user, (int)($auth['auth']['spread'])); } - $uid = Db::name('user')->where('wechat_user_id',$authInfo['wechat_user_id'])->value('uid'); - $find=Db::name('nk_user')->where('user_id',$uid)->find(); - $user['no_update']=1; + $uid = Db::name('user')->where('wechat_user_id', $authInfo['wechat_user_id'])->value('uid'); + $find = Db::name('nk_user')->where('user_id', $uid)->find(); + $user['no_update'] = 1; $user['group_ids'] = 1; - if ($find && $find['n_user_id']!=0){ + if ($find && $find['n_user_id'] != 0) { $user['group_ids'] = $find['group_id']; - $msg=Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id',$find['n_user_id'])->cache(true)->find(); - if ($msg){ - $user['no_update']=0; + $msg = Db::connect('nongke')->table('fa_szxc_information_usermsg')->where('user_id', $find['n_user_id'])->cache(true)->find(); + if ($msg) { + $user['no_update'] = 0; } } diff --git a/app/controller/api/Common.php b/app/controller/api/Common.php index 8d18b124..130879f5 100644 --- a/app/controller/api/Common.php +++ b/app/controller/api/Common.php @@ -99,7 +99,7 @@ class Common extends BaseController public function config() { - $config = systemConfig(['open_update_info', 'store_street_theme', 'is_open_service', 'is_phone_login', 'global_theme', 'integral_status', 'mer_location', 'alipay_open', 'hide_mer_status', 'mer_intention_open', 'share_info', 'share_title', 'share_pic', 'store_user_min_recharge', 'recharge_switch', 'balance_func_status', 'yue_pay_status', 'site_logo', 'routine_logo', 'site_name', 'login_logo', 'procudt_increase_status', 'sys_extension_type', 'member_status', 'copy_command_status', 'community_status','community_reply_status','community_app_switch', 'withdraw_type', 'recommend_switch', 'member_interests_status', 'beian_sn', 'community_reply_auth','hot_ranking_switch','svip_switch_status']); + $config = systemConfig(['open_update_info', 'store_street_theme', 'is_open_service', 'is_phone_login', 'global_theme', 'integral_status', 'mer_location', 'alipay_open', 'hide_mer_status', 'mer_intention_open', 'share_info', 'share_title', 'share_pic', 'store_user_min_recharge', 'recharge_switch', 'balance_func_status', 'yue_pay_status', 'site_logo', 'routine_logo', 'site_name', 'login_logo', 'procudt_increase_status', 'sys_extension_type', 'member_status', 'copy_command_status', 'community_status','community_reply_status','community_app_switch', 'withdraw_type', 'recommend_switch', 'member_interests_status', 'beian_sn', 'community_reply_auth','hot_ranking_switch','svip_switch_status','margin_ico','margin_ico_switch']); $make = app()->make(TemplateMessageRepository::class); $cache = app()->make(CacheRepository::class)->search(['copyright_status', 'copyright_context', 'copyright_image', 'sys_intention_agree']); @@ -180,6 +180,9 @@ class Common extends BaseController public function wechatNotify() { try { + if($this->request->header('content-type') === 'application/json'){ + return response(WechatService::create()->handleNotifyV3()->getContent()); + } return response(WechatService::create()->handleNotify()->getContent()); } catch (Exception $e) { Log::info('支付回调失败:' . var_export([$e->getMessage(), $e->getFile() . ':' . $e->getLine()], true)); @@ -194,7 +197,7 @@ class Common extends BaseController if (!in_array($type, ['order', 'presell'], true)) throw new ValidateException('参数错误'); try { - WechatService::create()->handleCombinePayNotify($type); + return WechatService::create()->handleCombinePayNotify($type); } catch (Exception $e) { Log::info('电商收付通支付回调失败:' . var_export([$e->getMessage(), $e->getFile() . ':' . $e->getLine()], true)); } @@ -208,7 +211,7 @@ class Common extends BaseController if (!in_array($type, ['order', 'presell'], true)) throw new ValidateException('参数错误'); try { - WechatService::create()->handleCombinePayNotify($type); + return WechatService::create()->handleCombinePayNotify($type); } catch (Exception $e) { Log::info('小程序电商收付通支付回调失败:' . var_export([$e->getMessage(), $e->getFile() . ':' . $e->getLine()], true)); } @@ -217,15 +220,18 @@ class Common extends BaseController public function routineNotify() { try { + if($this->request->header('content-type') === 'application/json'){ + return response(MiniProgramService::create()->handleNotifyV3()->getContent()); + } return response(MiniProgramService::create()->handleNotify()->getContent()); } catch (Exception $e) { - Log::info('支付回调失败:' . var_export([$e->getMessage(), $e->getFile() . ':' . $e->getLine()], true)); + Log::info('支付回调失败:' . var_export([$e->getMessage(), $e->getFile() . ':' . $e->getLine(),$this->request->header()], true)); } } public function alipayNotify($type) { - if (!in_array($type, ['order', 'user_recharge', 'presell'], true)) + if (!in_array($type, ['order', 'user_recharge', 'presell', 'user_order'], true)) throw new ValidateException('参数错误'); $post = $_POST; $get = $_GET; @@ -256,6 +262,7 @@ class Common extends BaseController ['image', ''], ['code', ''], ], true); + checkSuffix([$imageUrl, $codeUrl]); try { $codeTmp = $code = $codeUrl ? image_to_base64($codeUrl) : ''; if (!$codeTmp) { diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index 392d00e5..45d185ef 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -20,6 +20,7 @@ use app\common\repositories\user\UserRelationRepository; use app\common\repositories\user\UserRepository; use app\validate\api\CommunityValidate; use crmeb\basic\BaseController; +use crmeb\services\MiniProgramService; use think\App; use app\common\repositories\community\CommunityRepository as repository; use think\exception\ValidateException; @@ -66,10 +67,11 @@ class Community extends BaseController $where['is_type'] = $this->repository::COMMUNIT_TYPE_VIDEO; unset($where['category_id']); } - $where = array_merge($where, $this->repository::IS_SHOW_WHERE); + $where = array_merge($where,$this->repository::IS_SHOW_WHERE); [$page, $limit] = $this->getPage(); return app('json')->success($this->repository->getApiList($where, $page, $limit, $this->user)); } + /** * TODO 视频列表 * @return \think\response\Json @@ -100,6 +102,8 @@ class Community extends BaseController ]; $where['uids'] = $relevanceRepository->getSearch($where_)->column('right_id'); [$page, $limit] = $this->getPage(); + $type = $this->request->param('type'); + if ($type) $where['is_type'] = $this->repository::COMMUNIT_TYPE_VIDEO; return app('json')->success($this->repository->getApiList($where, $page, $limit, $this->user)); } @@ -143,9 +147,9 @@ class Community extends BaseController } $where['uid'] = $id; } - - $where['community_id'] = $this->request->param('community_id',''); $where['is_del'] = 0; + $where['community_id'] = $this->request->param('community_id',''); + $data = $this->repository->getApiVideoList($where, $page, $limit, $this->user,$is_start); return app('json')->success($data); } @@ -298,6 +302,7 @@ class Community extends BaseController } $data['content'] = filter_emoji($data['content']); + MiniProgramService::create()->msgSecCheck($this->request->userInfo(), $data['content'],3,0); app()->make(CommunityValidate::class)->check($data); $arr = explode("\n", $data['content']); $title = rtrim(ltrim($arr[0])); @@ -417,7 +422,7 @@ class Community extends BaseController public function getSpuByOrder($id) { - $data = $this->repository->getSpuByOrder($id, $this->request->userInfo()->uid); + $data = $this->repository->getSpuByOrder($id,7233); return app('json')->success($data); } @@ -425,7 +430,9 @@ class Community extends BaseController { $id = (int)$id; $type = $this->request->param('type'); - $url = $this->repository->qrcode($id, $type, $this->request->userInfo()); + if ($this->request->isLogin()) { + $url = $this->repository->qrcode($id, $type, $this->request->userInfo()); + } if (!$url) return app('json')->fail('二维码生成失败'); return app('json')->success(compact('url')); } diff --git a/app/controller/api/community/CommunityReply.php b/app/controller/api/community/CommunityReply.php index b48d1670..98d224e3 100644 --- a/app/controller/api/community/CommunityReply.php +++ b/app/controller/api/community/CommunityReply.php @@ -15,6 +15,7 @@ namespace app\controller\api\community; use app\common\repositories\community\CommunityRepository; use app\common\repositories\system\RelevanceRepository; use crmeb\basic\BaseController; +use crmeb\services\MiniProgramService; use think\App; use app\common\repositories\community\CommunityReplyRepository as repository; use think\exception\ValidateException; @@ -75,7 +76,7 @@ class CommunityReply extends BaseController $data = $this->request->params(['content']); if (empty($data['content'])) return app('json')->fail('请输入回复内容'); - + MiniProgramService::create()->msgSecCheck($this->request->userInfo(), $data['content'],2,0); $data['uid'] = $this->request->userInfo()->uid; $data['community_id'] = $id; diff --git a/app/controller/api/server/StoreOrder.php b/app/controller/api/server/StoreOrder.php index a37acbf1..d0b18658 100644 --- a/app/controller/api/server/StoreOrder.php +++ b/app/controller/api/server/StoreOrder.php @@ -196,7 +196,7 @@ class StoreOrder extends BaseController $method = 'delivery'; break; } - $repository->runDelivery($id,$merId, $data, $split, $method); + $repository->runDelivery($id,$merId, $data, $split, $method, $this->request->serviceInfo()->service_id); return app('json')->success('发货成功'); } @@ -334,7 +334,8 @@ class StoreOrder extends BaseController { $order = $orderRepository->getWhere(['order_id' => $id,'mer_id' => $merId]); if (!$order) return app('json')->fail('数据不存在'); - $orderRepository->verifyOrder($order->verify_code, $merId, 0); + $data = $this->request->params(['verify_code','data']); + $orderRepository->verifyOrder($order->verify_code, $merId, $data, $this->request->serviceInfo()->service_id); return app('json')->success('订单核销成功'); } diff --git a/app/controller/api/server/StoreProduct.php b/app/controller/api/server/StoreProduct.php index 5a1e9ef2..d39a5ffd 100644 --- a/app/controller/api/server/StoreProduct.php +++ b/app/controller/api/server/StoreProduct.php @@ -79,8 +79,6 @@ class StoreProduct extends BaseController $data['status'] = $merchant->is_audit ? 0 : 1; $data['mer_status'] = ($merchant['is_del'] || !$merchant['mer_state'] || !$merchant['status']) ? 0 : 1; $data['rate'] = 3; - // $data['cate_id'] = 1; - // $data['mer_cate_id'] = 1; $this->repository->create($data, 0, 1); return app('json')->success('添加成功'); } diff --git a/app/controller/api/server/StoreRefundOrder.php b/app/controller/api/server/StoreRefundOrder.php index 1681b401..2bbc68ef 100644 --- a/app/controller/api/server/StoreRefundOrder.php +++ b/app/controller/api/server/StoreRefundOrder.php @@ -75,7 +75,7 @@ class StoreRefundOrder extends BaseController return app('json')->fail('未通过必须填写'); $data['status'] = $status; $data['fail_message'] = $fail_message; - $this->repository->refuse($id,$data); + $this->repository->refuse($id,$data, $this->service_id); } return app('json')->success('审核成功'); } diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 465e1f4e..0719b505 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -12,19 +12,10 @@ namespace app\controller\api\store\merchant; -use app\common\repositories\store\MerchantTakeRepository; -use app\common\repositories\store\product\ProductRepository; -use app\common\repositories\system\config\ConfigValueRepository; use app\common\repositories\user\UserMerchantRepository; -use app\validate\merchant\MerchantTakeValidate; -use app\validate\merchant\MerchantUpdateValidate; -use crmeb\jobs\ChangeMerchantStatusJob; use think\App; use crmeb\basic\BaseController; use app\common\repositories\system\merchant\MerchantRepository as repository; -use think\facade\Queue; -use think\facade\Db; - class Merchant extends BaseController { @@ -51,7 +42,7 @@ class Merchant extends BaseController public function lst() { [$page, $limit] = $this->getPage(); - $where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader','street_id']); + $where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader']); return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo)); } @@ -75,9 +66,9 @@ class Merchant extends BaseController public function systemDetail() { - $config = systemConfig(['site_logo', 'site_name']); + $config = systemConfig(['site_logo', 'site_name','login_logo']); return app('json')->success([ - 'mer_avatar' => $config['site_logo'], + 'mer_avatar' => $config['login_logo'], 'mer_name' => $config['site_name'], 'mer_id' => 0, ]); @@ -107,7 +98,7 @@ class Merchant extends BaseController */ public function categoryList($id) { - if(!$this->repository->merExists($id)) + if(!$this->repository->merExists((int)$id)) return app('json')->fail('店铺已打烊'); return app('json')->success($this->repository->categoryList($id)); } @@ -128,110 +119,4 @@ class Merchant extends BaseController return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo)); } - /** - * @param MerchantUpdateValidate $validate - * @return mixed - * @author xaboy - * @day 2020/6/25 - */ - public function update(MerchantUpdateValidate $validate, MerchantTakeValidate $takeValidate, MerchantTakeRepository $repository) - { - - $type = $this->request->param('type',1); - $id = $this->request->param('id'); - if(empty($id)){ - return app('json')->fail('参数错误'); - } - - $merchant = Db::name('merchant')->where('mer_id',$id)->find(); - if ($type == 2) { - $data = $this->request->params([ - 'mer_info', - 'mer_certificate', - 'service_phone', - 'mer_avatar', - 'mer_banner', - 'mer_state', - 'mini_banner', - 'mer_keyword', - 'mer_address', - 'long', - 'lat', - ['delivery_way',[2]], - ]); - - // 如果手机号不存在,则使用入驻时的手机号 - $data['service_phone'] = empty($data['service_phone'])?$merchant['mer_phone']:$data['service_phone']; - - $validate->check($data); - $sys_bases_status = systemConfig('sys_bases_status') === '0' ? 0 : 1; - if ($sys_bases_status && empty($data['mer_certificate'])) - return app('json')->fail('店铺资质不可为空'); - - app()->make(ConfigValueRepository::class)->setFormData([ - 'mer_certificate' => $data['mer_certificate'] - ], $id); - unset($data['mer_certificate']); - - foreach ($data['delivery_way'] as $datum) { - if ($datum == 1) { - $takeData = $this->request->params(['mer_take_status', 'mer_take_location', 'mer_take_day', 'mer_take_time']); - $takeData['mer_take_name'] = $merchant['mer_name']; - $takeData['mer_take_address'] = $data['mer_address']; - $takeData['mer_take_phone'] = $merchant['mer_phone']; - $takeValidate->check($takeData); - $repository->set($id, $takeData); - break; - } - } - $delivery_way = implode(',',$data['delivery_way']); - if (count($data['delivery_way']) == 1 && $data['delivery_way'] != $merchant['delivery_way']) { - app()->make(ProductRepository::class)->getSearch([]) - ->where('mer_id',$merchant['mer_id']) - ->update(['delivery_way' => $delivery_way]); - } - - $data['delivery_way'] = $delivery_way; - - } else { - $data = $this->request->params(['mer_state']); - - if ($merchant['is_margin'] == 1 && $data['mer_state'] == 1) - return app('json')->fail('开启店铺前请先支付保证金'); - - if ($data['mer_state'] && !$merchant['sub_mchid'] && systemConfig('open_wx_combine')) - return app('json')->fail('开启店铺前请先完成微信子商户入驻'); - } - Db::name('merchant')->where('mer_id',$id)->update($data); - - Queue::push(ChangeMerchantStatusJob::class, $id); - return app('json')->success('修改成功'); - } - - /** - * @return mixed - * @author xaboy - * @day 2020/7/21 - */ - public function info(MerchantTakeRepository $repository) - { - $id = $this->request->param('id'); - if(empty($id)){ - return app('json')->fail('参数错误'); - } - - $data = Db::name('merchant')->where('mer_id',$id)->find(); - // $append = ['merchantCategory', 'merchantType', 'mer_certificate']; - // if ($merchant['is_margin'] == -10) - // $append[] = 'refundMarginOrder'; - - // $data = $merchant->append($append)->hidden(['mark', 'reg_admin_id', 'sort'])->toArray(); - $delivery = $repository->get($id) + systemConfig(['tx_map_key']); - $data = array_merge($data,$delivery); - $data['sys_bases_status'] = systemConfig('sys_bases_status') === '0' ? 0 : 1; - - return app('json')->success($data); - } - - } diff --git a/app/controller/api/store/order/StoreOrder.php b/app/controller/api/store/order/StoreOrder.php index 79860821..410f9f39 100644 --- a/app/controller/api/store/order/StoreOrder.php +++ b/app/controller/api/store/order/StoreOrder.php @@ -157,7 +157,8 @@ class StoreOrder extends BaseController $source = $this->request->param('source'); $source = !isset($source)?2:$source; // 默认来源为2 普通商品订单 $where['uid'] = $this->request->uid(); - // $where['paid'] = 1; + $where['paid'] = 1; + $where['is_user'] = 1; $where['source'] = $source; return app('json')->success($this->repository->getList($where, $page, $limit, $source)); } diff --git a/app/controller/api/store/product/Discounts.php b/app/controller/api/store/product/Discounts.php index 1844d5d6..6fdcd347 100644 --- a/app/controller/api/store/product/Discounts.php +++ b/app/controller/api/store/product/Discounts.php @@ -47,8 +47,8 @@ class Discounts extends BaseController ->column('discount_id'); $where['discount_id'] = $discount_id; } - - return app('json')->success($this->repository->getApilist($where)); + $data = $this->repository->getApilist($where); + return app('json')->success($data); } diff --git a/app/controller/api/store/product/StoreCategory.php b/app/controller/api/store/product/StoreCategory.php index 1dbc6cf9..4506a349 100644 --- a/app/controller/api/store/product/StoreCategory.php +++ b/app/controller/api/store/product/StoreCategory.php @@ -60,7 +60,6 @@ class StoreCategory extends BaseController } } } - $data['list'] = $ret; return app('json')->success($data); } diff --git a/app/controller/api/store/product/StoreCoupon.php b/app/controller/api/store/product/StoreCoupon.php index 0493ddb8..94c1b612 100644 --- a/app/controller/api/store/product/StoreCoupon.php +++ b/app/controller/api/store/product/StoreCoupon.php @@ -124,7 +124,6 @@ class StoreCoupon extends BaseController { $where = $this->request->params(['type','mer_id', 'product','is_pc',['send_type',0]]); [$page, $limit] = $this->getPage(); - $where['not_svip'] = 1; $data = $couponRepository->apiList($where, $page, $limit, $this->uid); return app('json')->success($data); } diff --git a/app/controller/api/store/product/StoreProductPresell.php b/app/controller/api/store/product/StoreProductPresell.php index 849bb346..291cdc18 100644 --- a/app/controller/api/store/product/StoreProductPresell.php +++ b/app/controller/api/store/product/StoreProductPresell.php @@ -51,7 +51,7 @@ class StoreProductPresell extends BaseController public function getAgree() { $make = app()->make(CacheRepository::class); - return app('json')->success(['sys_product_presell_agree' => $make->getResult('sys_product_presell_agree')]); + return app('json')->success($make->getResult('sys_product_presell_agree')); } } diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index e3209198..3d1ac509 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -314,12 +314,14 @@ class StoreSpu extends BaseController $data = []; foreach ($cateId as $cate_id) { $cate = app()->make(StoreCategoryRepository::class)->get($cate_id); - $list = $this->repository->getHotRanking($cate_id); - $data[] = [ - 'cate_id' => $cate['store_category_id'] ?? 0, - 'cate_name' => $cate['cate_name'] ?? '总榜', - 'list' => $list, - ]; + if ($cate) { + $list = $this->repository->getHotRanking($cate_id); + $data[] = [ + 'cate_id' => $cate['store_category_id'] ?? 0, + 'cate_name' => $cate['cate_name'] ?? '总榜', + 'list' => $list, + ]; + } } return app('json')->success($data); } diff --git a/app/controller/api/store/service/Service.php b/app/controller/api/store/service/Service.php index 8a54887e..1a6d1180 100644 --- a/app/controller/api/store/service/Service.php +++ b/app/controller/api/store/service/Service.php @@ -172,6 +172,18 @@ class Service extends BaseController return app('json')->success($data); } + public function hasService($id){ + $uid = 0; + if ($this->request->isLogin()) { + $uid = $this->request->uid(); + } + $data = $this->repository->getChatService($id, $uid); + if (!$data) { + return app('json')->fail('暂无可用客服'); + } + return app('json')->success(200); + } + public function scanLogin($key) { $serviceId = (int)$this->request->param('service_id'); diff --git a/app/controller/api/user/Admin.php b/app/controller/api/user/Admin.php index e2148c0d..95379923 100644 --- a/app/controller/api/user/Admin.php +++ b/app/controller/api/user/Admin.php @@ -104,7 +104,7 @@ class Admin extends BaseController return app('json')->fail('金额不可未负数'); if (!$repository->merStatusExists((int)$id, $merId)) return app('json')->fail('订单信息或状态错误'); - $repository->eidt($id, $data); + $repository->eidt($id, $data, $this->request->serviceInfo()->service_id); return app('json')->success('修改成功'); } diff --git a/app/controller/api/user/User.php b/app/controller/api/user/User.php index f300375e..759af981 100644 --- a/app/controller/api/user/User.php +++ b/app/controller/api/user/User.php @@ -607,7 +607,7 @@ class User extends BaseController public function services() { $uid = $this->user->uid; - $where = $this->request->params(['is_verify', 'customer', 'is_goods', 'is_open']); + $where = $this->request->params(['is_verify', 'customer', 'is_goods', ['is_open',1]]); $is_sys = $this->request->param('is_sys'); return app('json')->success(app()->make(StoreServiceRepository::class)->getServices($uid, $where,$is_sys)); } @@ -685,14 +685,19 @@ class User extends BaseController if (systemConfig('open_update_info') != '1') { return app('json')->fail('不允许修改基本信息'); } - $data = $this->request->params(['nickname', 'avatar']); - if (!$data['nickname'] && !$data['avatar']) + $nickname = $this->request->param('nickname'); + $avatar = $this->request->param('avatar'); + if (!$nickname && !$avatar) return app('json')->fail('未做任何修改'); $user = $this->request->userInfo(); - $data['nickname'] = $data['nickname'] ?: $user['nickname'] ; - $data['avatar'] = $data['avatar'] ?: $user['avatar'] ; - $validate->check($data); - $user->save($data); + if(!empty($nickname)) { + $validate->check(['nickname' => $nickname]); + $data['nickname'] = $nickname; + } + if(!empty($avatar)) { + $data['avatar'] = $avatar; + } + $this->repository->updateBaseInfo($data,$user); return app('json')->success('修改成功'); } /** diff --git a/app/controller/api/user/UserExtract.php b/app/controller/api/user/UserExtract.php index 5895b081..13f801a6 100644 --- a/app/controller/api/user/UserExtract.php +++ b/app/controller/api/user/UserExtract.php @@ -68,4 +68,12 @@ class UserExtract extends BaseController $data = app()->make(GroupDataRepository::class)->groupData('bank_list',0,$page,100); return app('json')->success($data); } + + public function historyBank() + { + $data = $this->repository->getHistoryBank($this->request->userInfo()->uid); + return app('json')->success($data ?? []); + } + + } diff --git a/app/controller/api/user/UserRelation.php b/app/controller/api/user/UserRelation.php index ef60a8a0..62195f97 100644 --- a/app/controller/api/user/UserRelation.php +++ b/app/controller/api/user/UserRelation.php @@ -44,14 +44,13 @@ class UserRelation extends BaseController $params = $this->request->params(['type_id', 'type']); $params['uid'] = $this->request->uid(); if (!$params['type_id']) - return app('json')->fail('参数丢失'); + return app('json')->fail('请选择'. ($params['type'] == 1 ? '商品' : '商户')); if (!in_array($params['type'], [0,1,2,3,4,10])) return app('json')->fail('参数错误'); if (!$this->repository->fieldExists($params)) return app('json')->fail('数据不存在'); if ($this->repository->getUserRelation($params,$this->request->uid())) return app('json')->fail('您已经关注过了'); - $params['uid'] = $this->request->uid(); $this->repository->create($params); return app('json')->success('关注成功'); } @@ -84,13 +83,12 @@ class UserRelation extends BaseController * @author Qinii * @day 7/12/21 */ - public function lstDelete() + public function batchDelete() { - $params = $this->request->params(['type_id','type']); - $params['uid'] = $this->request->uid(); - if(!$this->repository->getWhere($params)) - return app('json')->fail('信息不存在'); - $this->repository->destory($params,1); + $ids = $this->request->param('type_id'); + $type = $this->request->param('type',1); + if(empty($ids)) return app('json')->fail('请选择'. ($type == 1 ? '商品' : '商户')); + $this->repository->batchDestory($ids,$this->request->uid(),$type); return app('json')->success('已取消关注'); } @@ -105,7 +103,7 @@ class UserRelation extends BaseController $params = $this->request->params(['type_id','type']); if (!$this->repository->getUserRelation($params,$this->request->uid())) return app('json')->fail('信息不存在'); - $this->repository->destory($params); + $rest = $this->repository->batchDestory([$params['type_id']],$this->request->uid(),$params['type']); return app('json')->success('已取消关注'); } @@ -121,4 +119,5 @@ class UserRelation extends BaseController $this->repository->batchCreate($this->request->uid(),$params); return app('json')->success('收藏成功'); } + } diff --git a/app/controller/merchant/Common.php b/app/controller/merchant/Common.php index bc271941..e0fe41dc 100644 --- a/app/controller/merchant/Common.php +++ b/app/controller/merchant/Common.php @@ -265,7 +265,7 @@ class Common extends BaseController 'fileExt' => 'mp4,mov', 'fileMime' => 'video/mp4,video/quicktime', ]])->check(['file' => $file]); - $upload = UploadService::create(1); + $upload = UploadService::create(); $data = $upload->to('media')->validate([])->move('file'); if ($data === false) { return app('json')->fail($upload->getError()); diff --git a/app/controller/merchant/store/Excel.php b/app/controller/merchant/store/Excel.php index 520c8121..e808a511 100644 --- a/app/controller/merchant/store/Excel.php +++ b/app/controller/merchant/store/Excel.php @@ -53,20 +53,12 @@ class Excel extends BaseController * @author Qinii * @day 2020-07-30 */ - public function download($id) + public function downloadExpress() { try{ - if($id == 'express'){ - $file['name'] = 'express'; - $path = app()->getRootPath().'extend/express.xlsx'; - if(!$file || !file_exists($path)) return app('json')->fail('文件不存在'); - return download($path,$file['name']); - } - - $file = $this->repository->getWhere(['excel_id' => $id,'mer_id' => $this->request->merId()]); - $path = app()->getRootPath().'public'.$file['path']; + $file['name'] = 'express'; + $path = app()->getRootPath().'extend/express.xlsx'; if(!$file || !file_exists($path)) return app('json')->fail('文件不存在'); - return download($path,$file['name']); }catch (UploadException $e){ return app('json')->fail('下载失败'); diff --git a/app/controller/merchant/store/StoreImport.php b/app/controller/merchant/store/StoreImport.php index 225ee328..1eb86cbc 100644 --- a/app/controller/merchant/store/StoreImport.php +++ b/app/controller/merchant/store/StoreImport.php @@ -82,7 +82,6 @@ class StoreImport extends BaseController if (!$file) return app('json')->fail('请上传EXCEL文件'); $file = is_array($file) ? $file[0] : $file; validate(["file|文件" => ['fileExt' => 'xlsx,xls',]])->check(['file' => $file]); - $upload = UploadService::create(1); $ret = $upload->to('excel')->move('file'); if ($ret === false) return app('json')->fail($upload->getError()); @@ -90,7 +89,31 @@ class StoreImport extends BaseController $path = rtrim(public_path(),'/').$res['dir']; $data = []; switch ($type){ - case 'delivery' : + case 'delivery': + $check =[ + 'A1'=>'商品名称', + 'B1'=>'商品简介', + 'C1'=>'关键字', + 'D1'=>'商品条码', + 'E1'=>'分类', + 'F1'=>'单位名', + 'G1'=>'出售价', + 'H1'=>'成本价', + 'I1'=>'总库存', + ]; + SpreadsheetExcelService::instance()->checkImport($path,$check); + $data = [ + 'mer_id' => $this->request->merId(), + 'data' => [ + 'path' => $path, + 'sql' => ['store_name' => 'A', 'store_info' => 'B', 'keyword' => 'C', 'bar_code' => 'D', 'cate_id' => 'E', 'unit_name' => 'F', 'price' => 'G', 'cost' => 'H', 'stock' => 'I'], + 'where' => ['bar_code' => 'D'], + ] + ]; + app()->make(StoreOrderRepository::class)->setProduct($data['data'],$data['mer_id']); + + break; + case 'product' : SpreadsheetExcelService::instance()->checkImport($path,['E3' => '物流单号']); $data = [ 'mer_id' => $this->request->merId(), diff --git a/app/controller/merchant/store/delivery/DeliveryStation.php b/app/controller/merchant/store/delivery/DeliveryStation.php index c2a58cb1..9263388f 100644 --- a/app/controller/merchant/store/delivery/DeliveryStation.php +++ b/app/controller/merchant/store/delivery/DeliveryStation.php @@ -124,6 +124,7 @@ class DeliveryStation extends BaseController $make->scene('dada')->check($data); } else { $make->check($data); + [$data['lng'],$data['lat']] = gcj02ToBd09($data['lng'],$data['lat']); } return $data; } @@ -181,7 +182,7 @@ class DeliveryStation extends BaseController public function getQrcode() { if (systemConfig('delivery_status') != 1) throw new ValidateException('未开启同城配送'); - $data['pay_type'] = 1; + $data['pay_type'] = $this->request->param('pay_type',1); $data['price'] = $this->request->param('price',10); if (!is_numeric($data['price']) || $data['price'] <= 0 ) return app('json')->fail('支付金额不正确'); diff --git a/app/controller/merchant/store/order/Order.php b/app/controller/merchant/store/order/Order.php index a8c8eeb2..c4e6ecfc 100644 --- a/app/controller/merchant/store/order/Order.php +++ b/app/controller/merchant/store/order/Order.php @@ -236,7 +236,6 @@ class Order extends BaseController ]; if ($params['delivery_type'] == 4 && !systemConfig('crmeb_serve_dump')) return app('json')->fail('电子面单功能未开启'); - $this->repository->batchDelivery($data['mer_id'],$data['data']); Queue::push(BatchDeliveryJob::class, $data); return app('json')->success('开始批量发货'); } @@ -295,9 +294,11 @@ class Order extends BaseController public function status($id) { [$page, $limit] = $this->getPage(); + $where = $this->request->params(['date','user_type']); + $where['id'] = $id; if (!$this->repository->getOne($id, $this->request->merId())) return app('json')->fail('数据不存在'); - return app('json')->success($this->repository->getOrderStatus($id, $page, $limit)); + return app('json')->success($this->repository->getOrderStatus($where, $page, $limit)); } /** @@ -447,6 +448,11 @@ class Order extends BaseController [$page, $limit] = $this->getPage(); $data = app()->make(ExcelService::class)->delivery($where,$page,$limit); return app('json')->success($data); + } + public function childrenList($id) + { + $data = $this->repository->childrenList($id, $this->request->merId()); + return app('json')->success($data); } } diff --git a/app/controller/merchant/store/order/RefundOrder.php b/app/controller/merchant/store/order/RefundOrder.php index 9c3e9986..62d1276b 100644 --- a/app/controller/merchant/store/order/RefundOrder.php +++ b/app/controller/merchant/store/order/RefundOrder.php @@ -14,6 +14,7 @@ namespace app\controller\merchant\store\order; use app\common\repositories\store\ExcelRepository; use app\common\repositories\store\order\MerchantReconciliationRepository; +use app\common\repositories\store\order\StoreOrderStatusRepository; use app\common\repositories\store\order\StoreRefundStatusRepository; use crmeb\services\ExcelService; use think\App; @@ -82,7 +83,7 @@ class RefundOrder extends BaseController if ($data['phone'] && isPhone($data['phone'])) return app('json')->fail('请输入正确的手机号'); $data['status'] = $status; - $this->repository->agree($id,$data,$this->request->adminId()); + $this->repository->agree($id,$data); }else{ $fail_message = $this->request->param('fail_message',''); if($status == -1 && empty($fail_message)) @@ -105,7 +106,7 @@ class RefundOrder extends BaseController { if(!$this->repository->getRefundPriceExists($this->request->merId(),$id)) return app('json')->fail('信息或状态错误'); - $this->repository->adminRefund($id,$this->request->adminId()); + $this->repository->adminRefund($id,0); return app('json')->success('退款成功'); } @@ -171,8 +172,11 @@ class RefundOrder extends BaseController public function log($id) { list($page,$limit) = $this->getPage(); - $make = app()->make(StoreRefundStatusRepository::class); - return app('json')->success($make->search($id,$page,$limit)); + $where = $this->request->params(['date','user_type']); + $where['id'] = $id; + $where['type'] = StoreOrderStatusRepository::TYPE_REFUND; + $data = app()->make(StoreOrderStatusRepository::class)->search($where,$page,$limit); + return app('json')->success($data); } public function reList($id) diff --git a/app/controller/merchant/store/product/Discounts.php b/app/controller/merchant/store/product/Discounts.php index a6a85185..9542f620 100644 --- a/app/controller/merchant/store/product/Discounts.php +++ b/app/controller/merchant/store/product/Discounts.php @@ -120,9 +120,9 @@ class Discounts extends BaseController } foreach ($data['products'] as $item) { if (!isset($item['items'])) - return app('json')->fail('请选择' . $item['store_name'] . '的规格'); + throw new ValidateException('请选择' . $item['store_name'] . '的规格'); foreach ($item['attr'] as $attr) { - if($attr['active_price'] > $attr['price']) return app('json')->fail('套餐价格高于原价'); + if($attr['active_price'] > $attr['price']) throw new ValidateException('套餐价格高于原价'); } } $data['mer_id'] = $this->request->merId(); diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index 83a0df41..efa05be0 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -47,7 +47,7 @@ class Product extends BaseController public function lst() { [$page, $limit] = $this->getPage(); - $where = $this->request->params(['temp_id','cate_id','keyword',['type',1],'mer_cate_id','is_gift_bag','status','us_status','product_id','mer_labels',['order','sort'],'is_ficti']); + $where = $this->request->params(['temp_id','cate_id','keyword',['type',1],'mer_cate_id','is_gift_bag','status','us_status','product_id','mer_labels',['order','sort'],'is_ficti','svip_price_type']); $where = array_merge($where,$this->repository->switchType($where['type'],$this->request->merId(),0)); return app('json')->success($this->repository->getList($this->request->merId(),$where, $page, $limit)); } diff --git a/app/controller/merchant/store/product/ProductSeckill.php b/app/controller/merchant/store/product/ProductSeckill.php index 975c6193..57e95992 100644 --- a/app/controller/merchant/store/product/ProductSeckill.php +++ b/app/controller/merchant/store/product/ProductSeckill.php @@ -164,7 +164,7 @@ class ProductSeckill extends BaseController $status = $this->request->param('status', 0) == 1 ? 1 : 0; if(!$this->repository->merExists($this->request->merId(),$id)) return app('json')->fail('数据不存在'); - $this->repository->switchShow([$id], $status,'is_show',$this->request->merId()); + $this->repository->switchShow($id, $status,'is_show',$this->request->merId()); return app('json')->success('修改成功'); } diff --git a/app/controller/merchant/store/service/StoreService.php b/app/controller/merchant/store/service/StoreService.php index 56d9b1a4..50579be6 100644 --- a/app/controller/merchant/store/service/StoreService.php +++ b/app/controller/merchant/store/service/StoreService.php @@ -188,7 +188,7 @@ class StoreService extends BaseController $status = $this->request->param('status'); if (!$this->repository->merExists($this->request->merId(), $id)) return app('json')->fail('数据不存在'); - $this->repository->update($id, ['status' => $status == 1 ? 1 : 0]); + $this->repository->update($id, ['is_open' => $status == 1 ? 1 : 0]); return app('json')->success('修改成功'); } diff --git a/app/controller/service/Login.php b/app/controller/service/Login.php index 715d7855..e99f8fd4 100644 --- a/app/controller/service/Login.php +++ b/app/controller/service/Login.php @@ -54,9 +54,9 @@ class Login extends BaseController public function login(StoreServiceRepository $repository) { $data = $this->request->params(['account', 'password', 'key', 'code']); - if (Cache::get('ser_login_freeze_' . $data['account'])) - return app('json')->fail('账号或密码错误次数太多,请稍后在尝试'); - $repository->checkCode($data['key'], $data['code']); +// if (Cache::get('ser_login_freeze_' . $data['account'])) +// return app('json')->fail('账号或密码错误次数太多,请稍后在尝试'); +// $repository->checkCode($data['key'], $data['code']); $service = $repository->getWhere(['account' => $data['account'], 'is_del' => 0]); @@ -65,12 +65,12 @@ class Login extends BaseController } if (!$service['is_open']) return app('json')->fail('账号未开启'); - if (!$service['status']) - return app('json')->fail('账号已被禁用'); +// if (!$service['status']) +// return app('json')->fail('账号已被禁用'); - if (!password_verify($data['password'], $service['pwd'])) { - return $this->loginFailure($data['account']); - } +// if (!password_verify($data['password'], $service['pwd'])) { +// return $this->loginFailure($data['account']); +// } $tokenInfo = $repository->createToken($service); $admin = $service->toArray(); unset($admin['pwd']); diff --git a/app/controller/service/Service.php b/app/controller/service/Service.php index 6ab41acd..e5e81b61 100644 --- a/app/controller/service/Service.php +++ b/app/controller/service/Service.php @@ -3,6 +3,7 @@ namespace app\controller\service; use app\common\repositories\store\order\StoreOrderRepository; +use app\common\repositories\store\order\StoreOrderStatusRepository; use app\common\repositories\store\order\StoreRefundOrderRepository; use app\common\repositories\store\product\ProductRepository; use app\common\repositories\store\service\StoreServiceLogRepository; @@ -70,7 +71,9 @@ class Service extends BaseController public function orderStatus($id) { [$page, $limit] = $this->getPage(); - return app('json')->success(app()->make(StoreOrderRepository::class)->getOrderStatus($id, $page, $limit)); + $where = $this->request->params(['date','user_type']); + $where['id'] = $id; + return app('json')->success(app()->make(StoreOrderRepository::class)->getOrderStatus($where, $page, $limit)); } public function getRefundOder($id) diff --git a/app/validate/api/MerchantIntentionValidate.php b/app/validate/api/MerchantIntentionValidate.php index eddcc03d..e3d1e81d 100644 --- a/app/validate/api/MerchantIntentionValidate.php +++ b/app/validate/api/MerchantIntentionValidate.php @@ -24,7 +24,7 @@ class MerchantIntentionValidate extends Validate 'name|姓名' => 'require', 'mer_name|姓名' => 'require|max:32', 'merchant_category_id|商户分类' => 'require', - 'mer_type_id|店铺类型' => 'require|integer', + 'mer_type_id|店铺类型' => 'integer', 'code|验证码' => 'require', 'images|资质' => 'array', ]; diff --git a/app/validate/api/UserExtractValidate.php b/app/validate/api/UserExtractValidate.php index e1fdd603..f558ebe1 100644 --- a/app/validate/api/UserExtractValidate.php +++ b/app/validate/api/UserExtractValidate.php @@ -22,11 +22,10 @@ class UserExtractValidate extends Validate protected $rule = [ 'wechat|微信号' => 'requireIf:extract_type,1', 'real_name|姓名' => 'requireIf:extract_type,0', - 'bank_code|银行卡号' => 'requireIf:extract_type,0', + 'bank_code|银行卡号' => 'requireIf:extract_type,0|number', 'extract_type|收款方式' => 'require', 'extract_price|提现金额' => 'require|gt:0', 'alipay_code|支付宝账户' => 'requireIf:extract_type,2', - 'source|提现来源' => 'number', ]; } diff --git a/app/validate/merchant/StoreProductAdminValidate.php b/app/validate/merchant/StoreProductAdminValidate.php index 29bca48b..7a150ed5 100644 --- a/app/validate/merchant/StoreProductAdminValidate.php +++ b/app/validate/merchant/StoreProductAdminValidate.php @@ -22,7 +22,7 @@ class StoreProductAdminValidate extends Validate "store_name|商品名称" => 'require', "is_hot|是否热卖" => "in:0,1", "is_best|是否精品" => "in:0,1", - "ficti|虚拟销量" => "number", + "ficti|已售数量" => "number", "status|审核状态" => "in:0,1,-1", "refusal|拒绝理由" => "requireIf:status,-1" ]; diff --git a/app/webscoket/handler/AdminHandler.php b/app/webscoket/handler/AdminHandler.php index 82bfa2a7..a892ad37 100644 --- a/app/webscoket/handler/AdminHandler.php +++ b/app/webscoket/handler/AdminHandler.php @@ -89,8 +89,8 @@ class AdminHandler $admin = $repository->get($payload->jti[0]); if (!$admin) return app('json')->fail('账号不存在'); - if (!$admin['status']) - return app('json')->fail('账号已被禁用'); +// if (!$admin['status']) +// return app('json')->fail('账号已被禁用'); return app('json')->success(['uid' => $admin->admin_id, 'data' => $admin->toArray()]); } diff --git a/app/webscoket/handler/MerchantHandler.php b/app/webscoket/handler/MerchantHandler.php index 90a2f295..7eaaa45d 100644 --- a/app/webscoket/handler/MerchantHandler.php +++ b/app/webscoket/handler/MerchantHandler.php @@ -89,8 +89,8 @@ class MerchantHandler $admin = $repository->get($payload->jti[0]); if (!$admin) return app('json')->fail('账号不存在'); - if (!$admin['status']) - return app('json')->fail('账号已被禁用'); +// if (!$admin['status']) +// return app('json')->fail('账号已被禁用'); /** * @var MerchantRepository $merchantRepository diff --git a/app/webscoket/handler/ServiceHandler.php b/app/webscoket/handler/ServiceHandler.php index fb2e9002..5f51b3ad 100644 --- a/app/webscoket/handler/ServiceHandler.php +++ b/app/webscoket/handler/ServiceHandler.php @@ -87,14 +87,12 @@ class ServiceHandler } if ('service' != $payload->jti[1]) return app('json')->message('err_tip', '登录过期'); - $service = $repository->get($payload->jti[0]); if (!$service) return app('json')->message('err_tip', '账号不存在'); - if (!$service['is_open'] || !$service['status']) + if (!$service['is_open']) return app('json')->message('err_tip', '账号已被禁用'); - $this->switchServiceChat($service->uid, $data['fd'], 0, 0); return app('json')->success(['uid' => $service->uid, 'payload' => [$service->service_id], 'data' => $service->toArray()]); } diff --git a/app/webscoket/handler/UserHandler.php b/app/webscoket/handler/UserHandler.php index df556dab..9da6ae17 100644 --- a/app/webscoket/handler/UserHandler.php +++ b/app/webscoket/handler/UserHandler.php @@ -99,7 +99,7 @@ class UserHandler if (!$user) return app('json')->message('err_tip', '账号不存在'); if (!$user['status']) - return app('json')->message('err_tip', '账号已被禁用'); + return app('json')->message('err_tip', '账号状态已关闭'); return app('json')->success(['uid' => $user->uid, 'data' => $user->toArray()]); } diff --git a/composer.json b/composer.json index 7c52ef34..09e90fa2 100644 --- a/composer.json +++ b/composer.json @@ -69,12 +69,6 @@ "": "extend/" } }, - "repositories": { - "packagist": { - "type": "composer", - "url": "https://mirrors.aliyun.com/composer/" - } - }, "config": { "preferred-install": "dist" }, diff --git a/config/log.php b/config/log.php index e0b2e54f..1c7215f6 100644 --- a/config/log.php +++ b/config/log.php @@ -17,7 +17,7 @@ return [ // 默认日志记录通道 'default' => env('log.channel', 'file'), // 日志记录级别 - 'level' => [], + 'level' => ['error', 'warning', 'info', 'fail', 'success'], // 日志类型记录的通道 ['error'=>'email',...] 'type_channel' => [], // 关闭全局日志写入 @@ -35,7 +35,7 @@ return [ // 单文件日志写入 'single' => false, // 独立日志级别 - 'apart_level' => [], + 'apart_level' => ['error','warning','info', 'fail', 'success','sql'], // 最大日志文件数量 'max_files' => 30, // 使用JSON格式记录 diff --git a/crmeb/jobs/CheckProductPresellJob.php b/crmeb/jobs/CheckProductPresellJob.php index 57a22c1e..4e84acc4 100644 --- a/crmeb/jobs/CheckProductPresellJob.php +++ b/crmeb/jobs/CheckProductPresellJob.php @@ -27,10 +27,10 @@ class CheckProductPresellJob implements JobInterface try{ $make = app()->make(ProductPresellRepository::class); $make->checkStatus(null); - $job->delete(); }catch (\Exception $exception){ Log::info($exception->getMessage()); } + $job->delete(); } public function failed($data) diff --git a/crmeb/jobs/ExpressSyncJob.php b/crmeb/jobs/ExpressSyncJob.php index ec07daf6..4f19bdad 100644 --- a/crmeb/jobs/ExpressSyncJob.php +++ b/crmeb/jobs/ExpressSyncJob.php @@ -24,10 +24,10 @@ class ExpressSyncJob implements JobInterface { try{ app()->make(ExpressRepository::class)->syncExportAll(); - $job->delete(); }catch (\Exception $exception){ Log::info(var_export($exception, 1)); } + $job->delete(); } public function failed($data) diff --git a/crmeb/jobs/GauaranteeCountJob.php b/crmeb/jobs/GauaranteeCountJob.php index 229f3c40..054ac90d 100644 --- a/crmeb/jobs/GauaranteeCountJob.php +++ b/crmeb/jobs/GauaranteeCountJob.php @@ -24,10 +24,10 @@ class GauaranteeCountJob implements JobInterface { try{ app()->make(GuaranteeRepository::class)->countGuarantee(); - $job->delete(); }catch (\Exception $exception){ Log::info($exception->getMessage()); } + $job->delete(); } public function failed($data) diff --git a/crmeb/jobs/OrderReplyJob.php b/crmeb/jobs/OrderReplyJob.php index be51eb13..1f519571 100644 --- a/crmeb/jobs/OrderReplyJob.php +++ b/crmeb/jobs/OrderReplyJob.php @@ -37,8 +37,17 @@ class OrderReplyJob implements JobInterface $data['avatar'] = $order->user ? $order->user['avatar'] : ''; $data['mer_id'] = $order->mer_id; $ids = []; + //订单记录 + $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); + $orderStatus = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'type' => $storeOrderStatusRepository::TYPE_ORDER, + 'change_message' => '交易完成', + 'change_type' => $storeOrderStatusRepository::ORDER_STATUS_AUTO_OVER, + ]; try { - Db::transaction(function () use ($productReplyRepository, $order, &$ids, $data) { + Db::transaction(function () use ($productReplyRepository, $order, &$ids, $data,$storeOrderStatusRepository,$orderStatus) { foreach ($order->orderProduct as $orderProduct) { if ($orderProduct->is_reply) continue; $data['order_product_id'] = $orderProduct['order_product_id']; @@ -52,8 +61,7 @@ class OrderReplyJob implements JobInterface $order->status = 3; $order->save(); //TODO 交易完成 - $statusRepository = app()->make(StoreOrderStatusRepository::class); - $statusRepository->status($order->order_id, $statusRepository::ORDER_STATUS_AUTO_OVER, '交易完成'); + $storeOrderStatusRepository->createSysLog($orderStatus); }); foreach ($ids as $id) { Queue::push(UpdateProductReplyJob::class, $id); diff --git a/crmeb/jobs/SendNewsJob.php b/crmeb/jobs/SendNewsJob.php index 49660f0d..4d0c3446 100644 --- a/crmeb/jobs/SendNewsJob.php +++ b/crmeb/jobs/SendNewsJob.php @@ -28,8 +28,7 @@ class SendNewsJob implements JobInterface $wechatUserRepository = app()->make(WechatUserRepository::class); [$id, $news] = $data; if (!$id || !($openId = $wechatUserRepository->idByOpenId((int)$id))) { - $job->delete(); - return; + return $job->delete(); } try { WechatService::create()->staffTo($openId, WechatService::newsMessage($news)); diff --git a/crmeb/jobs/SendSmsJob.php b/crmeb/jobs/SendSmsJob.php index 70db9317..6c0e17f0 100644 --- a/crmeb/jobs/SendSmsJob.php +++ b/crmeb/jobs/SendSmsJob.php @@ -42,6 +42,7 @@ class SendSmsJob implements JobInterface } if ($status['notice_routine'] == 1) { try { + Log::info('订阅消息发送数据' . var_export($data, 1)); app()->make(WechatTemplateMessageService::class)->subscribeSendTemplate($data); } catch (\Exception $e) { Log::info('订阅消息发送失败' . var_export($data, 1) . $e->getMessage()); diff --git a/crmeb/jobs/SyncProductTopJob.php b/crmeb/jobs/SyncProductTopJob.php index ae84e39e..11ea00ba 100644 --- a/crmeb/jobs/SyncProductTopJob.php +++ b/crmeb/jobs/SyncProductTopJob.php @@ -24,7 +24,7 @@ class SyncProductTopJob implements JobInterface $oldKeys1 = array_combine($oldKeys1, $oldKeys1); $mset = []; $hot = systemConfig(['hot_ranking_switch','hot_ranking_lv']); - if (!$hot['hot_ranking_switch']) return ; + if (!$hot['hot_ranking_switch']) return $job->delete(); $where['product_type'] = 0; $where['spu_status'] = 1; $where['mer_status'] = 1; diff --git a/crmeb/jobs/UserBrokerageLevelJob.php b/crmeb/jobs/UserBrokerageLevelJob.php index 31075ced..367294f5 100644 --- a/crmeb/jobs/UserBrokerageLevelJob.php +++ b/crmeb/jobs/UserBrokerageLevelJob.php @@ -23,7 +23,6 @@ class UserBrokerageLevelJob implements JobInterface { public function fire($job, $data) { - try { $user = app()->make(UserRepository::class)->get($data['uid']); if ($user) { diff --git a/crmeb/listens/AuthTakeOrderListen.php b/crmeb/listens/AuthTakeOrderListen.php index 6fd1e394..09d43fb5 100644 --- a/crmeb/listens/AuthTakeOrderListen.php +++ b/crmeb/listens/AuthTakeOrderListen.php @@ -29,12 +29,11 @@ class AuthTakeOrderListen extends TimerService implements ListenerInterface public function handle($event): void { $this->tick(1000 * 60 * 60, function () { - $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class); $storeOrderRepository = app()->make(StoreOrderRepository::class); request()->clearCache(); $timer = ((int)systemConfig('auto_take_order_timer')) ?: 15; $time = date('Y-m-d H:i:s', strtotime("- $timer day")); - $ids = $storeOrderStatusRepository->getTimeoutDeliveryOrder($time); + $ids = app()->make(StoreOrderStatusRepository::class)->getTimeoutDeliveryOrder($time); foreach ($ids as $id) { try { $storeOrderRepository->takeOrder($id); diff --git a/crmeb/listens/InitSwooleLockListen.php b/crmeb/listens/InitSwooleLockListen.php index d54e1d2a..479a10a9 100644 --- a/crmeb/listens/InitSwooleLockListen.php +++ b/crmeb/listens/InitSwooleLockListen.php @@ -15,6 +15,7 @@ namespace crmeb\listens; use crmeb\interfaces\ListenerInterface; +use crmeb\utils\Start; use Swoole\Lock; class InitSwooleLockListen implements ListenerInterface @@ -27,5 +28,6 @@ class InitSwooleLockListen implements ListenerInterface foreach ($locks as $lock) { $GLOBALS['_swoole_order_lock'][$lock] = new Lock(SWOOLE_MUTEX); } + app()->make(Start::class)->show(); } } diff --git a/crmeb/listens/ProductGroupStatusCheckListen.php b/crmeb/listens/ProductGroupStatusCheckListen.php index 68ad2515..ca836103 100644 --- a/crmeb/listens/ProductGroupStatusCheckListen.php +++ b/crmeb/listens/ProductGroupStatusCheckListen.php @@ -28,7 +28,7 @@ class ProductGroupStatusCheckListen extends TimerService implements ListenerInte try { $make->checkStatus(null); } catch (\Exception $e) { - Log::info('自动检测拼团结束失败' . date('Y-m-d H:i:s', time())); + Log::info('自动检测拼团结束失败' . date('Y-m-d H:i:s', time()). $e->getMessage()); } }); } diff --git a/crmeb/listens/RefundOrderAgreeListen.php b/crmeb/listens/RefundOrderAgreeListen.php index b2befe70..400805b2 100644 --- a/crmeb/listens/RefundOrderAgreeListen.php +++ b/crmeb/listens/RefundOrderAgreeListen.php @@ -31,7 +31,7 @@ class RefundOrderAgreeListen extends TimerService implements ListenerInterface $data = $make->getTimeOutIds($time); foreach ($data as $id) { try { - $make->adminRefund($id, 0); + $make->adminRefund($id); } catch (\Exception $e) { Log::info('自动退款失败' . var_export($id, true)); } diff --git a/crmeb/listens/SwooleTaskListen.php b/crmeb/listens/SwooleTaskListen.php index e0f5007a..ecb5146d 100644 --- a/crmeb/listens/SwooleTaskListen.php +++ b/crmeb/listens/SwooleTaskListen.php @@ -91,7 +91,7 @@ class SwooleTaskListen implements ListenerInterface $params = [ 'mer_id' => $data['data']['mer_id'], 'keyword1' => date('Y-m-d H:i:s',time()), - 'keyword2' => $data['data'], + 'keyword2' => $data['data']['msn'], 'url' => '/pages/chat/customer_list/chat?userId=' . $data['data']['uid'] . '&mer_id=' . $data['data']['mer_id'] ]; Queue::push(SendSmsJob::class, ['tempId' => 'SERVER_NOTICE', 'id' => $data['uid'], 'params' => $params]); @@ -163,11 +163,11 @@ class SwooleTaskListen implements ListenerInterface $serviceLogRepository->userRead($data['data']['mer_id'], $data['data']['uid']); app()->make(StoreServiceUserRepository::class)->read($data['data']['mer_id'], $data['data']['uid']); } else { - //TODO 用户消息提醒 + //TODO 客服给用户发送消息 $params = [ 'mer_id' => $data['data']['mer_id'], 'keyword1' => date('Y-m-d H:i:s', time()), - 'keyword2' => $data['data'], + 'keyword2' => $data['data']['msn'], 'url' => '/pages/chat/customer_list/chat?mer_id=' . $data['data']['mer_id'] ]; Queue::push(SendSmsJob::class, ['id' => $data['uid'], 'tempId' => 'SERVER_NOTICE', 'params' => $params]); diff --git a/crmeb/listens/pay/OrderPaySuccessListen.php b/crmeb/listens/pay/OrderPaySuccessListen.php index aa1571e2..cc2f7c29 100644 --- a/crmeb/listens/pay/OrderPaySuccessListen.php +++ b/crmeb/listens/pay/OrderPaySuccessListen.php @@ -17,6 +17,7 @@ namespace crmeb\listens\pay; use app\common\repositories\store\order\StoreGroupOrderRepository; use app\common\repositories\store\order\StoreOrderRepository; use crmeb\interfaces\ListenerInterface; +use think\facade\Log; class OrderPaySuccessListen implements ListenerInterface { @@ -33,6 +34,7 @@ class OrderPaySuccessListen implements ListenerInterface $orders[$order['out_trade_no']] = $order; } } + Log::info('微信支付成功回调执行队列' . var_export([$data,$groupOrder], 1)); app()->make(StoreOrderRepository::class)->paySuccess($groupOrder, $is_combine, $orders); } } diff --git a/crmeb/services/CopyProductService.php b/crmeb/services/CopyProductService.php index 671fa545..369b7b94 100644 --- a/crmeb/services/CopyProductService.php +++ b/crmeb/services/CopyProductService.php @@ -537,7 +537,6 @@ class CopyProductService $header[] = ['title' => '体积(m³)', 'slot' => 'volume', 'align' => 'center', 'minWidth' => 95]; $header[] = ['title' => '操作', 'slot' => 'action', 'align' => 'center', 'minWidth' => 70]; $info = ['attr' => $attr, 'value' => $valueNew, 'header' => $header]; - // halt($info); return $info; } } diff --git a/crmeb/services/DownloadImageService.php b/crmeb/services/DownloadImageService.php index 10b235b7..ee3ff44e 100644 --- a/crmeb/services/DownloadImageService.php +++ b/crmeb/services/DownloadImageService.php @@ -61,6 +61,7 @@ class DownloadImageService $name = $downloadImageInfo['file_name']; if (!$name) throw new ValidateException('上传图片不存在'); } + checkSuffix($url); ob_start(); readfile($url); $content = ob_get_contents(); diff --git a/crmeb/services/ExcelService.php b/crmeb/services/ExcelService.php index 97eb3dbb..0a6599b0 100644 --- a/crmeb/services/ExcelService.php +++ b/crmeb/services/ExcelService.php @@ -597,7 +597,7 @@ class ExcelService $header = ['商户名称','申请时间','转账金额','到账状态','审核状态','拒绝理由','商户余额','转账信息']; $filename = '转账记录_'.time(); $export = []; - $query = app()->make(FinancialRepository::class)->search($where)->with('merchant')->order('create_time DESC'); + $query = app()->make(FinancialRepository::class)->search($where)->with('merchant'); $count = $query->count(); $list = $query->page($page, $limit)->select(); foreach ($list as $item) { diff --git a/crmeb/services/MiniProgramService.php b/crmeb/services/MiniProgramService.php index 4f42deec..11c85288 100644 --- a/crmeb/services/MiniProgramService.php +++ b/crmeb/services/MiniProgramService.php @@ -14,6 +14,7 @@ namespace crmeb\services; +use crmeb\exceptions\WechatException; use crmeb\services\easywechat\broadcast\Client; use crmeb\services\easywechat\broadcast\ServiceProvider; use crmeb\services\easywechat\subscribe\ProgramProvider; @@ -55,6 +56,10 @@ class MiniProgramService $this->service->register(new ProgramProvider()); $this->service->register(new \crmeb\services\easywechat\certficates\ServiceProvider); $this->service->register(new \crmeb\services\easywechat\combinePay\ServiceProvider); + $this->service->register(new \crmeb\services\easywechat\msgseccheck\ServiceProvider); + $this->service->register(new \crmeb\services\easywechat\pay\ServiceProvider); + $this->service->register(new \crmeb\services\easywechat\miniPayment\ServiceProvider); + $this->service->register(new \crmeb\services\easywechat\batches\ServiceProvider); } /** @@ -75,9 +80,8 @@ class MiniProgramService public static function getConfig() { $wechat = systemConfig(['site_url', 'routine_appId', 'routine_appsecret']); - $payment = systemConfig(['pay_routine_mchid', 'pay_routine_key', 'pay_routine_client_cert', 'pay_routine_client_key', 'pay_weixin_open', - 'wechat_service_merid', 'wechat_service_key', 'wechat_service_v3key', 'wechat_service_client_cert', 'wechat_service_client_key', 'wechat_service_serial_no']); - return [ + $payment = systemConfig(['pay_routine_mchid', 'pay_routine_key', 'pay_routine_v3_key', 'pay_routine_serial_no_v3', 'pay_routine_client_cert', 'pay_routine_client_key', 'pay_weixin_open', 'wechat_service_merid', 'wechat_service_key', 'wechat_service_v3key', 'wechat_service_client_cert', 'wechat_service_client_key', 'wechat_service_serial_no','pay_routine_new_mchid']); + $config = [ 'app_id' => $wechat['routine_appId'], 'secret' => $wechat['routine_appsecret'], 'mini_program' => [ @@ -90,6 +94,8 @@ class MiniProgramService 'app_id' => $wechat['routine_appId'], 'merchant_id' => trim($payment['pay_routine_mchid']), 'key' => trim($payment['pay_routine_key']), + 'apiv3_key' => trim($payment['pay_routine_v3_key']), + 'serial_no' => trim($payment['pay_routine_serial_no_v3']), 'cert_path' => (app()->getRootPath() . 'public' . $payment['pay_routine_client_cert']), 'key_path' => (app()->getRootPath() . 'public' . $payment['pay_routine_client_key']), 'notify_url' => $wechat['site_url'] . Route::buildUrl('routineNotify')->build(), @@ -106,8 +112,22 @@ class MiniProgramService 'pay_weixin_client_key' => $payment['wechat_service_client_key'], 'serial_no' => trim($payment['wechat_service_serial_no']), 'apiv3_key' => trim($payment['wechat_service_v3key']), - ] + ], + 'pay_routine_new_mchid' => $payment['pay_routine_new_mchid'], ]; + + $config['is_v3'] = !empty($config['payment']['apiv3_key']); + return $config; + } + + public function isV3() + { + return $this->config['is_v3'] ?? false; + } + + public function v3Pay() + { + return $this->service->v3Pay; } @@ -236,16 +256,32 @@ class MiniProgramService public function paymentPrepare($openid, $out_trade_no, $total_fee, $attach, $body, $detail = '', $trade_type = 'JSAPI', $options = []) { $order = $this->paymentOrder($openid, $out_trade_no, $total_fee, $attach, $body, $detail, $trade_type, $options); - $result = $this->paymentService()->prepare($order); - if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') { - return $result->prepay_id; - } else { - if ($result->return_code == 'FAIL') { - throw new ValidateException('微信支付错误返回:' . $result->return_msg); - } else if (isset($result->err_code)) { - throw new ValidateException('微信支付错误返回:' . $result->err_code_des); + // 获取配置 判断是否为新支付 + if (isset($this->config['pay_routine_new_mchid']) && $this->config['pay_routine_new_mchid']) { + $result = $this->service->minipay->createorder($order); + if ($result->errcode === 0) { + return $result->payment_params; } else { - throw new ValidateException('没有获取微信支付的预支付ID,请重新发起支付!'); + throw new ValidateException('微信支付错误返回:' . $result->return_msg); + } + } else { + if ($this->v3Pay()) { + if ($trade_type == 'MWEB') $trade_type = 'H5'; + $payFunction = 'pay'.ucfirst($trade_type); + return $this->service->v3Pay->{$payFunction}($order); + } else { + $result = $this->paymentService()->prepare($order); + if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') { + return $result->prepay_id; + } else { + if ($result->return_code == 'FAIL') { + throw new ValidateException('微信支付错误返回:' . $result->return_msg); + } else if (isset($result->err_code)) { + throw new ValidateException('微信支付错误返回:' . $result->err_code_des); + } else { + throw new ValidateException('没有获取微信支付的预支付ID,请重新发起支付!'); + } + } } } } @@ -264,7 +300,11 @@ class MiniProgramService */ public function jsPay($openid, $out_trade_no, $total_fee, $attach, $body, $detail = '', $trade_type = 'JSAPI', $options = []) { - return $this->paymentService()->configForJSSDKPayment($this->paymentPrepare($openid, $out_trade_no, $total_fee, $attach, $body, $detail, $trade_type, $options)); + $paymentPrepare = $this->paymentPrepare($openid, $out_trade_no, $total_fee, $attach, $body, $detail, $trade_type, $options); + if ($this->isV3()) { + return $paymentPrepare; + } + return $this->paymentService()->configForJSSDKPayment($paymentPrepare); } /** @@ -279,14 +319,22 @@ class MiniProgramService * @param string $refundAccount * @return Collection|ResponseInterface */ - public function refund($orderNo, $refundNo, $totalFee, $refundFee = null, $opUserId = null, $refundReason = '', $type = 'out_trade_no', $refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS') + public function refund($orderNo, $refundNo, $totalFee, $refundFee = null, $opUserId = null, $refundReason = '', $type = 'out_trade_no', $refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS',$openId = null, $transactionId = null) { if (empty($this->config['payment']['pay_routine_client_key']) || empty($this->config['payment']['pay_routine_client_cert'])) { throw new \Exception('请配置微信支付证书'); } $totalFee = floatval($totalFee); $refundFee = floatval($refundFee); - return $this->paymentService()->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $type, $refundAccount, $refundReason); + if ($this->config['pay_routine_new_mchid']) { + return $this->service->minipay->refund($orderNo, $refundNo, $totalFee, $refundFee,$openId,$transactionId); + } else { + if ($this->isV3()) { + return $this->service->v3Pay->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $type, $refundAccount, $refundReason); + } else { + return $this->paymentService()->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $type, $refundAccount, $refundReason); + } + } } /** @@ -317,15 +365,19 @@ class MiniProgramService if (!isset($opt['pay_price'])) throw new ValidateException('缺少pay_price'); $totalFee = floatval(bcmul($opt['pay_price'], 100, 0)); $refundFee = isset($opt['refund_price']) ? floatval(bcmul($opt['refund_price'], 100, 0)) : null; - $refundReason = isset($opt['desc']) ? $opt['desc'] : ''; + $refundReason = isset($opt['refund_message']) ? $opt['refund_message'] : '无'; $refundNo = isset($opt['refund_id']) ? $opt['refund_id'] : $orderNo; $opUserId = isset($opt['op_user_id']) ? $opt['op_user_id'] : null; $type = isset($opt['type']) ? $opt['type'] : 'out_trade_no'; $refundAccount = isset($opt['refund_account']) ? $opt['refund_account'] : 'REFUND_SOURCE_UNSETTLED_FUNDS'; + $openId = $opt['open_id'] ?? null; + $transactionId = $opt['transaction_id'] ?? null; try { - $res = ($this->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $refundReason, $type, $refundAccount)); - if ($res->return_code == 'FAIL') throw new ValidateException('退款失败:' . $res->return_msg); - if (isset($res->err_code)) throw new ValidateException('退款失败:' . $res->err_code_des); + $res = ($this->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $refundReason, $type, $refundAccount, $openId, $transactionId)); + if (isset($res->return_code) && $res->return_code== 'FAIL') + throw new ValidateException('退款失败:' . $res->return_msg); + if (isset($res->err_code)) + throw new ValidateException('退款失败:' . $res->err_code_des); } catch (\Exception $e) { throw new ValidateException($e->getMessage()); } @@ -354,6 +406,21 @@ class MiniProgramService }); } + public function handleNotifyV3() + { + return $this->service->v3Pay->handleNotify(function ($notify, $successful) { + Log::info('小程序支付回调' . var_export($notify, 1)); + if (!$successful) return; + try { + event('pay_success_' . $notify['attach'], ['order_sn' => $notify['out_trade_no'], 'data' => $notify]); + } catch (\Exception $e) { + Log::info('小程序支付回调失败:' . $e->getMessage()); + return false; + } + return true; + }); + } + /** * @return easywechat\combinePay\Client */ @@ -364,7 +431,7 @@ class MiniProgramService public function handleCombinePayNotify($type) { - $this->service->combinePay->handleNotify(function ($notify, $successful) use ($type) { + return $this->service->combinePay->handleNotify(function ($notify, $successful) use ($type) { Log::info('微信支付成功回调' . var_export($notify, 1)); if (!$successful) return false; try { @@ -422,7 +489,6 @@ class MiniProgramService { try{ $res = $this->miniprogram()->now_notice->getPrivateTemplates(); - return $res; if (isset($res['errcode']) && $res['errcode'] == 0 && isset($res['priTmplId'])) { return $res['priTmplId']; } else { @@ -433,4 +499,85 @@ class MiniProgramService } } + public function msgSecCheck($userInfo,$content,$scene,$type = 0) + { + //$media_type 1:音频;2:图片 + //scene 场景枚举值(1 资料;2 评论;3 论坛;4 社交日志) + if (!in_array($scene,[1,2,3,4])) { + throw new ValidateException('使用场景类型错误'); + } + if (!isset($userInfo->wechat->routine_openid)) return ; + $openid = $userInfo->wechat->routine_openid; + if ($type) { + return $this->service->msgSec->mediaSecCheck($content,$scene,$openid,$type); + } else { + return $this->service->msgSec->msgSecCheck($content,$scene,$openid); + } + } + + /** + * TODO V3的商家到零钱 + * @author Qinii + * @day 2023/3/13 + */ + public function companyPay($data) + { + $transfer_detail_list[] = [ + 'out_detail_no' => $data['sn'], + 'transfer_amount' => $data['price'] * 100, + 'transfer_remark' => $data['mark'] ?? '', + //openid是微信用户在公众号appid下的唯一用户标识 + 'openid' => $data['openid'], + ]; + //商家到零钱 + $ret = [ + //商户系统内部的商家批次单号 + 'out_batch_no' => $data['sn'], + //该笔批量转账的名称 + 'batch_name' => $data['batch_name'], + //转账说明,UTF8编码,最多允许32个字符 + 'batch_remark' => $data['mark'] ?? '', + //转账金额单位为“分” + 'total_amount' => $data['price'] * 100, + //转账总笔数一个转账批次单最多发起三千笔转账 + 'total_num' => 1, + //该批次转账使用的转账场景,可在「商家转账到零钱 - 产品设置」中查看详情,如不填写则使用商家的默认转账场景 + 'transfer_detail_list' => $transfer_detail_list, + ]; + $result = $this->service->batches->send($ret); + return $result; + } + + /** + * TODO V2的企业到零钱 + * @param $data + * @return mixed + * @author Qinii + * @day 2023/3/13 + */ + public function merchantPay($data) + { + $ret = [ + 'partner_trade_no' => $data['sn'], //随机字符串作为订单号,跟红包和支付一个概念。 + 'openid' => $data['openid'], //收款人的openid + 'check_name' => 'NO_CHECK', //文档中有三种校验实名的方法 NO_CHECK OPTION_CHECK FORCE_CHECK + //'re_user_name'=>'张三', //OPTION_CHECK FORCE_CHECK 校验实名的时候必须提交 + 'amount' => $data['price'] * 100, //单位为分 + 'desc' => $data['mark'] ?? '', + 'spbill_create_ip' => request()->ip(), //发起交易的IP地址 + ]; + $result = $this->service->merchant_pay->send($ret); + if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') { + return $result; + } else { + if ($result->return_code == 'FAIL') { + throw new WechatException('微信支付错误返回:' . $result->return_msg); + } else if (isset($result->err_code)) { + throw new WechatException('微信支付错误返回:' . $result->err_code_des); + } else { + throw new WechatException('微信支付错误返回:' . $result->return_msg); + } + } + } + } diff --git a/crmeb/services/SmsService.php b/crmeb/services/SmsService.php index eb1b9fd4..ef0a14cf 100644 --- a/crmeb/services/SmsService.php +++ b/crmeb/services/SmsService.php @@ -121,7 +121,11 @@ class SmsService break; //用户支付成功提醒 -2.1 case 'ORDER_PAY_SUCCESS': - //not break; + $order = app()->make(StoreGroupOrderRepository::class)->get($id); + $pay_price = $order->pay_price; + $order_id = $order->group_order_sn; + self::create()->send($order->user_phone, $tempId, compact('pay_price', 'order_id')); + break; //改价提醒 -2.1 case 'PRICE_REVISION_CODE': $order = app()->make(StoreOrderRepository::class)->get($id); diff --git a/crmeb/services/WechatService.php b/crmeb/services/WechatService.php index ab6db3da..a696e5c4 100644 --- a/crmeb/services/WechatService.php +++ b/crmeb/services/WechatService.php @@ -14,6 +14,7 @@ namespace crmeb\services; +use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\store\product\ProductAssistSetRepository; use app\common\repositories\store\product\ProductGroupBuyingRepository; use app\common\repositories\store\product\ProductGroupRepository; @@ -44,6 +45,7 @@ use Exception; use Symfony\Component\HttpFoundation\Request; use think\exception\ValidateException; use think\facade\Cache; +use think\facade\Event; use think\facade\Log; use think\facade\Route; use think\Response; @@ -74,7 +76,8 @@ class WechatService $this->application->register(new \crmeb\services\easywechat\certficates\ServiceProvider()); $this->application->register(new \crmeb\services\easywechat\merchant\ServiceProvider); $this->application->register(new \crmeb\services\easywechat\combinePay\ServiceProvider); - $this->application->register(new \crmeb\services\easywechat\storePay\ServiceProvider); + $this->application->register(new \crmeb\services\easywechat\pay\ServiceProvider); + $this->application->register(new \crmeb\services\easywechat\batches\ServiceProvider); } /** @@ -94,8 +97,7 @@ class WechatService $wechat['wechat_appid'] = trim($wechat['wecaht_app_appid']); $wechat['wechat_appsecret'] = trim($wechat['wechat_app_appsecret']); } - $payment = $make->more(['site_url', 'pay_weixin_mchid', 'pay_weixin_client_cert', 'pay_weixin_client_key', 'pay_weixin_key', 'pay_weixin_open', - 'wechat_service_merid', 'wechat_service_key', 'wechat_service_v3key', 'wechat_service_client_cert', 'wechat_service_client_key', 'wechat_service_serial_no'], 0); + $payment = $make->more(['site_url', 'pay_weixin_mchid', 'pay_weixin_client_cert', 'pay_weixin_client_key', 'pay_weixin_key', 'pay_weixin_v3_key', 'pay_weixin_open','pay_wechat_serial_no_v3', 'wechat_service_merid', 'wechat_service_key', 'wechat_service_v3key', 'wechat_service_client_cert', 'wechat_service_client_key', 'wechat_service_serial_no'], 0); $config = [ 'app_id' => trim($wechat['wechat_appid']), 'secret' => trim($wechat['wechat_appsecret']), @@ -109,17 +111,24 @@ class WechatService ]; if ($wechat['wechat_encode'] > 0 && $wechat['wechat_encodingaeskey']) $config['aes_key'] = trim($wechat['wechat_encodingaeskey']); + $is_v3 = false; if (isset($payment['pay_weixin_open']) && $payment['pay_weixin_open'] == 1) { $config['payment'] = [ 'merchant_id' => trim($payment['pay_weixin_mchid']), 'key' => trim($payment['pay_weixin_key']), + 'apiv3_key' => trim($payment['pay_weixin_v3_key']), + 'serial_no' => trim($payment['pay_wechat_serial_no_v3']), 'cert_path' => (app()->getRootPath() . 'public' . $payment['pay_weixin_client_cert']), 'key_path' => (app()->getRootPath() . 'public' . $payment['pay_weixin_client_key']), 'notify_url' => $payment['site_url'] . Route::buildUrl('wechatNotify')->build(), 'pay_weixin_client_cert' => $payment['pay_weixin_client_cert'], 'pay_weixin_client_key' => $payment['pay_weixin_client_key'], ]; + if ($config['payment']['apiv3_key']) { + $is_v3 = true; + } } + $config['is_v3'] = $is_v3; $config['service_payment'] = [ 'merchant_id' => trim($payment['wechat_service_merid']), 'type' => 'wechat', @@ -144,6 +153,16 @@ class WechatService return new self(self::getConfig($isApp)); } + public function isV3() + { + return $this->config['is_v3'] ?? false; + } + + public function v3Pay() + { + return $this->application->v3Pay; + } + /** * @return Application * @author xaboy @@ -267,6 +286,30 @@ class WechatService case 'view': event('wechat.event.view', compact('message')); break; + case 'funds_order_pay': + if (($count = strpos($message['order_info']['trade_no'], '_')) !== false) { + $trade_no = substr($message['order_info']['trade_no'], $count + 1); + } else { + $trade_no = $message['order_info']['trade_no']; + } + $prefix = substr($trade_no, 0, 3); + //处理一下参数 + switch ($prefix) { + case StoreOrderRepository::TYPE_SN_ORDER: + $attach = 'order'; + break; + case StoreOrderRepository::TYPE_SN_PRESELL: + $attach = 'presell'; + break; + case StoreOrderRepository::TYPE_SN_USER_ORDER: + $attach = 'user_order'; + break; + case StoreOrderRepository::TYPE_SN_USER_RECHARGE: + $attach = 'user_recharge'; + break; + } + event('pay_success_' . $attach, ['order_sn' => $message['order_info']['trade_no'], 'data' => $message, 'is_combine' => 0]); + break; } break; case 'text': @@ -389,16 +432,22 @@ class WechatService public function paymentPrepare($openid, $out_trade_no, $total_fee, $attach, $body, $detail = '', $trade_type = 'JSAPI', $options = []) { $order = $this->paymentOrder($openid, $out_trade_no, $total_fee, $attach, $body, $detail, $trade_type, $options); - $result = $this->application->payment->prepare($order); - if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') { - return $result; + if ($this->isV3()) { + if ($trade_type == 'MWEB') $trade_type = 'H5'; + $payFunction = 'pay'.ucfirst($trade_type); + return $this->application->v3Pay->{$payFunction}($order); } else { - if ($result->return_code == 'FAIL') { - throw new WechatException('微信支付错误返回:' . $result->return_msg); - } else if (isset($result->err_code)) { - throw new WechatException('微信支付错误返回:' . $result->err_code_des); + $result = $this->application->payment->prepare($order); + if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') { + return $result; } else { - throw new WechatException('没有获取微信支付的预支付ID,请重新发起支付!'); + if ($result->return_code == 'FAIL') { + throw new WechatException('微信支付错误返回:' . $result->return_msg); + } else if (isset($result->err_code)) { + throw new WechatException('微信支付错误返回:' . $result->err_code_des); + } else { + throw new WechatException('没有获取微信支付的预支付ID,请重新发起支付!'); + } } } } @@ -447,6 +496,9 @@ class WechatService public function jsPay($openid, $out_trade_no, $total_fee, $attach, $body, $detail = '', $trade_type = 'JSAPI', $options = []) { $paymentPrepare = $this->paymentPrepare($openid, $out_trade_no, $total_fee, $attach, $body, $detail, $trade_type, $options); + if ($this->isV3()) { + return $paymentPrepare; + } return $trade_type === 'APP' ? $this->application->payment->configForAppPayment($paymentPrepare->prepay_id) : $this->application->payment->configForJSSDKPayment($paymentPrepare->prepay_id); @@ -472,7 +524,11 @@ class WechatService } $totalFee = floatval($totalFee); $refundFee = floatval($refundFee); - return $this->application->payment->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $type, $refundAccount, $refundReason); + if ($this->isV3()) { + return $this->application->v3Pay->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $type, $refundAccount, $refundReason); + } else { + return $this->application->payment->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $type, $refundAccount, $refundReason); + } } /** @@ -486,18 +542,19 @@ class WechatService if (!isset($opt['pay_price'])) throw new WechatException('缺少pay_price'); $totalFee = floatval(bcmul($opt['pay_price'], 100, 0)); $refundFee = isset($opt['refund_price']) ? floatval(bcmul($opt['refund_price'], 100, 0)) : null; - $refundReason = isset($opt['desc']) ? $opt['desc'] : ''; + $refundReason = isset($opt['refund_message']) ? $opt['refund_message'] : '无'; $refundNo = isset($opt['refund_id']) ? $opt['refund_id'] : $orderNo; $opUserId = isset($opt['op_user_id']) ? $opt['op_user_id'] : null; $type = isset($opt['type']) ? $opt['type'] : 'out_trade_no'; - /*仅针对老资金流商户使用 - REFUND_SOURCE_UNSETTLED_FUNDS---未结算资金退款(默认使用未结算资金退款) - REFUND_SOURCE_RECHARGE_FUNDS---可用余额退款*/ + + //若传递此参数则使用对应的资金账户退款,否则默认使用未结算资金退款(仅对老资金流商户适用) $refundAccount = isset($opt['refund_account']) ? $opt['refund_account'] : 'REFUND_SOURCE_UNSETTLED_FUNDS'; try { $res = ($this->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, $refundReason, $type, $refundAccount)); - if ($res->return_code == 'FAIL') throw new WechatException('退款失败:' . $res->return_msg); - if (isset($res->err_code)) throw new WechatException('退款失败:' . $res->err_code_des); + if (isset($res->return_code) && $res->return_code== 'FAIL') + throw new WechatException('退款失败:' . $res->return_msg); + if (isset($res->err_code)) + throw new WechatException('退款失败:' . $res->err_code_des); } catch (Exception $e) { throw new WechatException($e->getMessage()); } @@ -545,9 +602,24 @@ class WechatService }); } + public function handleNotifyV3() + { + return $this->application->v3Pay->handleNotify(function ($notify, $successful) { + Log::info('微信支付成功回调' . var_export($notify, 1)); + if (!$successful) return false; + try { + event('pay_success_' . $notify['attach'], ['order_sn' => $notify['out_trade_no'], 'data' => $notify, 'is_combine' => 0]); + } catch (\Exception $e) { + Log::info('微信支付回调失败:' . $e->getMessage()); + return false; + } + return true; + }); + } + public function handleCombinePayNotify($type) { - $this->application->combinePay->handleNotify(function ($notify, $successful) use ($type) { + return $this->application->combinePay->handleNotify(function ($notify, $successful) use ($type) { Log::info('微信支付成功回调' . var_export($notify, 1)); if (!$successful) return false; try { @@ -748,6 +820,46 @@ class WechatService return $this->application->storePay; } + /** + * TODO V3的商家到零钱 + * @author Qinii + * @day 2023/3/13 + */ + public function companyPay($data) + { + $transfer_detail_list[] = [ + 'out_detail_no' => $data['sn'], + 'transfer_amount' => $data['price'] * 100, + 'transfer_remark' => $data['mark'] ?? '', + //openid是微信用户在公众号appid下的唯一用户标识 + 'openid' => $data['openid'], + ]; + //商家到零钱 + $ret = [ + //商户系统内部的商家批次单号 + 'out_batch_no' => $data['sn'], + //该笔批量转账的名称 + 'batch_name' => $data['batch_name'], + //转账说明,UTF8编码,最多允许32个字符 + 'batch_remark' => $data['mark'] ?? '', + //转账金额单位为“分” + 'total_amount' => $data['price'] * 100, + //转账总笔数一个转账批次单最多发起三千笔转账 + 'total_num' => 1, + //该批次转账使用的转账场景,可在「商家转账到零钱 - 产品设置」中查看详情,如不填写则使用商家的默认转账场景 + 'transfer_detail_list' => $transfer_detail_list, + ]; + $result = $this->application->batches->send($ret); + return $result; + } + + /** + * TODO V2的企业到零钱 + * @param $data + * @return mixed + * @author Qinii + * @day 2023/3/13 + */ public function merchantPay($data) { $ret = [ @@ -756,11 +868,10 @@ class WechatService 'check_name' => 'NO_CHECK', //文档中有三种校验实名的方法 NO_CHECK OPTION_CHECK FORCE_CHECK //'re_user_name'=>'张三', //OPTION_CHECK FORCE_CHECK 校验实名的时候必须提交 'amount' => $data['price'] * 100, //单位为分 - 'desc' => '企业付款', + 'desc' => $data['mark'] ?? '', 'spbill_create_ip' => request()->ip(), //发起交易的IP地址 ]; $result = $this->application->merchant_pay->send($ret); - if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') { return $result; } else { diff --git a/crmeb/services/WechatTemplateMessageService.php b/crmeb/services/WechatTemplateMessageService.php index f7b49714..80c03412 100644 --- a/crmeb/services/WechatTemplateMessageService.php +++ b/crmeb/services/WechatTemplateMessageService.php @@ -31,6 +31,7 @@ use app\common\repositories\wechat\WechatUserRepository; use crmeb\listens\pay\UserRechargeSuccessListen; use crmeb\services\template\Template; use app\common\repositories\user\UserRepository; +use think\facade\Log; use think\facade\Route; class WechatTemplateMessageService @@ -79,6 +80,7 @@ class WechatTemplateMessageService { event('wechat.subscribeTemplate.before',compact('data')); $res = $this->subscribeTemplateMessage($data); + Log::info('订阅消息发送Data' . var_export($data, 1)); if(!$res || !is_array($res))return true; foreach($res as $item){ @@ -111,6 +113,7 @@ class WechatTemplateMessageService public function getUserOpenID($uid,$type = 'wechat') { $user = app()->make(UserRepository::class)->get($uid); + if (!$user) return null; $make = app()->make(WechatUserRepository::class); if($type == 'wechat') { return $make->idByOpenId((int)$user['wechat_user_id']); @@ -383,7 +386,7 @@ class WechatTemplateMessageService */ $res = $refund_make->get($id); if(!$res || $res['status'] != 1) return false; - $data = [ + $data[] = [ 'tempCode' => 'REFUND_SUCCESS_CODE', 'uid' => $res->uid, 'data' => [ @@ -408,7 +411,7 @@ class WechatTemplateMessageService */ $res = $refund_make->get($id); if(!$res || $res['status'] != -1) return false; - $data = [ + $data[] = [ 'tempCode' => 'REFUND_FAIL_CODE', 'uid' => $res->uid, 'data' => [ @@ -435,7 +438,7 @@ class WechatTemplateMessageService */ $res = $refund_make->get($id); if(!$res || $res['status'] != 3) return false; - $data = [ + $data[] = [ 'tempCode' => 'REFUND_CONFORM_CODE', 'uid' => $res->uid, 'data' => [ @@ -630,7 +633,6 @@ class WechatTemplateMessageService 发货时间{{time3.DATA}} 订单商品{{thing5.DATA}} */ - 'data' => [ 'character_string2' => $res->delivery_id, 'thing1' => $res->delivery_name, diff --git a/crmeb/services/delivery/storage/Uupt.php b/crmeb/services/delivery/storage/Uupt.php index a9e31114..dd7b6bcb 100644 --- a/crmeb/services/delivery/storage/Uupt.php +++ b/crmeb/services/delivery/storage/Uupt.php @@ -195,7 +195,6 @@ class Uupt extends BaseStorage implements DeliveryInterface } $str .= 'key=' . $this->config['app_key']; $str = mb_strtoupper($str, 'UTF-8'); -// halt($data,$str); return strtoupper(md5($str)); } diff --git a/crmeb/services/easywechat/BaseClient.php b/crmeb/services/easywechat/BaseClient.php index 368afaea..141e27e3 100644 --- a/crmeb/services/easywechat/BaseClient.php +++ b/crmeb/services/easywechat/BaseClient.php @@ -28,12 +28,20 @@ class BaseClient extends AbstractAPI const KEY_LENGTH_BYTE = 32; const AUTH_TAG_LENGTH_BYTE = 16; + protected $isService = true; + public function __construct(AccessToken $accessToken, $app) { parent::__construct($accessToken); $this->app = $app; } + public function setServiceStatus($val) + { + $this->isService = $val; + return $this; + } + /** * @param $api @@ -104,7 +112,7 @@ class BaseClient extends AbstractAPI ]; $options['headers'] = array_merge($headers, ($options['headers'] ?? [])); - if ($serial) $options['headers']['Wechatpay-Serial'] = $this->app->certficates->get()['serial_no']; + if ($serial) $options['headers']['Wechatpay-Serial'] = $this->app->certficates->setServiceStatus($this->isService)->get()['serial_no']; Http::setDefaultOptions($options); return $this->_doRequestCurl($method, 'https://api.mch.weixin.qq.com' . $endpoint, $options); @@ -181,7 +189,7 @@ class BaseClient extends AbstractAPI */ protected function encryptSensitiveInformation(string $string) { - $certificates = $this->app->certficates->get()['certificates']; + $certificates = $this->app->certficates->setServiceStatus($this->isService)->get()['certificates']; if (null === $certificates) { throw new InvalidConfigException('config certificate connot be empty.'); } @@ -238,7 +246,11 @@ class BaseClient extends AbstractAPI $sign = base64_encode($raw_sign); $schema = 'WECHATPAY2-SHA256-RSA2048 '; $token = sprintf('mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"', - $this->app['config']['service_payment']['merchant_id'], $nonce_str, $timestamp, $this->app['config']['service_payment']['serial_no'], $sign); + ($this->isService ? $this->app['config']['service_payment']['merchant_id'] : $this->app['config']['payment']['merchant_id']), + $nonce_str, + $timestamp, + ($this->isService ? $this->app['config']['service_payment']['serial_no'] : $this->app['config']['payment']['serial_no']), + $sign); return $schema . $token; } @@ -249,7 +261,7 @@ class BaseClient extends AbstractAPI */ protected function getPrivateKey() { - $key_path = $this->app['config']['service_payment']['key_path']; + $key_path = $this->isService ? $this->app['config']['service_payment']['key_path'] : $this->app['config']['payment']['key_path']; if (!file_exists($key_path)) { throw new \InvalidArgumentException( "SSL certificate not found: {$key_path}" @@ -270,7 +282,7 @@ class BaseClient extends AbstractAPI $ciphertext = base64_decode($encryptCertificate['ciphertext'], true); $associatedData = $encryptCertificate['associated_data']; $nonceStr = $encryptCertificate['nonce']; - $aesKey = $this->app['config']['service_payment']['apiv3_key']; + $aesKey = ($this->isService ? $this->app['config']['service_payment']['apiv3_key'] : $this->app['config']['payment']['apiv3_key']); try { // ext-sodium (default installed on >= PHP 7.2) diff --git a/crmeb/services/easywechat/batches/Client.php b/crmeb/services/easywechat/batches/Client.php new file mode 100644 index 00000000..0a820f0a --- /dev/null +++ b/crmeb/services/easywechat/batches/Client.php @@ -0,0 +1,50 @@ + +// +---------------------------------------------------------------------- + + +namespace crmeb\services\easywechat\batches; + + +use crmeb\services\easywechat\BaseClient; +use think\exception\ValidateException; + +class Client extends BaseClient +{ + protected $isService = false; + + /** + * 商家转账到零钱 + * https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_1.shtml + * @param $type + * @param array $order + * @return mixed + */ + public function send(array $order) + { + $params = [ + 'appid' => $this->app['config']['app_id'], + 'out_batch_no' => $order['out_batch_no'], + 'batch_name' => $order['batch_name'], + 'batch_remark' => $order['batch_remark'], + 'total_amount' => $order['total_amount'], + 'total_num' => $order['total_num'], + 'transfer_detail_list' => $order['transfer_detail_list'], + ]; + $content = json_encode($params, JSON_UNESCAPED_UNICODE); + + $res = $this->request('/v3/transfer/batches', 'POST', ['sign_body' => $content]); + if (isset($res['code'])) { + throw new ValidateException('微信接口报错:' . $res['message']); + } + return $res; + } + +} diff --git a/crmeb/services/easywechat/batches/ServiceProvider.php b/crmeb/services/easywechat/batches/ServiceProvider.php new file mode 100644 index 00000000..8b027417 --- /dev/null +++ b/crmeb/services/easywechat/batches/ServiceProvider.php @@ -0,0 +1,33 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace crmeb\services\easywechat\batches; + +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +/** + * Class ServiceProvider. + * + * @author ClouderSky + */ +class ServiceProvider implements ServiceProviderInterface +{ + /** + * {@inheritdoc}. + */ + public function register(Container $pimple) + { + $pimple['batches'] = function ($pimple) { + return new Client($pimple['access_token'], $pimple); + }; + } +} diff --git a/crmeb/services/easywechat/certficates/Client.php b/crmeb/services/easywechat/certficates/Client.php index 2d56de7a..494aca32 100644 --- a/crmeb/services/easywechat/certficates/Client.php +++ b/crmeb/services/easywechat/certficates/Client.php @@ -24,7 +24,7 @@ class Client extends BaseClient public function get() { $driver = Cache::store('file'); - $cacheKey = '_wx_v3' . $this->app['config']['service_payment']['serial_no']; + $cacheKey = '_wx_v3' . ($this->isService ? $this->app['config']['service_payment']['serial_no'] : $this->app['config']['payment']['serial_no']); if ($driver->has($cacheKey)) { return $driver->get($cacheKey); } diff --git a/crmeb/services/easywechat/merchant/Client.php b/crmeb/services/easywechat/merchant/Client.php index 2a557cec..050813c4 100644 --- a/crmeb/services/easywechat/merchant/Client.php +++ b/crmeb/services/easywechat/merchant/Client.php @@ -12,17 +12,6 @@ namespace crmeb\services\easywechat\merchant; use crmeb\services\easywechat\BaseClient; -use EasyWeChat\Core\AbstractAPI; -use EasyWeChat\Core\AccessToken; -use EasyWeChat\Core\Exceptions\HttpException; -use EasyWeChat\Core\Http; -use EasyWeChat\Payment\API; -use EasyWeChat\Payment\Merchant; -use GuzzleHttp\HandlerStack; -use think\Exception; -use EasyWeChat\Support\XML; -use EasyWeChat\Support\Collection; -use Psr\Http\Message\ResponseInterface; use think\exception\ValidateException; /** diff --git a/crmeb/services/easywechat/miniPayment/Client.php b/crmeb/services/easywechat/miniPayment/Client.php new file mode 100644 index 00000000..3a6bed48 --- /dev/null +++ b/crmeb/services/easywechat/miniPayment/Client.php @@ -0,0 +1,101 @@ +merchant = $merchant; + } + + /** + * 支付 + * @param array $params [ + * 'openid'=>'支付者的openid', + * 'out_trade_no'=>'商家合单支付总交易单号', + * 'total_fee'=>'支付金额', + * 'wx_out_trade_no'=>'商家交易单号', + * 'body'=>'商品描述', + * 'attach'=>'支付类型', //product 产品 member 会员 + * ] + * @param $isContract + * @return mixed + * @throws \GuzzleHttp\Exception\GuzzleException + */ + public function createorder($order) + { + $params = [ + 'openid' => $order['openid'], // 支付者的openid + 'combine_trade_no' => $order['out_trade_no'], // 商家合单支付总交易单号 + 'expire_time' => time() + $this->expire_time, + 'sub_orders' => [ + [ + 'mchid' => $this->merchant->merchant_id, + 'amount' => (int)$order['total_fee'], + 'trade_no' => $order['out_trade_no'], + 'description' => $order['body'] + ] + ] + ]; + return $this->parseJSON('post', [self::API_SET_CREATE_ORDER, json_encode($params)]); + } + + /** + * 退款 + * @param array $params [ + * 'openid'=>'退款者的openid', + * 'trade_no'=>'商家交易单号', + * 'transaction_id'=>'支付单号', + * 'refund_no'=>'商家退款单号', + * 'total_amount'=>'订单总金额', + * 'refund_amount'=>'退款金额', //product 产品 member 会员 + * ] + * @return mixed + * @throws \GuzzleHttp\Exception\GuzzleException + */ + public function refund($orderNo, $refundNo, $totalFee, $refundFee,$openId,$transactionId) + { + $params = [ + 'openid' => $openId, + 'mchid' => $this->merchant->merchant_id, + 'trade_no' => $orderNo, + 'transaction_id' => $transactionId, + 'refund_no' => $refundNo, + 'total_amount' => $totalFee, + 'refund_amount' => $refundFee, + ]; + return $this->parseJSON('post', [self::API_SET_REFUND_ORDER, json_encode($params)]); + } + + +} diff --git a/crmeb/services/easywechat/miniPayment/ServiceProvider.php b/crmeb/services/easywechat/miniPayment/ServiceProvider.php new file mode 100644 index 00000000..6b32eaa2 --- /dev/null +++ b/crmeb/services/easywechat/miniPayment/ServiceProvider.php @@ -0,0 +1,52 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace crmeb\services\easywechat\miniPayment; + +use EasyWeChat\Payment\Merchant; +use Pimple\Container; +use Pimple\ServiceProviderInterface; +use EasyWeChat\MiniProgram\AccessToken; + +/** + * Class ServiceProvider. + * + * @author mingyoung + */ +class ServiceProvider implements ServiceProviderInterface +{ + /** + * {@inheritdoc}. + */ + public function register(Container $pimple) + { + $pimple['merchant'] = function ($pimple) { + $config = array_merge( + ['app_id' => $pimple['config']['app_id']], + $pimple['config']->get('payment', []) + ); + + return new Merchant($config); + }; + + $pimple['mini_program.access_token'] = function ($pimple) { + return new AccessToken( + $pimple['config']['mini_program']['app_id'], + $pimple['config']['mini_program']['secret'], + $pimple['cache'] + ); + }; + + $pimple['minipay'] = function ($pimple) { + return new Client($pimple['mini_program.access_token'],$pimple['merchant']); + }; + } +} diff --git a/crmeb/services/easywechat/msgseccheck/Client.php b/crmeb/services/easywechat/msgseccheck/Client.php new file mode 100644 index 00000000..fe8ec3bf --- /dev/null +++ b/crmeb/services/easywechat/msgseccheck/Client.php @@ -0,0 +1,113 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace crmeb\services\easywechat\msgseccheck; + +use crmeb\services\easywechat\BaseClient; +use EasyWeChat\Core\AbstractAPI; +use EasyWeChat\Core\AccessToken; +use EasyWeChat\Core\Exceptions\HttpException; +use EasyWeChat\Core\Http; +use EasyWeChat\Payment\API; +use EasyWeChat\Payment\Merchant; +use GuzzleHttp\HandlerStack; +use think\Exception; +use EasyWeChat\Support\XML; +use EasyWeChat\Support\Collection; +use Psr\Http\Message\ResponseInterface; +use think\exception\ValidateException; + +/** + * Class Client. + * + * @author ClouderSky + */ +class Client extends BaseClient +{ + protected $isService = false; + + const MSG_API = 'https://api.weixin.qq.com/wxa/msg_sec_check?access_token='; + const MEDIA_API = 'https://api.weixin.qq.com/wxa/media_check_async?access_token='; + const LABEL = [ + 100 => '正常', + 10001 => '广告', + 20001 => '时政', + 20002 => '色情', + 20003 => '辱骂', + 20006 => '违法犯罪', + 20008 => '欺诈', + 20012 => '低俗', + 20013 => '版权', + 21000 => '其他' + ]; + + public function msgSecCheck($content, $scene, $openId) + { + $access_token = $this->accessToken->getToken(); + //scene 场景枚举值(1 资料;2 评论;3 论坛;4 社交日志) + $_url = self::MSG_API.$access_token; + $params = [ + 'content' => $content, + 'version' => (int)2, + 'scene' => (int)$scene, + 'openid' => $openId, + ]; + + try{ + $res = $this->parseJSON('json',[$_url, $params]); + if (isset($res->errcode) && $res->errcode == 0) { + if($res->result['label'] == 100) { + return true; + } else { + throw new ValidateException('内容包含:【'.self::LABEL[$res->result['label']].'】无法发布'); + } + } + }catch (Exception $exception) { + throw new ValidateException($exception->getMessage()); + } + } + + + /** + * TODO 图片或音频是异步回调,暂未使用 + * @param $media_url + * @param $scene + * @param $openId + * @param $media_type + * @return bool + * @author Qinii + * @day 2023/2/1 + */ + public function mediaSecCheck($media_url,$scene,$openId,$media_type) + { + $access_token = $this->accessToken->getToken(); + //$media_type 1:音频;2:图片 + //scene 场景枚举值(1 资料;2 评论;3 论坛;4 社交日志) + $params = [ + 'media_url' => $media_url, + 'media_type' => $media_type, + 'version' => (int)2, + 'scene' => (int)$scene, + 'openid' => $openId, + ]; + $_url = self::MEDIA_API.$access_token; + try{ + $res = $this->parseJSON('json',[$_url, $params]); + if (isset($res->errcode) && $res->errcode == 0) { + return true; + } else { + throw new ValidateException($res->errmsg); + } + }catch (Exception $exception) { + throw new ValidateException($exception->getMessage()); + } + } +} diff --git a/crmeb/services/easywechat/msgseccheck/ServiceProvider.php b/crmeb/services/easywechat/msgseccheck/ServiceProvider.php new file mode 100644 index 00000000..4655b810 --- /dev/null +++ b/crmeb/services/easywechat/msgseccheck/ServiceProvider.php @@ -0,0 +1,33 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace crmeb\services\easywechat\msgseccheck; + +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +/** + * Class ServiceProvider. + * + * @author ClouderSky + */ +class ServiceProvider implements ServiceProviderInterface +{ + /** + * {@inheritdoc}. + */ + public function register(Container $pimple) + { + $pimple['msgSec'] = function ($pimple) { + return new Client($pimple['access_token'], $pimple); + }; + } +} diff --git a/crmeb/services/easywechat/pay/Client.php b/crmeb/services/easywechat/pay/Client.php new file mode 100644 index 00000000..881b4f36 --- /dev/null +++ b/crmeb/services/easywechat/pay/Client.php @@ -0,0 +1,201 @@ + +// +---------------------------------------------------------------------- + + +namespace crmeb\services\easywechat\pay; + + +use crmeb\services\easywechat\BaseClient; +use think\exception\ValidateException; +use think\facade\Log; + +class Client extends BaseClient +{ + + protected $isService = false; + + public function handleNotify($callback) + { + $request = request(); + $success = $request->post('event_type') === 'TRANSACTION.SUCCESS'; + $data = $this->decrypt($request->post('resource', [])); + + $handleResult = call_user_func_array($callback, [json_decode($data, true), $success]); + if (is_bool($handleResult) && $handleResult) { + $response = [ + 'code' => 'SUCCESS', + 'message' => 'OK', + ]; + } else { + $response = [ + 'code' => 'FAIL', + 'message' => $handleResult, + ]; + } + + return response($response, 200, [], 'json'); + } + + public function pay($type, $order) + { + + $params = [ + 'appid' => $this->app['config']['app_id'], + 'mchid' => $this->app['config']['payment']['merchant_id'], + 'description' => $order['body'], + 'out_trade_no' => $order['out_trade_no'], + 'attach' => $order['attach'], + 'notify_url' => $this->app['config']['payment']['notify_url'], + 'amount' => [ + 'total' => intval($order['total_fee']), + 'currency' => 'CNY' + ], + 'scene_info' => [ + 'device_id' => 'shop system', + 'payer_client_ip' => request()->ip(), + ], + ]; + + if ($type === 'h5') { + $params['scene_info']['h5_info'] = [ + 'type' => $order['h5_type'] ?? 'Wap' + ]; + } + + if (isset($order['openid'])) { + $params['payer'] = [ + 'openid' => $order['openid'] + ]; + } + Log::info('微信v3支付:'.var_export($params,true)); + $content = json_encode($params, JSON_UNESCAPED_UNICODE); + + $res = $this->request('/v3/pay/transactions/' . $type, 'POST', ['sign_body' => $content]); + if (isset($res['code'])) { + throw new ValidateException('微信接口报错:' . $res['message']); + } + return $res; + } + + public function payApp($options) + { + $res = $this->pay('app', $options); + return $this->configForAppPayment($res['prepay_id']); + } + + /** + * @param string $type 场景类型,枚举值: iOS:IOS移动应用; Android:安卓移动应用; Wap:WAP网站应用 + */ + public function payH5($options, $type = 'Wap') + { + $options['h5_type'] = $type; + return $this->pay('h5', $options); + } + + public function payJsapi($options) + { + $res = $this->pay('jsapi', $options); + return $this->configForJSSDKPayment($res['prepay_id']); + } + + public function payNative($options) + { + unset($options['openid']); + return $this->pay('native', $options); + } + + public function refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId = null, $type, $refundAccount, $refundReason) + { + $params = [ + $type => $orderNo, + 'out_refund_no' => $refundNo, + 'amount' => [ + 'refund' => intval($refundFee), + 'total' => intval($totalFee), + 'currency' => 'CNY' + ] + ]; + + if (isset($refundReason)) { + $params['reason'] = $refundReason; + } +// if (isset($refundAccount)) { +// $params['refund_account'] = $refundAccount; +// } + $content = json_encode($params); + $res = $this->request('/v3/refund/domestic/refunds', 'POST', ['sign_body' => $content], true); + if (isset($res['code'])) { + throw new ValidateException('微信接口报错:' . $res['message']); + } + return $res; + } + + public function configForPayment($prepayId, $json = true) + { + $params = [ + 'appId' => $this->app['config']['app_id'], + 'timeStamp' => strval(time()), + 'nonceStr' => uniqid(), + 'package' => "prepay_id=$prepayId", + 'signType' => 'RSA', + ]; + $message = $params['appId'] . "\n" . + $params['timeStamp'] . "\n" . + $params['nonceStr'] . "\n" . + $params['package'] . "\n"; + openssl_sign($message, $raw_sign, $this->getPrivateKey(), 'sha256WithRSAEncryption'); + $sign = base64_encode($raw_sign); + + $params['paySign'] = $sign; + + return $json ? json_encode($params) : $params; + } + + /** + * Generate app payment parameters. + * + * @param string $prepayId + * + * @return array + */ + public function configForAppPayment($prepayId) + { + $params = [ + 'appid' => $this->app['config']['app_id'], + 'partnerid' => $this->app['config']['payment']['merchant_id'], + 'prepayid' => $prepayId, + 'noncestr' => uniqid(), + 'timestamp' => time(), + 'package' => 'Sign=WXPay', + ]; + $message = $params['appid'] . "\n" . + $params['timestamp'] . "\n" . + $params['noncestr'] . "\n" . + $params['prepayid'] . "\n"; + openssl_sign($message, $raw_sign, $this->getPrivateKey(), 'sha256WithRSAEncryption'); + $sign = base64_encode($raw_sign); + + $params['sign'] = $sign; + + return $params; + } + + public function configForJSSDKPayment($prepayId) + { + $config = $this->configForPayment($prepayId, false); + + $config['timestamp'] = $config['timeStamp']; + unset($config['timeStamp']); + + return $config; + } + +} diff --git a/crmeb/services/easywechat/pay/ServiceProvider.php b/crmeb/services/easywechat/pay/ServiceProvider.php new file mode 100644 index 00000000..5beeffed --- /dev/null +++ b/crmeb/services/easywechat/pay/ServiceProvider.php @@ -0,0 +1,33 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace crmeb\services\easywechat\pay; + +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +/** + * Class ServiceProvider. + * + * @author ClouderSky + */ +class ServiceProvider implements ServiceProviderInterface +{ + /** + * {@inheritdoc}. + */ + public function register(Container $pimple) + { + $pimple['v3Pay'] = function ($pimple) { + return new Client($pimple['access_token'], $pimple); + }; + } +} diff --git a/crmeb/traits/CategoresRepository.php b/crmeb/traits/CategoresRepository.php index 59f36bbc..cbf57ee3 100644 --- a/crmeb/traits/CategoresRepository.php +++ b/crmeb/traits/CategoresRepository.php @@ -138,8 +138,9 @@ trait CategoresRepository */ public function checkChildLevel(int $id,int $pid) { + //计算子集最大的数组等级 + $childLevel = max($this->dao->getChildLevelById($id)); //1 - if(!$childLevel) $childLevel = $this->dao->getLevelById($id); $changLevel = $childLevel + ($this->changeLevel($id,$pid)); //2 return $this->checkLevel($id, $changLevel); } diff --git a/crmeb/utils/Start.php b/crmeb/utils/Start.php new file mode 100644 index 00000000..be94aa58 --- /dev/null +++ b/crmeb/utils/Start.php @@ -0,0 +1,110 @@ + +// +---------------------------------------------------------------------- + +namespace crmeb\utils; + +use think\App; + +/** + * Start输出类 + * Class Json + * @package crmeb\utils + */ +class Start +{ + protected $context = ''; + const LINE = '------------------------------------------------'.PHP_EOL; + public function show() + { + $this->opCacheClear(); + $this->context = $this->logo(); + $this->context .= self::LINE; + $this->displayItem('php version', phpversion()); + $this->displayItem('swoole version', phpversion('swoole')); + $this->displayItem('swoole_loader version', phpversion('swoole_loader')); + $this->displayItem('thinkphp version', App::VERSION); + $this->displayItem('crmeb version', get_crmeb_version()); + + //http配置 + $httpConf = \config("swoole.server"); + $this->displayItem('http host', $httpConf["host"]); + $this->displayItem('http port', $httpConf["port"]); + $this->displayItem('http worker_num', $httpConf['options']["worker_num"]); + + //websocket配置 + $this->displayItem('websocket enable', \config("swoole.websocket.enable")); + + //rpc配置 + $rpcConf = \config("swoole.rpc.server"); + $this->displayItem('rpc enable', $rpcConf["enable"]); + if ($rpcConf["enable"]) { + $this->displayItem('rpc host', $rpcConf["host"]); + $this->displayItem('rpc port', $rpcConf["port"]); + $this->displayItem('rpc worker_num', $rpcConf["worker_num"]); + } + + //队列配置 + $this->displayItem('queue enable', \config("swoole.queue.enable")); + + //热更新配置 + $this->displayItem('hot_update enable', (bool)\config("swoole.hot_update.enable")); + + //debug配置 + $this->displayItem('app_debug enable', (bool)env("APP_DEBUG")); + + $this->displayItem('time', date('Y-m-d H:i:s')); + + //打印信息 + echo $this->context; + } + + + private function logo() + { + return <<context .= "\e[32m" . str_pad($name, 25, ' ', STR_PAD_RIGHT) .'| '. "\e[34m" . $value . "\e[0m \n"; + $this->context .= self::LINE; + } + + private function opCacheClear() + { + if (function_exists('apc_clear_cache')) { + apc_clear_cache(); + } + if (function_exists('opcache_reset')) { + opcache_reset(); + } + } +} diff --git a/route/admin/accounts.php b/route/admin/accounts.php index 0349f2a0..f5c4c0ec 100644 --- a/route/admin/accounts.php +++ b/route/admin/accounts.php @@ -24,11 +24,9 @@ Route::group(function () { ]); Route::get('detail/:id', '/detail')->name('systemMerchantApplymentsDetail')->option([ '_alias' => '分账商户申请详情', - ]); Route::post('status/:id', '/switchWithStatus')->name('systemMerchantApplymentsStatus')->option([ '_alias' => '分账商户申请审核', - ]); Route::get('merchant/:id', '/getMerchant')->name('systemMerchantApplymentsGet')->option([ '_alias' => '分账商户审核查询', @@ -41,7 +39,6 @@ Route::group(function () { ]); Route::post('mark/:id', '/mark')->name('systemMerchantApplymentsMarrkSave')->option([ '_alias' => '分账商户申请备注', - ]); })->prefix('admin.system.merchant.MerchantApplyments')->option([ '_path' => '/merchant/applyments', @@ -186,15 +183,12 @@ Route::group(function () { Route::group('financial_record', function () { Route::get('lst', '/getList')->name('systemFinancialRecordLst')->option([ '_alias' => '列表', - ]); Route::get('title', '/getTitle')->name('systemFinancialRecordTitle')->option([ '_alias' => '统计', - ]); Route::get('detail/:type', '/detail')->name('systemFinancialRecordDetail')->option([ '_alias' => '详情', - ]); Route::get('detail_export/:type', '/exportDetail')->name('systemFinancialRecordDetailExport')->option([ '_alias' => '导出', diff --git a/route/admin/article.php b/route/admin/article.php index e2f88c52..cf05f47e 100644 --- a/route/admin/article.php +++ b/route/admin/article.php @@ -26,11 +26,9 @@ Route::group(function () { ]); Route::get('lst', '/lst')->name('systemArticleCategoryLst')->option([ '_alias' => '文章分类列表', - ]); Route::post('create', '/create')->name('systemArticleCategoryCreate')->option([ '_alias' => '文章分类添加', - ]); Route::get('update/form/:id', '/updateForm')->name('systemArticleCategoryUpdateForm')->option([ '_alias' => '文章分类编辑表单', @@ -39,19 +37,15 @@ Route::group(function () { ]); Route::post('update/:id', '/update')->name('systemArticleCategoryUpdate')->option([ '_alias' => '文章分类编辑', - ]); Route::post('status/:id', '/switchStatus')->name('systemArticleCategoryStatus')->option([ '_alias' => '文章分类修改状态', - ]); Route::delete('delete/:id', '/delete')->name('systemArticleCategoryDelete')->option([ '_alias' => '文章分类删除', - ]); Route::get('detail/:id', '/detail')->name('systemArticleCategoryDetail')->option([ '_alias' => '文章分类详情', - ]); Route::get('select', '/select')->option([ '_alias' => '文章分类筛选', @@ -66,27 +60,21 @@ Route::group(function () { Route::group('system/article/article', function () { Route::get('lst', '/getList')->name('systemArticlArticleLst')->option([ '_alias' => '文章列表', - ]); Route::post('create', '/create')->name('systemArticleArticleCreate')->option([ '_alias' => '文章添加', - ]); Route::post('update/:id', '/update')->name('systemArticArticleleUpdate')->option([ '_alias' => '文章编辑', - ]); Route::delete('delete/:id', '/delete')->name('systemArticArticleleDelete')->option([ '_alias' => '文章删除', - ]); Route::get('detail/:id', '/detail')->name('systemArticArticleleDetail')->option([ '_alias' => '文章详情', - ]); Route::post('status/:id', '/switchStatus')->name('systemArticlArticlStatus')->option([ '_alias' => '文章修改状态', - ]); })->prefix('admin.article.Article')->option([ '_path' => '/cms/article', diff --git a/route/admin/attachment.php b/route/admin/attachment.php index 1502e878..ff2cd438 100644 --- a/route/admin/attachment.php +++ b/route/admin/attachment.php @@ -21,7 +21,6 @@ Route::group(function () { Route::group('system/attachment/category', function () { Route::get('formatLst', '/getFormatList')->name('systemAttachmentCategoryGetFormatList')->option([ '_alias' => '素材分类列表', - ]); Route::get('create/form', '/createForm')->name('systemAttachmentCategoryCreateForm')->option([ '_alias' => '素材分类添加表单', @@ -35,15 +34,12 @@ Route::group(function () { ]); Route::post('create', '/create')->name('systemAttachmentCategoryCreate')->option([ '_alias' => '素材分类添加', - ]); Route::post('update/:id', '/update')->name('systemAttachmentCategoryUpdate')->option([ '_alias' => '素材编辑', - ]); Route::delete('delete/:id', '/delete')->name('systemAttachmentCategoryDelete')->option([ '_alias' => '素材删除', - ]); })->prefix('admin.system.attachment.AttachmentCategory')->option([ '_path' => '/config/picture', @@ -53,15 +49,12 @@ Route::group(function () { Route::group('system/attachment', function () { Route::get('lst', '/getList')->name('systemAttachmentLst')->option([ '_alias' => '素材列表', - ]); Route::delete('delete', '/delete')->name('systemAttachmentDelete')->option([ '_alias' => '素材删除', - ]); Route::post('category', '/batchChangeCategory')->name('systemAttachmentBatchChangeCategory')->option([ '_alias' => '批量移动', - ]); Route::get('update/:id/form', '/updateForm')->name('systemAttachmentUpdateForm')->option([ '_alias' => '素材编辑表单', @@ -70,7 +63,6 @@ Route::group(function () { ]); Route::post('update/:id', '/update')->name('systemAttachmentUpdate')->option([ '_alias' => '素材编辑', - ]); })->prefix('admin.system.attachment.Attachment')->option([ '_path' => '/config/picture', diff --git a/route/admin/order.php b/route/admin/order.php index e7d47bf5..82dc3bda 100644 --- a/route/admin/order.php +++ b/route/admin/order.php @@ -39,6 +39,9 @@ Route::group(function () { Route::get('status/:id', 'Order/status')->name('systemOrderStatus')->option([ '_alias' => '记录', ]); + Route::get('children/:id', 'Order/childrenList')->name('systemOrderChildrenList')->option([ + '_alias' => '关联订单', + ]); })->prefix('admin.order.')->option([ '_path' => '/order/list', '_auth' => true, diff --git a/route/admin/wechat.php b/route/admin/wechat.php index 33c0ea91..869c6ab2 100644 --- a/route/admin/wechat.php +++ b/route/admin/wechat.php @@ -177,11 +177,11 @@ Route::group(function () { //小程序订阅消息 Route::group('wechat/template/min', function () { - Route::get('sync', '/sync')->name('systemTemplateMessageSync')->append(['type' => 0])->option([ + Route::get('/sync', '/sync')->name('systemTemplateMessageMinSync')->append(['type' => 0])->option([ '_alias' => '同步', ]); Route::get('lst', '/minList')->name('systemTemplateMessageMinList')->option([ - '_alias' => '列表', + '_alias' => '列表 ', ]); Route::get('create/form', '/createMinform')->name('systemTemplateMessageMinCreateForm')->option([ '_alias' => '添加表单', diff --git a/route/api.php b/route/api.php index 191bfc87..ef867c5c 100644 --- a/route/api.php +++ b/route/api.php @@ -129,7 +129,7 @@ Route::group('api/', function () { Route::post('/relation/create', 'UserRelation/create'); Route::post('/relation/batch/create', 'UserRelation/batchCreate'); Route::post('/relation/delete', 'UserRelation/delete'); - Route::post('/relation/lst/delete', 'UserRelation/lstDelete'); + Route::post('/relation/batch/delete', 'UserRelation/batchDelete'); //反馈 Route::post('/feedback', 'Feedback/feedback'); @@ -155,6 +155,7 @@ Route::group('api/', function () { Route::get('/extract/lst', 'UserExtract/lst'); Route::get('/extract/banklst', 'UserExtract/bankLst'); Route::post('/extract/create', 'UserExtract/create'); + Route::get('/extract/history_bank', 'UserExtract/historyBank'); //绑定手机号 Route::post('binding', 'User/binding'); @@ -359,7 +360,9 @@ Route::group('api/', function () { Route::get('order/:id', 'Community/getSpuByOrder'); Route::get('qrcode/:id', 'Community/qrcode'); + })->prefix('api.community.'); + Route::group('svip', function () { //价格列表 Route::post('pay/:id', '/createOrder')->middleware(\app\common\middleware\BlockerMiddleware::class); @@ -410,7 +413,7 @@ Route::group('api/', function () { Route::get('service/info/:id', 'api.store.service.Service/merchantInfo'); //公共配置 Route::get('config', 'api.Common/config'); - + Route::get('has_service/:id','api.store.service.Service/hasService'); //专题 Route::group('activity', function () { Route::get('lst/:id', 'api.Common/activityLst'); diff --git a/route/merchant/order.php b/route/merchant/order.php index 71f5c900..d66feac4 100644 --- a/route/merchant/order.php +++ b/route/merchant/order.php @@ -102,7 +102,9 @@ Route::group(function () { Route::post('delete/:id', 'Order/delete')->name('merchantStoreOrderDelete')->option([ '_alias' => '删除', ]); - + Route::get('children/:id', 'Order/childrenList')->name('merchantStoreOrderChildrenList')->option([ + '_alias' => '关联订单', + ]); })->prefix('merchant.store.order.')->option([ '_path' => '/order/list', '_auth' => true, @@ -119,7 +121,6 @@ Route::group(function () { '_alias' => '导出下载', '_auth' => true, ], - ] ]); diff --git a/route/merchant/system.php b/route/merchant/system.php index c5db92ba..b6a09d31 100644 --- a/route/merchant/system.php +++ b/route/merchant/system.php @@ -17,26 +17,7 @@ use app\common\middleware\MerchantCheckBaseInfoMiddleware; Route::group(function () { - //导出文件 - Route::group('excel',function(){ - Route::get('/lst', '/lst')->name('merchantStoreExcelLst')->option([ - '_alias' => '列表', - ]); - Route::get('/download/:id', '/download')->name('merchantStoreExcelDownload')->option([ - '_alias' => '下载', - ]); - Route::get('/download_express', '/downloadExpress')->name('merchantStoreExcelDownloadExpress')->option([ - '_alias' => '下载快递公司', - ]); - Route::get('/type', '/type')->name('merchantStoreExcelType')->option([ - '_alias' => '文件类型', - '_auth' => false, - ]); - })->prefix('merchant.store.Excel')->option([ - '_path' => '/export/list', - '_auth' => true, - ]); - + Route::get('excel/download/express', 'merchant.store.Excel/downloadExpress'); //打印机 Route::group('store/printer', function () { //lst diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index a8b98d5c..c2c80a60 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,7 +4,7 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70205)) { +if (!(PHP_VERSION_ID >= 70105)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; } diff --git a/vendor/guzzlehttp/command/LICENSE b/vendor/guzzlehttp/command/LICENSE new file mode 100644 index 00000000..581d95f9 --- /dev/null +++ b/vendor/guzzlehttp/command/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling + +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. diff --git a/vendor/guzzlehttp/command/README.md b/vendor/guzzlehttp/command/README.md new file mode 100644 index 00000000..e68772ce --- /dev/null +++ b/vendor/guzzlehttp/command/README.md @@ -0,0 +1,134 @@ +# Guzzle Commands + +[![License](https://poser.pugx.org/guzzlehttp/command/license)](https://packagist.org/packages/guzzlehttp/command) +[![Build Status](https://travis-ci.org/guzzle/command.svg?branch=master)](https://travis-ci.org/guzzle/command) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/guzzle/command/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/guzzle/command/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/guzzle/command/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/guzzle/command/?branch=master) +[![SensioLabsInsight](https://insight.sensiolabs.com/projects/7a93338e-50cd-42f7-9299-17c44d92148f/mini.png)](https://insight.sensiolabs.com/projects/7a93338e-50cd-42f7-9299-17c44d92148f) +[![Latest Stable Version](https://poser.pugx.org/guzzlehttp/command/v/stable)](https://packagist.org/packages/guzzlehttp/command) +[![Latest Unstable Version](https://poser.pugx.org/guzzlehttp/command/v/unstable)](https://packagist.org/packages/guzzlehttp/command) +[![Total Downloads](https://poser.pugx.org/guzzlehttp/command/downloads)](https://packagist.org/packages/guzzlehttp/command) + +This library uses Guzzle (``guzzlehttp/guzzle``, version 6.x) 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: + +``composer require guzzlehttp/command`` + +For **Guzzle 5**, use ``composer require guzzlehttp/command:0.8.*``. The source +code for the Guzzle 5 version is available on the +`0.8 branch `_. + +**Note:** If Composer is not +`installed 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``. + +## Service Clients + +Service Clients are web service clients that implement the +``GuzzleHttp\Command\ServiceClientInterface`` and use an underlying Guzzle HTTP +client (``GuzzleHttp\Client``) 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 + +@TODO Add documentation + +* ``ServiceClient``'s constructor +* Transformer functions (``$commandToRequestTransformer`` and ``$responseToResultTransformer``) +* The ``HandlerStack`` + +## 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 a ``GuzzleHttp\Command\ResultInterface`` +object. 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. + +## Todo + +* Middleware system and command vs request layers +* The ``HandlerStack`` diff --git a/vendor/guzzlehttp/command/composer.json b/vendor/guzzlehttp/command/composer.json new file mode 100644 index 00000000..3886e324 --- /dev/null +++ b/vendor/guzzlehttp/command/composer.json @@ -0,0 +1,36 @@ +{ + "name": "guzzlehttp/command", + "description": "Provides the foundation for building command-based web service clients", + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + } + ], + "require": { + "php": ">=5.5.0", + "guzzlehttp/guzzle": "^6.2", + "guzzlehttp/promises": "~1.3", + "guzzlehttp/psr7": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Command\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "0.9-dev" + } + } +} diff --git a/vendor/guzzlehttp/command/src/Command.php b/vendor/guzzlehttp/command/src/Command.php new file mode 100644 index 00000000..cff70a2b --- /dev/null +++ b/vendor/guzzlehttp/command/src/Command.php @@ -0,0 +1,55 @@ +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; + } + } +} diff --git a/vendor/guzzlehttp/command/src/CommandInterface.php b/vendor/guzzlehttp/command/src/CommandInterface.php new file mode 100644 index 00000000..5d23c993 --- /dev/null +++ b/vendor/guzzlehttp/command/src/CommandInterface.php @@ -0,0 +1,39 @@ +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; + } +} diff --git a/vendor/guzzlehttp/command/src/Exception/CommandServerException.php b/vendor/guzzlehttp/command/src/Exception/CommandServerException.php new file mode 100644 index 00000000..22356b52 --- /dev/null +++ b/vendor/guzzlehttp/command/src/Exception/CommandServerException.php @@ -0,0 +1,7 @@ +data; + } + + public function offsetExists($offset) + { + return array_key_exists($offset, $this->data); + } + + public function offsetGet($offset) + { + return isset($this->data[$offset]) ? $this->data[$offset] : null; + } + + public function offsetSet($offset, $value) + { + $this->data[$offset] = $value; + } + + public function offsetUnset($offset) + { + unset($this->data[$offset]); + } + + public function count() + { + return count($this->data); + } + + public function getIterator() + { + return new \ArrayIterator($this->data); + } + + public function toArray() + { + return $this->data; + } +} diff --git a/vendor/guzzlehttp/command/src/Result.php b/vendor/guzzlehttp/command/src/Result.php new file mode 100644 index 00000000..3041caf2 --- /dev/null +++ b/vendor/guzzlehttp/command/src/Result.php @@ -0,0 +1,18 @@ +data = $data; + } +} diff --git a/vendor/guzzlehttp/command/src/ResultInterface.php b/vendor/guzzlehttp/command/src/ResultInterface.php new file mode 100644 index 00000000..4ae49a8d --- /dev/null +++ b/vendor/guzzlehttp/command/src/ResultInterface.php @@ -0,0 +1,9 @@ +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 = Promise\iter_for($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 Promise\coroutine(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); + } +} diff --git a/vendor/guzzlehttp/command/src/ServiceClientInterface.php b/vendor/guzzlehttp/command/src/ServiceClientInterface.php new file mode 100644 index 00000000..1f418377 --- /dev/null +++ b/vendor/guzzlehttp/command/src/ServiceClientInterface.php @@ -0,0 +1,92 @@ +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)* \ No newline at end of file diff --git a/vendor/guzzlehttp/guzzle-services/LICENSE b/vendor/guzzlehttp/guzzle-services/LICENSE new file mode 100644 index 00000000..71d3b783 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling + +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. diff --git a/vendor/guzzlehttp/guzzle-services/Makefile b/vendor/guzzlehttp/guzzle-services/Makefile new file mode 100644 index 00000000..cfb82e45 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/Makefile @@ -0,0 +1,15 @@ +all: clean test + +test: + vendor/bin/phpunit + +coverage: + vendor/bin/phpunit --coverage-html=artifacts/coverage + +view-coverage: + open artifacts/coverage/index.html + +clean: + rm -rf artifacts/* + +.PHONY: coverage diff --git a/vendor/guzzlehttp/guzzle-services/README.md b/vendor/guzzlehttp/guzzle-services/README.md new file mode 100644 index 00000000..196c8a9b --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/README.md @@ -0,0 +1,129 @@ +# Guzzle Services + +[![License](https://poser.pugx.org/guzzlehttp/guzzle-services/license)](https://packagist.org/packages/guzzlehttp/guzzle-services) +[![Build Status](https://travis-ci.org/guzzle/guzzle-services.svg?branch=master)](https://travis-ci.org/guzzle/guzzle-services) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/guzzle/guzzle-services/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/guzzle/guzzle-services/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/guzzle/guzzle-services/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/guzzle/guzzle-services/?branch=master) +[![SensioLabsInsight](https://insight.sensiolabs.com/projects/b08be676-b209-40b7-a6df-b6d13e8dff62/mini.png)](https://insight.sensiolabs.com/projects/b08be676-b209-40b7-a6df-b6d13e8dff62) +[![Latest Stable Version](https://poser.pugx.org/guzzlehttp/guzzle-services/v/stable)](https://packagist.org/packages/guzzlehttp/guzzle-services) +[![Latest Unstable Version](https://poser.pugx.org/guzzlehttp/guzzle-services/v/unstable)](https://packagist.org/packages/guzzlehttp/guzzle-services) +[![Total Downloads](https://poser.pugx.org/guzzlehttp/guzzle-services/downloads)](https://packagist.org/packages/guzzlehttp/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. \ No newline at end of file diff --git a/vendor/guzzlehttp/guzzle-services/composer.json b/vendor/guzzlehttp/guzzle-services/composer.json new file mode 100644 index 00000000..645e44b2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/composer.json @@ -0,0 +1,49 @@ +{ + "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.", + "type": "library", + "license": "MIT", + "authors": [ + { + "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": "Stefano Kowalke", + "email": "blueduck@mail.org", + "homepage": "https://github.com/konafets" + } + ], + "require": { + "php": ">=5.5", + "guzzlehttp/guzzle": "^6.2", + "guzzlehttp/command": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "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.0.x-dev" + } + } +} diff --git a/vendor/guzzlehttp/guzzle-services/phpunit.xml.dist b/vendor/guzzlehttp/guzzle-services/phpunit.xml.dist new file mode 100644 index 00000000..994e1584 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/phpunit.xml.dist @@ -0,0 +1,14 @@ + + + + + tests + + + + + src + + + diff --git a/vendor/guzzlehttp/guzzle-services/src/Description.php b/vendor/guzzlehttp/guzzle-services/src/Description.php new file mode 100644 index 00000000..b8d060ea --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/Description.php @@ -0,0 +1,265 @@ +{$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; + } + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/DescriptionInterface.php b/vendor/guzzlehttp/guzzle-services/src/DescriptionInterface.php new file mode 100644 index 00000000..6b3adba6 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/DescriptionInterface.php @@ -0,0 +1,107 @@ + 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. + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/GuzzleClient.php b/vendor/guzzlehttp/guzzle-services/src/GuzzleClient.php new file mode 100644 index 00000000..f419b54e --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/GuzzleClient.php @@ -0,0 +1,169 @@ +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. + } + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/Handler/ValidatedDescriptionHandler.php b/vendor/guzzlehttp/guzzle-services/src/Handler/ValidatedDescriptionHandler.php new file mode 100644 index 00000000..c5ec2d6e --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/Handler/ValidatedDescriptionHandler.php @@ -0,0 +1,82 @@ + + */ +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); + }; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/Operation.php b/vendor/guzzlehttp/guzzle-services/src/Operation.php new file mode 100644 index 00000000..57b75ca2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/Operation.php @@ -0,0 +1,312 @@ + '', + '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']; + } + } + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/Parameter.php b/vendor/guzzlehttp/guzzle-services/src/Parameter.php new file mode 100644 index 00000000..8b3c39f2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/Parameter.php @@ -0,0 +1,655 @@ +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}); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php b/vendor/guzzlehttp/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php new file mode 100644 index 00000000..ad7fb113 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php @@ -0,0 +1,13 @@ +removeNumericIndices = $removeNumericIndices; + } + + /** + * {@inheritDoc} + */ + public function aggregate(array $queryParams) + { + $queryString = http_build_query($queryParams, null, '&', PHP_QUERY_RFC3986); + + if ($this->removeNumericIndices) { + $queryString = preg_replace('/%5B[0-9]+%5D/simU', '%5B%5D', $queryString); + } + + return $queryString; + } +} \ No newline at end of file diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/AbstractLocation.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/AbstractLocation.php new file mode 100644 index 00000000..29b484b0 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/AbstractLocation.php @@ -0,0 +1,101 @@ +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); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/BodyLocation.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/BodyLocation.php new file mode 100644 index 00000000..aef4eb00 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/BodyLocation.php @@ -0,0 +1,49 @@ +getBody()->getContents(); + + $value = $command[$param->getName()]; + $value = $param->getName() . '=' . $param->filter($value); + + if ($oldValue !== '') { + $value = $oldValue . '&' . $value; + } + + return $request->withBody(Psr7\stream_for($value)); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/FormParamLocation.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/FormParamLocation.php new file mode 100644 index 00000000..83005366 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/FormParamLocation.php @@ -0,0 +1,84 @@ +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\stream_for($body); + $modify['set_headers']['Content-Type'] = $this->contentType; + $request = Psr7\modify_request($request, $modify); + + return $request; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/HeaderLocation.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/HeaderLocation.php new file mode 100644 index 00000000..cb067c46 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/HeaderLocation.php @@ -0,0 +1,67 @@ +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; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/JsonLocation.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/JsonLocation.php new file mode 100644 index 00000000..f3a2a52a --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/JsonLocation.php @@ -0,0 +1,85 @@ +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\stream_for(\GuzzleHttp\json_encode($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\stream_for(\GuzzleHttp\json_encode($data))); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/MultiPartLocation.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/MultiPartLocation.php new file mode 100644 index 00000000..7bde5db4 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/MultiPartLocation.php @@ -0,0 +1,76 @@ +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\stream_for($body); + $request = Psr7\modify_request($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; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/QueryLocation.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/QueryLocation.php new file mode 100644 index 00000000..1e7a342f --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/QueryLocation.php @@ -0,0 +1,92 @@ +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\parse_query($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\parse_query($uri->getQuery()); + + $query[$key] = $this->prepareValue( + $value, + $additional + ); + + $uri = $uri->withQuery($this->querySerializer->aggregate($query)); + $request = $request->withUri($uri); + } + } + } + + return $request; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/RequestLocation/RequestLocationInterface.php b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/RequestLocationInterface.php new file mode 100644 index 00000000..c0350ff3 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/RequestLocation/RequestLocationInterface.php @@ -0,0 +1,44 @@ +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\stream_for($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); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/AbstractLocation.php b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/AbstractLocation.php new file mode 100644 index 00000000..97adc72f --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/AbstractLocation.php @@ -0,0 +1,69 @@ +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; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/BodyLocation.php b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/BodyLocation.php new file mode 100644 index 00000000..f21d60a8 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/BodyLocation.php @@ -0,0 +1,39 @@ +getName()] = $param->filter($response->getBody()); + + return $result; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/HeaderLocation.php b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/HeaderLocation.php new file mode 100644 index 00000000..d156aff1 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/HeaderLocation.php @@ -0,0 +1,47 @@ +getName(); + if ($header = $response->getHeader($param->getWireName())) { + if (is_array($header)) { + $header = array_shift($header); + } + $result[$name] = $param->filter($header); + } + + return $result; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/JsonLocation.php b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/JsonLocation.php new file mode 100644 index 00000000..f94c7844 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/JsonLocation.php @@ -0,0 +1,176 @@ +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); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ReasonPhraseLocation.php b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ReasonPhraseLocation.php new file mode 100644 index 00000000..1cb590ff --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ReasonPhraseLocation.php @@ -0,0 +1,41 @@ +getName()] = $param->filter( + $response->getReasonPhrase() + ); + + return $result; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ResponseLocationInterface.php b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ResponseLocationInterface.php new file mode 100644 index 00000000..8669dff8 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ResponseLocationInterface.php @@ -0,0 +1,61 @@ +getName()] = $param->filter($response->getStatusCode()); + + return $result; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/XmlLocation.php b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/XmlLocation.php new file mode 100644 index 00000000..94509098 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/XmlLocation.php @@ -0,0 +1,311 @@ +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. ) + $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; + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/SchemaFormatter.php b/vendor/guzzlehttp/guzzle-services/src/SchemaFormatter.php new file mode 100644 index 00000000..34f7a884 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/SchemaFormatter.php @@ -0,0 +1,141 @@ +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'); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php b/vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php new file mode 100644 index 00000000..4a2833f3 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php @@ -0,0 +1,297 @@ +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); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/src/Serializer.php b/vendor/guzzlehttp/guzzle-services/src/Serializer.php new file mode 100644 index 00000000..160fbc25 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/src/Serializer.php @@ -0,0 +1,164 @@ + 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(), + $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 = \GuzzleHttp\uri_template($operation->getUri(), $variables); + + return new Request( + $operation->getHttpMethod(), + Uri::resolve($this->description->getBaseUri(), $uri) + ); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/Asset/Exception/CustomCommandException.php b/vendor/guzzlehttp/guzzle-services/tests/Asset/Exception/CustomCommandException.php new file mode 100644 index 00000000..f9dfe6dd --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/Asset/Exception/CustomCommandException.php @@ -0,0 +1,13 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/vendor/guzzlehttp/guzzle-services/tests/DescriptionTest.php b/vendor/guzzlehttp/guzzle-services/tests/DescriptionTest.php new file mode 100644 index 00000000..9f73cf3d --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/DescriptionTest.php @@ -0,0 +1,184 @@ +operations = [ + 'test_command' => [ + 'name' => 'test_command', + 'description' => 'documentationForCommand', + 'httpMethod' => 'DELETE', + 'class' => 'FooModel', + 'parameters' => [ + 'bucket' => ['required' => true], + 'key' => ['required' => true] + ] + ] + ]; + } + + public function testConstructor() + { + $service = new Description(['operations' => $this->operations]); + $this->assertEquals(1, count($service->getOperations())); + $this->assertFalse($service->hasOperation('foobar')); + $this->assertTrue($service->hasOperation('test_command')); + } + + public function testContainsModels() + { + $d = new Description([ + 'operations' => ['foo' => []], + 'models' => [ + 'Tag' => ['type' => 'object'], + 'Person' => ['type' => 'object'] + ] + ]); + $this->assertTrue($d->hasModel('Tag')); + $this->assertTrue($d->hasModel('Person')); + $this->assertFalse($d->hasModel('Foo')); + $this->assertInstanceOf(Parameter::class, $d->getModel('Tag')); + $this->assertEquals(['Tag', 'Person'], array_keys($d->getModels())); + } + + public function testCanUseResponseClass() + { + $d = new Description([ + 'operations' => [ + 'foo' => ['responseClass' => 'Tag'] + ], + 'models' => ['Tag' => ['type' => 'object']] + ]); + $op = $d->getOperation('foo'); + $this->assertNotNull($op->getResponseModel()); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testRetrievingMissingModelThrowsException() + { + $d = new Description([]); + $d->getModel('foo'); + } + + public function testHasAttributes() + { + $d = new Description([ + 'operations' => [], + 'name' => 'Name', + 'description' => 'Description', + 'apiVersion' => '1.24' + ]); + + $this->assertEquals('Name', $d->getName()); + $this->assertEquals('Description', $d->getDescription()); + $this->assertEquals('1.24', $d->getApiVersion()); + } + + public function testPersistsCustomAttributes() + { + $data = [ + 'operations' => ['foo' => ['class' => 'foo', 'parameters' => []]], + 'name' => 'Name', + 'description' => 'Test', + 'apiVersion' => '1.24', + 'auth' => 'foo', + 'keyParam' => 'bar' + ]; + $d = new Description($data); + $this->assertEquals('foo', $d->getData('auth')); + $this->assertEquals('bar', $d->getData('keyParam')); + $this->assertEquals(['auth' => 'foo', 'keyParam' => 'bar'], $d->getData()); + $this->assertNull($d->getData('missing')); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testThrowsExceptionForMissingOperation() + { + $s = new Description([]); + $this->assertNull($s->getOperation('foo')); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testValidatesOperationTypes() + { + new Description([ + 'operations' => ['foo' => new \stdClass()] + ]); + } + + public function testHasbaseUrl() + { + $description = new Description(['baseUrl' => 'http://foo.com']); + $this->assertEquals('http://foo.com', $description->getBaseUri()); + } + + public function testHasbaseUri() + { + $description = new Description(['baseUri' => 'http://foo.com']); + $this->assertEquals('http://foo.com', $description->getBaseUri()); + } + + public function testModelsHaveNames() + { + $desc = [ + 'models' => [ + 'date' => ['type' => 'string'], + 'user'=> [ + 'type' => 'object', + 'properties' => [ + 'dob' => ['$ref' => 'date'] + ] + ] + ] + ]; + + $s = new Description($desc); + $this->assertEquals('string', $s->getModel('date')->getType()); + $this->assertEquals('dob', $s->getModel('user')->getProperty('dob')->getName()); + } + + public function testHasOperations() + { + $desc = ['operations' => ['foo' => ['parameters' => ['foo' => [ + 'name' => 'foo' + ]]]]]; + $s = new Description($desc); + $this->assertInstanceOf(Operation::class, $s->getOperation('foo')); + $this->assertSame($s->getOperation('foo'), $s->getOperation('foo')); + } + + public function testHasFormatter() + { + $s = new Description([]); + $this->assertNotEmpty($s->format('date', 'now')); + } + + public function testCanUseCustomFormatter() + { + $formatter = $this->getMockBuilder(SchemaFormatter::class) + ->setMethods(['format']) + ->getMock(); + $formatter->expects($this->once()) + ->method('format'); + $s = new Description([], ['formatter' => $formatter]); + $s->format('time', 'now'); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/DeserializerTest.php b/vendor/guzzlehttp/guzzle-services/tests/DeserializerTest.php new file mode 100644 index 00000000..a44f9802 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/DeserializerTest.php @@ -0,0 +1,386 @@ +serviceClient = $this->getMockBuilder(GuzzleClient::class) + ->disableOriginalConstructor() + ->getMock(); + $this->command = $this->getMockBuilder(CommandInterface::class)->getMock(); + } + + protected function prepareErrorResponses($commandName, array $errors = []) + { + $this->command->expects($this->once())->method('getName')->will($this->returnValue($commandName)); + + $description = $this->getMockBuilder(DescriptionInterface::class)->getMock(); + $operation = new Operation(['errorResponses' => $errors], $description); + + $description->expects($this->once()) + ->method('getOperation') + ->with($commandName) + ->will($this->returnValue($operation)); + + $this->serviceClient->expects($this->once()) + ->method('getDescription') + ->will($this->returnValue($description)); + } + + public function testDoNothingIfNoException() + { + $mock = new MockHandler([new Response(200)]); + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org/{foo}', + 'httpMethod' => 'GET', + 'responseModel' => 'j', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => true, + 'location' => 'uri' + ] + ] + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object' + ] + ] + ]); + $httpClient = new HttpClient(['handler' => $mock]); + $client = new GuzzleClient($httpClient, $description); + $client->foo(['bar' => 'baz']); + } + + /** + * @expectedException \GuzzleHttp\Tests\Command\Guzzle\Asset\Exception\CustomCommandException + */ + public function testCreateExceptionWithCode() + { + $response = new Response(404); + $mock = new MockHandler([$response]); + + $description = new Description([ + 'name' => 'Test API', + 'baseUri' => 'http://httpbin.org', + 'operations' => [ + 'foo' => [ + 'uri' => '/{foo}', + 'httpMethod' => 'GET', + 'responseClass' => 'Foo', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'Unique user name (alphanumeric)', + 'location' => 'json' + ], + ], + 'errorResponses' => [ + ['code' => 404, 'class' => CustomCommandException::class] + ] + ] + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'location' => 'json' + ] + ] + ] + ]); + + $httpClient = new HttpClient(['handler' => $mock]); + $client = new GuzzleClient($httpClient, $description); + $client->foo(['bar' => 'baz']); + } + + public function testNotCreateExceptionIfDoesNotMatchCode() + { + $response = new Response(401); + $mock = new MockHandler([$response]); + + $description = new Description([ + 'name' => 'Test API', + 'baseUri' => 'http://httpbin.org', + 'operations' => [ + 'foo' => [ + 'uri' => '/{foo}', + 'httpMethod' => 'GET', + 'responseClass' => 'Foo', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'Unique user name (alphanumeric)', + 'location' => 'json' + ], + ], + 'errorResponses' => [ + ['code' => 404, 'class' => CustomCommandException::class] + ] + ] + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'location' => 'json' + ] + ] + ] + ]); + + $httpClient = new HttpClient(['handler' => $mock]); + $client = new GuzzleClient($httpClient, $description); + $client->foo(['bar' => 'baz']); + } + + /** + * @expectedException \GuzzleHttp\Tests\Command\Guzzle\Asset\Exception\CustomCommandException + */ + public function testCreateExceptionWithExactMatchOfReasonPhrase() + { + $response = new Response(404, [], null, '1.1', 'Bar'); + $mock = new MockHandler([$response]); + + $description = new Description([ + 'name' => 'Test API', + 'baseUri' => 'http://httpbin.org', + 'operations' => [ + 'foo' => [ + 'uri' => '/{foo}', + 'httpMethod' => 'GET', + 'responseClass' => 'Foo', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'Unique user name (alphanumeric)', + 'location' => 'json' + ], + ], + 'errorResponses' => [ + ['code' => 404, 'phrase' => 'Bar', 'class' => CustomCommandException::class] + ] + ] + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'location' => 'json' + ] + ] + ] + ]); + + $httpClient = new HttpClient(['handler' => $mock]); + $client = new GuzzleClient($httpClient, $description); + $client->foo(['bar' => 'baz']); + } + + /** + * @expectedException \GuzzleHttp\Tests\Command\Guzzle\Asset\Exception\OtherCustomCommandException + */ + public function testFavourMostPreciseMatch() + { + $response = new Response(404, [], null, '1.1', 'Bar'); + $mock = new MockHandler([$response]); + + $description = new Description([ + 'name' => 'Test API', + 'baseUri' => 'http://httpbin.org', + 'operations' => [ + 'foo' => [ + 'uri' => '/{foo}', + 'httpMethod' => 'GET', + 'responseClass' => 'Foo', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'Unique user name (alphanumeric)', + 'location' => 'json' + ], + ], + 'errorResponses' => [ + ['code' => 404, 'class' => CustomCommandException::class], + ['code' => 404, 'phrase' => 'Bar', 'class' => OtherCustomCommandException::class], + ] + ] + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'location' => 'json' + ] + ] + ] + ]); + + $httpClient = new HttpClient(['handler' => $mock]); + $client = new GuzzleClient($httpClient, $description); + $client->foo(['bar' => 'baz']); + } + + /** + * @expectedException \GuzzleHttp\Command\Exception\CommandException + * @expectedExceptionMessage 404 + */ + public function testDoesNotAddResultWhenExceptionIsPresent() + { + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org/{foo}', + 'httpMethod' => 'GET', + 'responseModel' => 'j', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => true, + 'location' => 'uri' + ] + ] + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object' + ] + ] + ]); + + $mock = new MockHandler([new Response(404)]); + $stack = HandlerStack::create($mock); + $httpClient = new HttpClient(['handler' => $stack]); + $client = new GuzzleClient($httpClient, $description); + $client->foo(['bar' => 'baz']); + } + + public function testReturnsExpectedResult() + { + $loginResponse = new Response( + 200, + [], + '{ + "LoginResponse":{ + "result":{ + "type":4, + "username":{ + "uid":38664492, + "content":"skyfillers-api-test" + }, + "token":"3FB1F21014D630481D35CBC30CBF4043" + }, + "status":{ + "code":200, + "content":"OK" + } + } + }' + ); + $mock = new MockHandler([$loginResponse]); + + $description = new Description([ + 'name' => 'Test API', + 'baseUri' => 'http://httpbin.org', + 'operations' => [ + 'Login' => [ + 'uri' => '/{foo}', + 'httpMethod' => 'POST', + 'responseClass' => 'LoginResponse', + 'parameters' => [ + 'username' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'Unique user name (alphanumeric)', + 'location' => 'json' + ], + 'password' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'User\'s password', + 'location' => 'json' + ], + 'response' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Determines the response type: xml = result content will be xml formatted (default); plain = result content will be simple text, without structure; json = result content will be json formatted', + 'location' => 'json' + ], + 'token' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Provides the authentication token', + 'location' => 'json' + ] + ] + ] + ], + 'models' => [ + 'LoginResponse' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'location' => 'json' + ] + ] + ] + ]); + + $httpClient = new HttpClient(['handler' => $mock]); + $client = new GuzzleClient($httpClient, $description); + $result = $client->Login([ + 'username' => 'test', + 'password' => 'test', + 'response' => 'json', + ]); + + $expected = [ + 'result' => [ + 'type' => 4, + 'username' => [ + 'uid' => 38664492, + 'content' => 'skyfillers-api-test' + ], + 'token' => '3FB1F21014D630481D35CBC30CBF4043' + ], + 'status' => [ + 'code' => 200, + 'content' => 'OK' + ] + ]; + $this->assertArraySubset($expected, $result['LoginResponse']); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/GuzzleClientTest.php b/vendor/guzzlehttp/guzzle-services/tests/GuzzleClientTest.php new file mode 100644 index 00000000..0e5c9d9c --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/GuzzleClientTest.php @@ -0,0 +1,1037 @@ +getServiceClient( + [ + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foofoo":"barbar"}'), + ], + null, + $this->commandToRequestTransformer() + ); + + // Synchronous + $result1 = $client->doThatThingYouDo(['fizz' => 'buzz']); + $this->assertEquals('bar', $result1['foo']); + $this->assertEquals('buzz', $result1['_request']['fizz']); + $this->assertEquals('doThatThingYouDo', $result1['_request']['action']); + + // Asynchronous + $result2 = $client->doThatThingOtherYouDoAsync(['fizz' => 'buzz'])->wait(); + $this->assertEquals('barbar', $result2['foofoo']); + $this->assertEquals('doThatThingOtherYouDo', $result2['_request']['action']); + } + + public function testExecuteWithQueryLocation() + { + $mock = new MockHandler(); + $client = $this->getServiceClient( + [ + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foo":"bar"}') + ], + $mock + ); + + $client->doQueryLocation(['foo' => 'Foo']); + $this->assertEquals('foo=Foo', $mock->getLastRequest()->getUri()->getQuery()); + + $client->doQueryLocation([ + 'foo' => 'Foo', + 'bar' => 'Bar', + 'baz' => 'Baz' + ]); + $last = $mock->getLastRequest(); + $this->assertEquals('foo=Foo&bar=Bar&baz=Baz', $last->getUri()->getQuery()); + } + + public function testExecuteWithBodyLocation() + { + $mock = new MockHandler(); + + $client = $this->getServiceClient( + [ + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foo":"bar"}') + ], + $mock + ); + + $client->doBodyLocation(['foo' => 'Foo']); + $this->assertEquals('foo=Foo', (string) $mock->getLastRequest()->getBody()); + + $client->doBodyLocation([ + 'foo' => 'Foo', + 'bar' => 'Bar', + 'baz' => 'Baz' + ]); + $this->assertEquals('foo=Foo&bar=Bar&baz=Baz', (string) $mock->getLastRequest()->getBody()); + } + + public function testExecuteWithJsonLocation() + { + $mock = new MockHandler(); + + $client = $this->getServiceClient( + [ + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foo":"bar"}') + ], + $mock + ); + + $client->doJsonLocation(['foo' => 'Foo']); + $this->assertEquals('{"foo":"Foo"}', (string) $mock->getLastRequest()->getBody()); + + $client->doJsonLocation([ + 'foo' => 'Foo', + 'bar' => 'Bar', + 'baz' => 'Baz' + ]); + $this->assertEquals('{"foo":"Foo","bar":"Bar","baz":"Baz"}', (string) $mock->getLastRequest()->getBody()); + } + + public function testExecuteWithHeaderLocation() + { + $mock = new MockHandler(); + + $client = $this->getServiceClient( + [ + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foo":"bar"}') + ], + $mock + ); + + $client->doHeaderLocation(['foo' => 'Foo']); + $this->assertEquals(['Foo'], $mock->getLastRequest()->getHeader('foo')); + + $client->doHeaderLocation([ + 'foo' => 'Foo', + 'bar' => 'Bar', + 'baz' => 'Baz' + ]); + $this->assertEquals(['Foo'], $mock->getLastRequest()->getHeader('foo')); + $this->assertEquals(['Bar'], $mock->getLastRequest()->getHeader('bar')); + $this->assertEquals(['Baz'], $mock->getLastRequest()->getHeader('baz')); + } + + public function testExecuteWithXmlLocation() + { + $mock = new MockHandler(); + + $client = $this->getServiceClient( + [ + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foo":"bar"}') + ], + $mock + ); + + $client->doXmlLocation(['foo' => 'Foo']); + $this->assertEquals( + "\nFoo\n", + (string) $mock->getLastRequest()->getBody() + ); + + $client->doXmlLocation([ + 'foo' => 'Foo', + 'bar' => 'Bar', + 'baz' => 'Baz' + ]); + $this->assertEquals( + "\nFooBarBaz\n", + $mock->getLastRequest()->getBody() + ); + } + + public function testExecuteWithMultiPartLocation() + { + $mock = new MockHandler(); + + $client = $this->getServiceClient( + [ + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foo":"bar"}'), + new Response(200, [], '{"foo":"bar"}') + ], + $mock + ); + + $client->doMultiPartLocation(['foo' => 'Foo']); + $multiPartRequestBody = (string) $mock->getLastRequest()->getBody(); + $this->assertContains('name="foo"', $multiPartRequestBody); + $this->assertContains('Foo', $multiPartRequestBody); + + $client->doMultiPartLocation([ + 'foo' => 'Foo', + 'bar' => 'Bar', + 'baz' => 'Baz' + ]); + + $multiPartRequestBody = (string) $mock->getLastRequest()->getBody(); + $this->assertContains('name="foo"', $multiPartRequestBody); + $this->assertContains('Foo', $multiPartRequestBody); + $this->assertContains('name="bar"', $multiPartRequestBody); + $this->assertContains('Bar', $multiPartRequestBody); + $this->assertContains('name="baz"', $multiPartRequestBody); + $this->assertContains('Baz', $multiPartRequestBody); + + $client->doMultiPartLocation([ + 'file' => fopen(dirname(__FILE__) . '/Asset/test.html', 'r'), + ]); + $multiPartRequestBody = (string) $mock->getLastRequest()->getBody(); + $this->assertContains('name="file"', $multiPartRequestBody); + $this->assertContains('filename="test.html"', $multiPartRequestBody); + $this->assertContains('Title', $multiPartRequestBody); + } + + public function testHasConfig() + { + $client = new HttpClient(); + $description = new Description([]); + $guzzle = new GuzzleClient( + $client, + $description, + $this->commandToRequestTransformer(), + $this->responseToResultTransformer(), + null, + ['foo' => 'bar'] + ); + + $this->assertSame($client, $guzzle->getHttpClient()); + $this->assertSame($description, $guzzle->getDescription()); + $this->assertEquals('bar', $guzzle->getConfig('foo')); + $this->assertEquals([], $guzzle->getConfig('defaults')); + $guzzle->setConfig('abc', 'listen'); + $this->assertEquals('listen', $guzzle->getConfig('abc')); + } + + public function testAddsValidateHandlerWhenTrue() + { + $client = new HttpClient(); + $description = new Description([]); + $guzzle = new GuzzleClient( + $client, + $description, + $this->commandToRequestTransformer(), + $this->responseToResultTransformer(), + null, + [ + 'validate' => true, + 'process' => false + ] + ); + + $handlers = explode("\n", $guzzle->getHandlerStack()->__toString()); + $handlers = array_filter($handlers); + $this->assertCount(3, $handlers); + } + + public function testDisablesHandlersWhenFalse() + { + $client = new HttpClient(); + $description = new Description([]); + $guzzle = new GuzzleClient( + $client, + $description, + $this->commandToRequestTransformer(), + $this->responseToResultTransformer(), + null, + [ + 'validate' => false, + 'process' => false + ] + ); + + $handlers = explode("\n", $guzzle->getHandlerStack()->__toString()); + $handlers = array_filter($handlers); + $this->assertCount(1, $handlers); + } + + public function testValidateDescription() + { + $client = new HttpClient(); + $description = new Description( + [ + 'name' => 'Testing API ', + 'baseUri' => 'http://httpbin.org/', + 'operations' => [ + 'Foo' => [ + 'httpMethod' => 'GET', + 'uri' => '/get', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Bar', + 'location' => 'query' + ], + 'baz' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'baz', + 'location' => 'query' + ], + ], + 'responseModel' => 'Foo' + ], + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'location' => 'json', + 'type' => 'string' + ], + 'location' => [ + 'location' => 'header', + 'sentAs' => 'Location', + 'type' => 'string' + ], + 'age' => [ + 'location' => 'json', + 'type' => 'integer' + ], + 'statusCode' => [ + 'location' => 'statusCode', + 'type' => 'integer' + ], + ], + ], + ], + ] + ); + + $guzzle = new GuzzleClient( + $client, + $description, + null, + null, + null, + [ + 'validate' => true, + 'process' => false + ] + ); + + $command = $guzzle->getCommand('Foo', ['baz' => 'BAZ']); + /** @var ResponseInterface $response */ + $response = $guzzle->execute($command); + $this->assertInstanceOf(Response::class, $response); + $this->assertEquals(200, $response->getStatusCode()); + } + + /** + * @expectedException \GuzzleHttp\Command\Exception\CommandException + * @expectedExceptionMessage Validation errors: [baz] is a required string: baz + */ + public function testValidateDescriptionFailsDueMissingRequiredParameter() + { + $client = new HttpClient(); + $description = new Description( + [ + 'name' => 'Testing API ', + 'baseUri' => 'http://httpbin.org/', + 'operations' => [ + 'Foo' => [ + 'httpMethod' => 'GET', + 'uri' => '/get', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Bar', + 'location' => 'query' + ], + 'baz' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'baz', + 'location' => 'query' + ], + ], + 'responseModel' => 'Foo' + ], + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'location' => 'json', + 'type' => 'string' + ], + 'location' => [ + 'location' => 'header', + 'sentAs' => 'Location', + 'type' => 'string' + ], + 'age' => [ + 'location' => 'json', + 'type' => 'integer' + ], + 'statusCode' => [ + 'location' => 'statusCode', + 'type' => 'integer' + ], + ], + ], + ], + ] + ); + + $guzzle = new GuzzleClient( + $client, + $description, + null, + null, + null, + [ + 'validate' => true, + 'process' => false + ] + ); + + $command = $guzzle->getCommand('Foo'); + /** @var ResultInterface $result */ + $result = $guzzle->execute($command); + $this->assertInstanceOf(Result::class, $result); + $result = $result->toArray(); + $this->assertEquals(200, $result['statusCode']); + } + + /** + * @expectedException \GuzzleHttp\Command\Exception\CommandException + * @expectedExceptionMessage Validation errors: [baz] must be of type integer + */ + public function testValidateDescriptionFailsDueTypeMismatch() + { + $client = new HttpClient(); + $description = new Description( + [ + 'name' => 'Testing API ', + 'baseUri' => 'http://httpbin.org/', + 'operations' => [ + 'Foo' => [ + 'httpMethod' => 'GET', + 'uri' => '/get', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Bar', + 'location' => 'query' + ], + 'baz' => [ + 'type' => 'integer', + 'required' => true, + 'description' => 'baz', + 'location' => 'query' + ], + ], + 'responseModel' => 'Foo' + ], + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'location' => 'json', + 'type' => 'string' + ], + 'location' => [ + 'location' => 'header', + 'sentAs' => 'Location', + 'type' => 'string' + ], + 'age' => [ + 'location' => 'json', + 'type' => 'integer' + ], + 'statusCode' => [ + 'location' => 'statusCode', + 'type' => 'integer' + ], + ], + ], + ], + ] + ); + + $guzzle = new GuzzleClient( + $client, + $description, + null, + null, + null, + [ + 'validate' => true, + 'process' => false + ] + ); + + $command = $guzzle->getCommand('Foo', ['baz' => 'Hello']); + /** @var ResultInterface $result */ + $result = $guzzle->execute($command); + $this->assertInstanceOf(Result::class, $result); + $result = $result->toArray(); + $this->assertEquals(200, $result['statusCode']); + } + + public function testValidateDescriptionDoesNotFailWhenSendingIntegerButExpectingString() + { + $client = new HttpClient(); + $description = new Description( + [ + 'name' => 'Testing API ', + 'baseUri' => 'http://httpbin.org/', + 'operations' => [ + 'Foo' => [ + 'httpMethod' => 'GET', + 'uri' => '/get', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Bar', + 'location' => 'query' + ], + 'baz' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'baz', + 'location' => 'query' + ], + ], + 'responseModel' => 'Foo' + ], + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'location' => 'json', + 'type' => 'string' + ], + 'location' => [ + 'location' => 'header', + 'sentAs' => 'Location', + 'type' => 'string' + ], + 'age' => [ + 'location' => 'json', + 'type' => 'integer' + ], + 'statusCode' => [ + 'location' => 'statusCode', + 'type' => 'integer' + ], + ], + ], + ], + ] + ); + + $guzzle = new GuzzleClient($client, $description); + + $command = $guzzle->getCommand('Foo', ['baz' => 42]); + /** @var ResultInterface $result */ + $result = $guzzle->execute($command); + $this->assertInstanceOf(Result::class, $result); + $result = $result->toArray(); + $this->assertEquals(200, $result['statusCode']); + } + + public function testMagicMethodExecutesCommands() + { + $client = new HttpClient(); + $description = new Description( + [ + 'name' => 'Testing API ', + 'baseUri' => 'http://httpbin.org/', + 'operations' => [ + 'Foo' => [ + 'httpMethod' => 'GET', + 'uri' => '/get', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Bar', + 'location' => 'query' + ], + 'baz' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'baz', + 'location' => 'query' + ], + ], + 'responseModel' => 'Foo' + ], + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'location' => 'json', + 'type' => 'string' + ], + 'location' => [ + 'location' => 'header', + 'sentAs' => 'Location', + 'type' => 'string' + ], + 'age' => [ + 'location' => 'json', + 'type' => 'integer' + ], + 'statusCode' => [ + 'location' => 'statusCode', + 'type' => 'integer' + ], + ], + ], + ], + ] + ); + + $guzzle = $this->getMockBuilder(GuzzleClient::class) + ->setConstructorArgs([ + $client, + $description + ]) + ->setMethods(['execute']) + ->getMock(); + + $guzzle->expects($this->once()) + ->method('execute') + ->will($this->returnValue('foo')); + + $this->assertEquals('foo', $guzzle->foo([])); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage No operation found named Foo + */ + public function testThrowsWhenOperationNotFoundInDescription() + { + $client = new HttpClient(); + $description = new Description([]); + $guzzle = new GuzzleClient( + $client, + $description, + $this->commandToRequestTransformer(), + $this->responseToResultTransformer() + ); + $guzzle->getCommand('foo'); + } + + public function testReturnsProcessedResponse() + { + $client = new HttpClient(); + + $description = new Description( + [ + 'name' => 'Testing API ', + 'baseUri' => 'http://httpbin.org/', + 'operations' => [ + 'Foo' => [ + 'httpMethod' => 'GET', + 'uri' => '/get', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Bar', + 'location' => 'query' + ], + 'baz' => [ + 'type' => 'string', + 'required' => true, + 'description' => 'baz', + 'location' => 'query' + ], + ], + 'responseModel' => 'Foo' + ], + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'location' => 'json', + 'type' => 'string' + ], + 'location' => [ + 'location' => 'header', + 'sentAs' => 'Location', + 'type' => 'string' + ], + 'age' => [ + 'location' => 'json', + 'type' => 'integer' + ], + 'statusCode' => [ + 'location' => 'statusCode', + 'type' => 'integer' + ], + ], + ], + ], + ] + ); + + $guzzle = new GuzzleClient($client, $description, null, null); + $command = $guzzle->getCommand('foo', ['baz' => 'BAZ']); + + /** @var ResultInterface $result */ + $result = $guzzle->execute($command); + $this->assertInstanceOf(Result::class, $result); + $result = $result->toArray(); + $this->assertEquals(200, $result['statusCode']); + } + + private function getServiceClient( + array $responses, + MockHandler $mock = null, + callable $commandToRequestTransformer = null + ) { + $mock = $mock ?: new MockHandler(); + + foreach ($responses as $response) { + $mock->append($response); + } + + return new GuzzleClient( + new HttpClient([ + 'handler' => $mock + ]), + $this->getDescription(), + $commandToRequestTransformer, + $this->responseToResultTransformer(), + null, + ['foo' => 'bar'] + ); + } + + private function commandToRequestTransformer() + { + return function (CommandInterface $command) { + $data = $command->toArray(); + $data['action'] = $command->getName(); + + return new Request('POST', '/', [], http_build_query($data)); + }; + } + + private function responseToResultTransformer() + { + return function (ResponseInterface $response, RequestInterface $request, CommandInterface $command) { + $data = \GuzzleHttp\json_decode($response->getBody(), true); + parse_str($request->getBody(), $data['_request']); + + return new Result($data); + }; + } + + private function getDescription() + { + return new Description( + [ + 'name' => 'Testing API ', + 'baseUri' => 'http://httpbin.org/', + 'operations' => [ + 'doThatThingYouDo' => [ + 'responseModel' => 'Bar' + ], + 'doThatThingOtherYouDo' => [ + 'responseModel' => 'Foo' + ], + 'doQueryLocation' => [ + 'httpMethod' => 'GET', + 'uri' => '/queryLocation', + 'parameters' => [ + 'foo' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing query request location', + 'location' => 'query' + ], + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing query request location', + 'location' => 'query' + ], + 'baz' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing query request location', + 'location' => 'query' + ] + ], + 'responseModel' => 'QueryResponse' + ], + 'doBodyLocation' => [ + 'httpMethod' => 'GET', + 'uri' => '/bodyLocation', + 'parameters' => [ + 'foo' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing body request location', + 'location' => 'body' + ], + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing body request location', + 'location' => 'body' + ], + 'baz' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing body request location', + 'location' => 'body' + ] + ], + 'responseModel' => 'BodyResponse' + ], + 'doJsonLocation' => [ + 'httpMethod' => 'GET', + 'uri' => '/jsonLocation', + 'parameters' => [ + 'foo' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing json request location', + 'location' => 'json' + ], + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing json request location', + 'location' => 'json' + ], + 'baz' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing json request location', + 'location' => 'json' + ] + ], + 'responseModel' => 'JsonResponse' + ], + 'doHeaderLocation' => [ + 'httpMethod' => 'GET', + 'uri' => '/headerLocation', + 'parameters' => [ + 'foo' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing header request location', + 'location' => 'header' + ], + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing header request location', + 'location' => 'header' + ], + 'baz' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing header request location', + 'location' => 'header' + ] + ], + 'responseModel' => 'HeaderResponse' + ], + 'doXmlLocation' => [ + 'httpMethod' => 'GET', + 'uri' => '/xmlLocation', + 'parameters' => [ + 'foo' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing xml request location', + 'location' => 'xml' + ], + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing xml request location', + 'location' => 'xml' + ], + 'baz' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing xml request location', + 'location' => 'xml' + ] + ], + 'responseModel' => 'XmlResponse' + ], + 'doMultiPartLocation' => [ + 'httpMethod' => 'POST', + 'uri' => '/multipartLocation', + 'parameters' => [ + 'foo' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing multipart request location', + 'location' => 'multipart' + ], + 'bar' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing multipart request location', + 'location' => 'multipart' + ], + 'baz' => [ + 'type' => 'string', + 'required' => false, + 'description' => 'Testing multipart request location', + 'location' => 'multipart' + ], + 'file' => [ + 'type' => 'any', + 'required' => false, + 'description' => 'Testing multipart request location', + 'location' => 'multipart' + ] + ], + 'responseModel' => 'MultipartResponse' + ], + ], + 'models' => [ + 'Foo' => [ + 'type' => 'object', + 'properties' => [ + 'code' => [ + 'location' => 'statusCode' + ] + ] + ], + 'Bar' => [ + 'type' => 'object', + 'properties' => [ + 'code' => [' + location' => 'statusCode' + ] + ] + ] + ] + ] + ); + } + + public function testDocumentationExampleFromReadme() + { + $client = new HttpClient(); + $description = new Description([ + 'baseUrl' => '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' + ] + ] + ] + ]); + + $guzzle = new GuzzleClient($client, $description); + + $result = $guzzle->testing(['foo' => 'bar']); + $this->assertEquals('bar', $result['args']['foo']); + } + + public function testDescriptionWithExtends() + { + $client = new HttpClient(); + $description = new Description([ + 'baseUrl' => 'http://httpbin.org/', + 'operations' => [ + 'testing' => [ + 'httpMethod' => 'GET', + 'uri' => '/get', + 'responseModel' => 'getResponse', + 'parameters' => [ + 'foo' => [ + 'type' => 'string', + 'default' => 'foo', + 'location' => 'query' + ] + ] + ], + 'testing_extends' => [ + 'extends' => 'testing', + 'responseModel' => 'getResponse', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'location' => 'query' + ] + ] + ], + ], + 'models' => [ + 'getResponse' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'location' => 'json' + ] + ] + ] + ]); + $guzzle = new GuzzleClient($client, $description); + $result = $guzzle->testing_extends(['bar' => 'bar']); + $this->assertEquals('bar', $result['args']['bar']); + $this->assertEquals('foo', $result['args']['foo']); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/Handler/ValidatedDescriptionHandlerTest.php b/vendor/guzzlehttp/guzzle-services/tests/Handler/ValidatedDescriptionHandlerTest.php new file mode 100644 index 00000000..f02396c5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/Handler/ValidatedDescriptionHandlerTest.php @@ -0,0 +1,112 @@ + [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j', + 'parameters' => [ + 'bar' => [ + 'type' => 'string', + 'required' => true + ] + ] + ] + ] + ]); + + $client = new GuzzleClient(new HttpClient(), $description); + $client->foo([]); + } + + public function testSuccessfulValidationDoesNotThrow() + { + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j', + 'parameters' => [] + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object' + ] + ] + ]); + + $client = new GuzzleClient(new HttpClient(), $description); + $client->foo([]); + } + + /** + * @expectedException \GuzzleHttp\Command\Exception\CommandException + * @expectedExceptionMessage Validation errors: [bar] must be of type string + */ + public function testValidatesAdditionalParameters() + { + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j', + 'additionalParameters' => [ + 'type' => 'string' + ] + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object' + ] + ] + ]); + + $client = new GuzzleClient(new HttpClient(), $description); + $client->foo(['bar' => new \stdClass()]); + } + + public function testFilterBeforeValidate() + { + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bar' => [ + 'location' => 'uri', + 'type' => 'string', + 'format' => 'date-time', + 'required' => true + ] + ] + ] + ] + ]); + + $client = new GuzzleClient(new HttpClient(), $description); + $client->foo(['bar' => new \DateTimeImmutable()]); // Should not throw any exception + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/OperationTest.php b/vendor/guzzlehttp/guzzle-services/tests/OperationTest.php new file mode 100644 index 00000000..04313dd7 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/OperationTest.php @@ -0,0 +1,227 @@ + 'test', + 'summary' => 'doc', + 'notes' => 'notes', + 'documentationUrl' => 'http://www.example.com', + 'httpMethod' => 'POST', + 'uri' => '/api/v1', + 'responseModel' => 'abc', + 'deprecated' => true, + 'parameters' => [ + 'key' => [ + 'required' => true, + 'type' => 'string', + 'maxLength' => 10, + 'name' => 'key' + ], + 'key_2' => [ + 'required' => true, + 'type' => 'integer', + 'default' => 10, + 'name' => 'key_2' + ] + ] + ]); + + $this->assertEquals('test', $c->getName()); + $this->assertEquals('doc', $c->getSummary()); + $this->assertEquals('http://www.example.com', $c->getDocumentationUrl()); + $this->assertEquals('POST', $c->getHttpMethod()); + $this->assertEquals('/api/v1', $c->getUri()); + $this->assertEquals('abc', $c->getResponseModel()); + $this->assertTrue($c->getDeprecated()); + + $params = array_map(function ($c) { + return $c->toArray(); + }, $c->getParams()); + + $this->assertEquals([ + 'key' => [ + 'required' => true, + 'type' => 'string', + 'maxLength' => 10, + 'name' => 'key' + ], + 'key_2' => [ + 'required' => true, + 'type' => 'integer', + 'default' => 10, + 'name' => 'key_2' + ] + ], $params); + + $this->assertEquals([ + 'required' => true, + 'type' => 'integer', + 'default' => 10, + 'name' => 'key_2' + ], $c->getParam('key_2')->toArray()); + + $this->assertNull($c->getParam('afefwef')); + $this->assertArrayNotHasKey('parent', $c->getParam('key_2')->toArray()); + } + + public function testDeterminesIfHasParam() + { + $command = $this->getTestCommand(); + $this->assertTrue($command->hasParam('data')); + $this->assertFalse($command->hasParam('baz')); + } + + protected function getTestCommand() + { + return new Operation([ + 'parameters' => [ + 'data' => ['type' => 'string'] + ] + ]); + } + + public function testAddsNameToParametersIfNeeded() + { + $command = new Operation(['parameters' => ['foo' => []]]); + $this->assertEquals('foo', $command->getParam('foo')->getName()); + } + + public function testContainsApiErrorInformation() + { + $command = $this->getOperation(); + $this->assertEquals(1, count($command->getErrorResponses())); + } + + public function testHasNotes() + { + $o = new Operation(['notes' => 'foo']); + $this->assertEquals('foo', $o->getNotes()); + } + + public function testHasData() + { + $o = new Operation(['data' => ['foo' => 'baz', 'bar' => 123]]); + $this->assertEquals('baz', $o->getData('foo')); + $this->assertEquals(123, $o->getData('bar')); + $this->assertNull($o->getData('wfefwe')); + $this->assertEquals(['foo' => 'baz', 'bar' => 123], $o->getData()); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMesssage Parameters must be arrays + */ + public function testEnsuresParametersAreArrays() + { + new Operation(['parameters' => ['foo' => true]]); + } + + public function testHasDescription() + { + $s = new Description([]); + $o = new Operation([], $s); + $this->assertSame($s, $o->getServiceDescription()); + } + + public function testHasAdditionalParameters() + { + $o = new Operation([ + 'additionalParameters' => [ + 'type' => 'string', 'name' => 'binks', + ], + 'parameters' => [ + 'foo' => ['type' => 'integer'], + ], + ]); + $this->assertEquals('string', $o->getAdditionalParameters()->getType()); + } + + /** + * @return Operation + */ + protected function getOperation() + { + return new Operation([ + 'name' => 'OperationTest', + 'class' => get_class($this), + 'parameters' => [ + 'test' => ['type' => 'object'], + 'bool_1' => ['default' => true, 'type' => 'boolean'], + 'bool_2' => ['default' => false], + 'float' => ['type' => 'numeric'], + 'int' => ['type' => 'integer'], + 'date' => ['type' => 'string'], + 'timestamp' => ['type' => 'string'], + 'string' => ['type' => 'string'], + 'username' => ['type' => 'string', 'required' => true, 'filters' => 'strtolower'], + 'test_function' => ['type' => 'string', 'filters' => __CLASS__ . '::strtoupper'], + ], + 'errorResponses' => [ + [ + 'code' => 503, + 'reason' => 'InsufficientCapacity', + 'class' => 'Guzzle\\Exception\\RuntimeException', + ], + ], + ]); + } + + public function testCanExtendFromOtherOperations() + { + $d = new Description([ + 'operations' => [ + 'A' => [ + 'parameters' => [ + 'A' => [ + 'type' => 'object', + 'properties' => ['foo' => ['type' => 'string']] + ], + 'B' => ['type' => 'string'] + ], + 'summary' => 'foo' + ], + 'B' => [ + 'extends' => 'A', + 'summary' => 'Bar' + ], + 'C' => [ + 'extends' => 'B', + 'summary' => 'Bar', + 'parameters' => [ + 'B' => ['type' => 'number'] + ] + ] + ] + ]); + + $a = $d->getOperation('A'); + $this->assertEquals('foo', $a->getSummary()); + $this->assertTrue($a->hasParam('A')); + $this->assertEquals('string', $a->getParam('B')->getType()); + + $b = $d->getOperation('B'); + $this->assertTrue($a->hasParam('A')); + $this->assertEquals('Bar', $b->getSummary()); + $this->assertEquals('string', $a->getParam('B')->getType()); + + $c = $d->getOperation('C'); + $this->assertTrue($a->hasParam('A')); + $this->assertEquals('Bar', $c->getSummary()); + $this->assertEquals('number', $c->getParam('B')->getType()); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/ParameterTest.php b/vendor/guzzlehttp/guzzle-services/tests/ParameterTest.php new file mode 100644 index 00000000..7bc937f3 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/ParameterTest.php @@ -0,0 +1,378 @@ + 'foo', + 'type' => 'bar', + 'required' => true, + 'default' => '123', + 'description' => '456', + 'minLength' => 2, + 'maxLength' => 5, + 'location' => 'body', + 'static' => true, + 'filters' => ['trim', 'json_encode'] + ]; + + public function testCreatesParamFromArray() + { + $p = new Parameter($this->data); + $this->assertEquals('foo', $p->getName()); + $this->assertEquals('bar', $p->getType()); + $this->assertTrue($p->isRequired()); + $this->assertEquals('123', $p->getDefault()); + $this->assertEquals('456', $p->getDescription()); + $this->assertEquals(2, $p->getMinLength()); + $this->assertEquals(5, $p->getMaxLength()); + $this->assertEquals('body', $p->getLocation()); + $this->assertTrue($p->isStatic()); + $this->assertEquals(['trim', 'json_encode'], $p->getFilters()); + $p->setName('abc'); + $this->assertEquals('abc', $p->getName()); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testValidatesDescription() + { + new Parameter($this->data, ['description' => 'foo']); + } + + public function testCanConvertToArray() + { + $p = new Parameter($this->data); + $this->assertEquals($this->data, $p->toArray()); + } + + public function testUsesStatic() + { + $d = $this->data; + $d['default'] = 'booboo'; + $d['static'] = true; + $p = new Parameter($d); + $this->assertEquals('booboo', $p->getValue('bar')); + } + + public function testUsesDefault() + { + $d = $this->data; + $d['default'] = 'foo'; + $d['static'] = null; + $p = new Parameter($d); + $this->assertEquals('foo', $p->getValue(null)); + } + + public function testReturnsYourValue() + { + $d = $this->data; + $d['static'] = null; + $p = new Parameter($d); + $this->assertEquals('foo', $p->getValue('foo')); + } + + public function testZeroValueDoesNotCauseDefaultToBeReturned() + { + $d = $this->data; + $d['default'] = '1'; + $d['static'] = null; + $p = new Parameter($d); + $this->assertEquals('0', $p->getValue('0')); + } + + public function testFiltersValues() + { + $d = $this->data; + $d['static'] = null; + $d['filters'] = 'strtoupper'; + $p = new Parameter($d); + $this->assertEquals('FOO', $p->filter('foo')); + } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage No service description + */ + public function testRequiresServiceDescriptionForFormatting() + { + $d = $this->data; + $d['format'] = 'foo'; + $p = new Parameter($d); + $p->filter('bar'); + } + + public function testConvertsBooleans() + { + $p = new Parameter(['type' => 'boolean']); + $this->assertEquals(true, $p->filter('true')); + $this->assertEquals(false, $p->filter('false')); + } + + public function testUsesArrayByDefaultForFilters() + { + $d = $this->data; + $d['filters'] = null; + $p = new Parameter($d); + $this->assertEquals([], $p->getFilters()); + } + + public function testAllowsSimpleLocationValue() + { + $p = new Parameter(['name' => 'myname', 'location' => 'foo', 'sentAs' => 'Hello']); + $this->assertEquals('foo', $p->getLocation()); + $this->assertEquals('Hello', $p->getSentAs()); + } + + public function testParsesTypeValues() + { + $p = new Parameter(['type' => 'foo']); + $this->assertEquals('foo', $p->getType()); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage A [method] value must be specified for each complex filter + */ + public function testValidatesComplexFilters() + { + $p = new Parameter(['filters' => [['args' => 'foo']]]); + } + + public function testAllowsComplexFilters() + { + $that = $this; + $param = new Parameter([ + 'filters' => [ + [ + 'method' => function ($a, $b, $c, $d) use ($that, &$param) { + $that->assertEquals('test', $a); + $that->assertEquals('my_value!', $b); + $that->assertEquals('bar', $c); + $that->assertSame($param, $d); + return 'abc' . $b; + }, + 'args' => ['test', '@value', 'bar', '@api'] + ] + ] + ]); + + $this->assertEquals('abcmy_value!', $param->filter('my_value!')); + } + + public function testAddsAdditionalProperties() + { + $p = new Parameter([ + 'type' => 'object', + 'additionalProperties' => ['type' => 'string'] + ]); + $this->assertInstanceOf('GuzzleHttp\Command\Guzzle\Parameter', $p->getAdditionalProperties()); + $this->assertNull($p->getAdditionalProperties()->getAdditionalProperties()); + $p = new Parameter(['type' => 'object']); + $this->assertTrue($p->getAdditionalProperties()); + } + + public function testAddsItems() + { + $p = new Parameter([ + 'type' => 'array', + 'items' => ['type' => 'string'] + ]); + $this->assertInstanceOf('GuzzleHttp\Command\Guzzle\Parameter', $p->getItems()); + $out = $p->toArray(); + $this->assertEquals('array', $out['type']); + $this->assertInternalType('array', $out['items']); + } + + public function testCanRetrieveKnownPropertiesUsingDataMethod() + { + $p = new Parameter(['data' => ['name' => 'test'], 'extra' => 'hi!']); + $this->assertEquals('test', $p->getData('name')); + $this->assertEquals(['name' => 'test'], $p->getData()); + $this->assertNull($p->getData('fjnweefe')); + $this->assertEquals('hi!', $p->getData('extra')); + } + + public function testHasPattern() + { + $p = new Parameter(['pattern' => '/[0-9]+/']); + $this->assertEquals('/[0-9]+/', $p->getPattern()); + } + + public function testHasEnum() + { + $p = new Parameter(['enum' => ['foo', 'bar']]); + $this->assertEquals(['foo', 'bar'], $p->getEnum()); + } + + public function testSerializesItems() + { + $p = new Parameter([ + 'type' => 'object', + 'additionalProperties' => ['type' => 'string'] + ]); + $this->assertEquals([ + 'type' => 'object', + 'additionalProperties' => ['type' => 'string'] + ], $p->toArray()); + } + + public function testResolvesRefKeysRecursively() + { + $description = new Description([ + 'models' => [ + 'JarJar' => ['type' => 'string', 'default' => 'Mesa address tha senate!'], + 'Anakin' => ['type' => 'array', 'items' => ['$ref' => 'JarJar']] + ], + ]); + $p = new Parameter(['$ref' => 'Anakin', 'description' => 'added'], ['description' => $description]); + $this->assertEquals([ + 'description' => 'added', + '$ref' => 'Anakin' + ], $p->toArray()); + } + + public function testResolvesExtendsRecursively() + { + $jarJar = ['type' => 'string', 'default' => 'Mesa address tha senate!', 'description' => 'a']; + $anakin = ['type' => 'array', 'items' => ['extends' => 'JarJar', 'description' => 'b']]; + $description = new Description([ + 'models' => ['JarJar' => $jarJar, 'Anakin' => $anakin] + ]); + // Description attribute will be updated, and format added + $p = new Parameter(['extends' => 'Anakin', 'format' => 'date'], ['description' => $description]); + $this->assertEquals([ + 'format' => 'date', + 'extends' => 'Anakin' + ], $p->toArray()); + } + + public function testHasKeyMethod() + { + $p = new Parameter(['name' => 'foo', 'sentAs' => 'bar']); + $this->assertEquals('bar', $p->getWireName()); + } + + public function testIncludesNameInToArrayWhenItemsAttributeHasName() + { + $p = new Parameter([ + 'type' => 'array', + 'name' => 'Abc', + 'items' => [ + 'name' => 'Foo', + 'type' => 'object' + ] + ]); + $result = $p->toArray(); + $this->assertEquals([ + 'type' => 'array', + 'name' => 'Abc', + 'items' => [ + 'name' => 'Foo', + 'type' => 'object' + ] + ], $result); + } + + public function dateTimeProvider() + { + $d = 'October 13, 2012 16:15:46 UTC'; + + return [ + [$d, 'date-time', '2012-10-13T16:15:46Z'], + [$d, 'date', '2012-10-13'], + [$d, 'timestamp', strtotime($d)], + [new \DateTime($d), 'timestamp', strtotime($d)] + ]; + } + + /** + * @dataProvider dateTimeProvider + */ + public function testAppliesFormat($d, $format, $result) + { + $p = new Parameter(['format' => $format], ['description' => new Description([])]); + $this->assertEquals($format, $p->getFormat()); + $this->assertEquals($result, $p->filter($d)); + } + + public function testHasMinAndMax() + { + $p = new Parameter([ + 'minimum' => 2, + 'maximum' => 3, + 'minItems' => 4, + 'maxItems' => 5, + ]); + $this->assertEquals(2, $p->getMinimum()); + $this->assertEquals(3, $p->getMaximum()); + $this->assertEquals(4, $p->getMinItems()); + $this->assertEquals(5, $p->getMaxItems()); + } + + public function testHasProperties() + { + $data = [ + 'type' => 'object', + 'properties' => [ + 'foo' => ['type' => 'string'], + 'bar' => ['type' => 'string'], + ] + ]; + $p = new Parameter($data); + $this->assertInstanceOf('GuzzleHttp\\Command\\Guzzle\\Parameter', $p->getProperty('foo')); + $this->assertSame($p->getProperty('foo'), $p->getProperty('foo')); + $this->assertNull($p->getProperty('wefwe')); + + $properties = $p->getProperties(); + $this->assertInternalType('array', $properties); + foreach ($properties as $prop) { + $this->assertInstanceOf('GuzzleHttp\\Command\\Guzzle\\Parameter', $prop); + } + + $this->assertEquals($data, $p->toArray()); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Expected a string. Got: array + */ + public function testThrowsWhenNotPassString() + { + $emptyParam = new Parameter(); + $this->assertFalse($emptyParam->has([])); + $this->assertFalse($emptyParam->has(new \stdClass())); + $this->assertFalse($emptyParam->has('1')); + $this->assertFalse($emptyParam->has(1)); + } + + public function testHasReturnsFalseForWrongOrEmptyValues() + { + $emptyParam = new Parameter(); + $this->assertFalse($emptyParam->has('')); + $this->assertFalse($emptyParam->has('description')); + $this->assertFalse($emptyParam->has('noExisting')); + } + + public function testHasReturnsTrueForCorrectValues() + { + $p = new Parameter([ + 'minimum' => 2, + 'maximum' => 3, + 'minItems' => 4, + 'maxItems' => 5, + ]); + + $this->assertTrue($p->has('minimum')); + $this->assertTrue($p->has('maximum')); + $this->assertTrue($p->has('minItems')); + $this->assertTrue($p->has('maxItems')); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/QuerySerializer/Rfc3986SerializerTest.php b/vendor/guzzlehttp/guzzle-services/tests/QuerySerializer/Rfc3986SerializerTest.php new file mode 100644 index 00000000..66ec75f2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/QuerySerializer/Rfc3986SerializerTest.php @@ -0,0 +1,35 @@ + 'bar'], 'foo=bar'], + [['foo' => [1, 2]], 'foo[0]=1&foo[1]=2'], + [['foo' => ['bar' => 'baz', 'bim' => [4, 5]]], 'foo[bar]=baz&foo[bim][0]=4&foo[bim][1]=5'] + ]; + } + + /** + * @dataProvider queryProvider + */ + public function testSerializeQueryParams(array $params, $expectedResult) + { + $serializer = new Rfc3986Serializer(); + $result = $serializer->aggregate($params); + + $this->assertEquals($expectedResult, urldecode($result)); + } + + public function testCanRemoveNumericIndices() + { + $serializer = new Rfc3986Serializer(true); + $result = $serializer->aggregate(['foo' => ['bar', 'baz'], 'bar' => ['bim' => [4, 5]]]); + + $this->assertEquals('foo[]=bar&foo[]=baz&bar[bim][]=4&bar[bim][]=5', urldecode($result)); + } +} \ No newline at end of file diff --git a/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/BodyLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/BodyLocationTest.php new file mode 100644 index 00000000..2a6418e5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/BodyLocationTest.php @@ -0,0 +1,26 @@ + 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $request = $location->visit($command, $request, $param); + $this->assertEquals('foo=bar', $request->getBody()->getContents()); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/FormParamLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/FormParamLocationTest.php new file mode 100644 index 00000000..016ad6b8 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/FormParamLocationTest.php @@ -0,0 +1,52 @@ + 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $request = $location->visit($command, $request, $param); + $operation = new Operation(); + $request = $location->after($command, $request, $operation); + $this->assertEquals('foo=bar', $request->getBody()->getContents()); + $this->assertArraySubset([0 => 'application/x-www-form-urlencoded; charset=utf-8'], $request->getHeader('Content-Type')); + } + + /** + * @group RequestLocation + */ + public function testAddsAdditionalProperties() + { + $location = new FormParamLocation(); + $command = new Command('foo', ['foo' => 'bar']); + $command['add'] = 'props'; + $request = new Request('POST', 'http://httbin.org', []); + $param = new Parameter(['name' => 'foo']); + $request = $location->visit($command, $request, $param); + $operation = new Operation([ + 'additionalParameters' => [ + 'location' => 'formParam' + ] + ]); + $request = $location->after($command, $request, $operation); + $this->assertEquals('foo=bar&add=props', $request->getBody()->getContents()); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/HeaderLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/HeaderLocationTest.php new file mode 100644 index 00000000..2ebc2835 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/HeaderLocationTest.php @@ -0,0 +1,52 @@ + 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $request = $location->visit($command, $request, $param); + + $header = $request->getHeader('foo'); + $this->assertTrue(is_array($header)); + $this->assertArraySubset([0 => 'bar'], $request->getHeader('foo')); + } + + /** + * @group RequestLocation + */ + public function testAddsAdditionalProperties() + { + $location = new HeaderLocation('header'); + $command = new Command('foo', ['foo' => 'bar']); + $command['add'] = 'props'; + $operation = new Operation([ + 'additionalParameters' => [ + 'location' => 'header' + ] + ]); + $request = new Request('POST', 'http://httbin.org'); + $request = $location->after($command, $request, $operation); + + $header = $request->getHeader('add'); + $this->assertTrue(is_array($header)); + $this->assertArraySubset([0 => 'props'], $header); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/JsonLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/JsonLocationTest.php new file mode 100644 index 00000000..359b7e29 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/JsonLocationTest.php @@ -0,0 +1,91 @@ + 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $location->visit($command, $request, $param); + $operation = new Operation(); + $request = $location->after($command, $request, $operation); + $this->assertEquals('{"foo":"bar"}', $request->getBody()->getContents()); + $this->assertArraySubset([0 => 'application/json'], $request->getHeader('Content-Type')); + } + + /** + * @group RequestLocation + */ + public function testVisitsAdditionalProperties() + { + $location = new JsonLocation('json', 'foo'); + $command = new Command('foo', ['foo' => 'bar']); + $command['baz'] = ['bam' => [1]]; + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $location->visit($command, $request, $param); + $operation = new Operation([ + 'additionalParameters' => [ + 'location' => 'json' + ] + ]); + $request = $location->after($command, $request, $operation); + $this->assertEquals('{"foo":"bar","baz":{"bam":[1]}}', $request->getBody()->getContents()); + $this->assertEquals([0 => 'foo'], $request->getHeader('Content-Type')); + } + + /** + * @group RequestLocation + */ + public function testVisitsNestedLocation() + { + $location = new JsonLocation('json'); + $command = new Command('foo', ['foo' => 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'properties' => [ + 'baz' => [ + 'type' => 'array', + 'items' => [ + 'type' => 'string', + 'filters' => ['strtoupper'] + ] + ] + ], + 'additionalProperties' => [ + 'type' => 'array', + 'items' => [ + 'type' => 'string', + 'filters' => ['strtolower'] + ] + ] + ]); + $command['foo'] = [ + 'baz' => ['a', 'b'], + 'bam' => ['A', 'B'], + ]; + $location->visit($command, $request, $param); + $operation = new Operation(); + $request = $location->after($command, $request, $operation); + $this->assertEquals('{"foo":{"baz":["A","B"],"bam":["a","b"]}}', (string) $request->getBody()->getContents()); + $this->assertEquals([0 => 'application/json'], $request->getHeader('Content-Type')); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/MultiPartLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/MultiPartLocationTest.php new file mode 100644 index 00000000..a2e7faf6 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/MultiPartLocationTest.php @@ -0,0 +1,33 @@ + 'bar']); + $request = new Request('POST', 'http://httbin.org', []); + $param = new Parameter(['name' => 'foo']); + $request = $location->visit($command, $request, $param); + $operation = new Operation(); + $request = $location->after($command, $request, $operation); + $actual = $request->getBody()->getContents(); + + $this->assertNotFalse(strpos($actual, 'name="foo"')); + $this->assertNotFalse(strpos($actual, 'bar')); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/QueryLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/QueryLocationTest.php new file mode 100644 index 00000000..7ccfbd8a --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/QueryLocationTest.php @@ -0,0 +1,77 @@ + 'bar'], 'foo=bar'], + [['foo' => [1, 2]], 'foo[0]=1&foo[1]=2'], + [['foo' => ['bar' => 'baz', 'bim' => [4, 5]]], 'foo[bar]=baz&foo[bim][0]=4&foo[bim][1]=5'] + ]; + } + + /** + * @group RequestLocation + */ + public function testVisitsLocation() + { + $location = new QueryLocation(); + $command = new Command('foo', ['foo' => 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $request = $location->visit($command, $request, $param); + + $this->assertEquals('foo=bar', urldecode($request->getUri()->getQuery())); + } + + public function testVisitsMultipleLocations() + { + $request = new Request('POST', 'http://httbin.org'); + + // First location + $location = new QueryLocation(); + $command = new Command('foo', ['foo' => 'bar']); + $param = new Parameter(['name' => 'foo']); + $request = $location->visit($command, $request, $param); + + // Second location + $location = new QueryLocation(); + $command = new Command('baz', ['baz' => [6, 7]]); + $param = new Parameter(['name' => 'baz']); + $request = $location->visit($command, $request, $param); + + $this->assertEquals('foo=bar&baz[0]=6&baz[1]=7', urldecode($request->getUri()->getQuery())); + } + + /** + * @group RequestLocation + */ + public function testAddsAdditionalProperties() + { + $location = new QueryLocation(); + $command = new Command('foo', ['foo' => 'bar']); + $command['add'] = 'props'; + $operation = new Operation([ + 'additionalParameters' => [ + 'location' => 'query' + ] + ]); + $request = new Request('POST', 'http://httbin.org'); + $request = $location->after($command, $request, $operation); + + $this->assertEquals('props', Psr7\parse_query($request->getUri()->getQuery())['add']); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/XmlLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/XmlLocationTest.php new file mode 100644 index 00000000..ce789d4e --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/RequestLocation/XmlLocationTest.php @@ -0,0 +1,525 @@ + 'bar']); + $command['bar'] = 'test'; + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $location->visit($command, $request, $param); + $param = new Parameter(['name' => 'bar']); + $location->visit($command, $request, $param); + $operation = new Operation(); + $request = $location->after($command, $request, $operation); + $xml = $request->getBody()->getContents(); + + $this->assertEquals('' . "\n" + . 'bartest' . "\n", $xml); + $header = $request->getHeader('Content-Type'); + $this->assertArraySubset([0 => 'application/xml'], $header); + } + + /** + * @group RequestLocation + */ + public function testCreatesBodyForEmptyDocument() + { + $location = new XmlLocation(); + $command = new Command('foo', ['foo' => 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $operation = new Operation([ + 'data' => ['xmlAllowEmpty' => true] + ]); + $request = $location->after($command, $request, $operation); + $xml = $request->getBody()->getContents(); + $this->assertEquals('' . "\n" + . '' . "\n", $xml); + + $header = $request->getHeader('Content-Type'); + $this->assertArraySubset([0 => 'application/xml'], $header); + } + + /** + * @group RequestLocation + */ + public function testAddsAdditionalParameters() + { + $location = new XmlLocation('xml', 'test'); + $command = new Command('foo', ['foo' => 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $command['foo'] = 'bar'; + $location->visit($command, $request, $param); + $operation = new Operation([ + 'additionalParameters' => [ + 'location' => 'xml' + ] + ]); + $command['bam'] = 'boo'; + $request = $location->after($command, $request, $operation); + $xml = $request->getBody()->getContents(); + $this->assertEquals('' . "\n" + . 'barbarboo' . "\n", $xml); + $header = $request->getHeader('Content-Type'); + $this->assertArraySubset([0 => 'test'], $header); + } + + /** + * @group RequestLocation + */ + public function testAllowsXmlEncoding() + { + $location = new XmlLocation(); + $operation = new Operation([ + 'data' => ['xmlEncoding' => 'UTF-8'] + ]); + $command = new Command('foo', ['foo' => 'bar']); + $request = new Request('POST', 'http://httbin.org'); + $param = new Parameter(['name' => 'foo']); + $command['foo'] = 'bar'; + $location->visit($command, $request, $param); + $request = $location->after($command, $request, $operation); + $xml = $request->getBody()->getContents(); + $this->assertEquals('' . "\n" + . 'bar' . "\n", $xml); + } + + public function xmlProvider() + { + return [ + [ + [ + 'data' => [ + 'xmlRoot' => [ + 'name' => 'test', + 'namespaces' => 'http://foo.com' + ] + ], + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string' + ], + 'Baz' => [ + 'location' => 'xml', + 'type' => 'string' + ] + ] + ], + [ + 'Foo' => 'test', + 'Baz' => 'bar' + ], + 'testbar' + ], + // Ensure that the content-type is not added + [ + [ + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string' + ] + ] + ], + [], + '' + ], + // Test with adding attributes and no namespace + [ + [ + 'data' => [ + 'xmlRoot' => [ + 'name' => 'test' + ] + ], + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string', + 'data' => ['xmlAttribute' => true] + ] + ] + ], + [ + 'Foo' => 'test', + 'Baz' => 'bar' + ], + '' + ], + // Test adding with an array + [ + [ + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string' + ], + 'Baz' => [ + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'type' => 'numeric', + 'sentAs' => 'Bar' + ] + ] + ] + ], + ['Foo' => 'test', 'Baz' => [1, 2]], + 'test12' + ], + // Test adding an object + [ + [ + 'parameters' => [ + 'Foo' => ['location' => 'xml', 'type' => 'string'], + 'Baz' => [ + 'type' => 'object', + 'location' => 'xml', + 'properties' => [ + 'Bar' => ['type' => 'string'], + 'Bam' => [] + ] + ] + ] + ], + [ + 'Foo' => 'test', + 'Baz' => [ + 'Bar' => 'abc', + 'Bam' => 'foo' + ] + ], + 'testabcfoo' + ], + // Add an array that contains an object + [ + [ + 'parameters' => [ + 'Baz' => [ + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'type' => 'object', + 'sentAs' => 'Bar', + 'properties' => ['A' => [], 'B' => []] + ] + ] + ] + ], + ['Baz' => [ + [ + 'A' => '1', + 'B' => '2' + ], + [ + 'A' => '3', + 'B' => '4' + ] + ]], + '1234' + ], + // Add an object of attributes + [ + [ + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string' + ], + 'Baz' => [ + 'type' => 'object', + 'location' => 'xml', + 'properties' => [ + 'Bar' => [ + 'type' => 'string', + 'data' => [ + 'xmlAttribute' => true + ] + ], + 'Bam' => [] + ] + ] + ] + ], + [ + 'Foo' => 'test', + 'Baz' => [ + 'Bar' => 'abc', + 'Bam' => 'foo' + ] + ], + 'testfoo' + ], + // Check order doesn't matter + [ + [ + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string' + ], + 'Baz' => [ + 'type' => 'object', + 'location' => 'xml', + 'properties' => [ + 'Bar' => [ + 'type' => 'string', + 'data' => [ + 'xmlAttribute' => true + ] + ], + 'Bam' => [] + ] + ] + ] + ], + [ + 'Foo' => 'test', + 'Baz' => [ + 'Bam' => 'foo', + 'Bar' => 'abc' + ] + ], + 'testfoo' + ], + // Add values with custom namespaces + [ + [ + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string', + 'data' => [ + 'xmlNamespace' => 'http://foo.com' + ] + ] + ] + ], + ['Foo' => 'test'], + 'test' + ], + // Add attributes with custom namespace prefix + [ + [ + 'parameters' => [ + 'Wrap' => [ + 'type' => 'object', + 'location' => 'xml', + 'properties' => [ + 'Foo' => [ + 'type' => 'string', + 'sentAs' => 'xsi:baz', + 'data' => [ + 'xmlNamespace' => 'http://foo.com', + 'xmlAttribute' => true + ] + ] + ] + ], + ] + ], + ['Wrap' => [ + 'Foo' => 'test' + ]], + '' + ], + // Add nodes with custom namespace prefix + [ + [ + 'parameters' => [ + 'Wrap' => [ + 'type' => 'object', + 'location' => 'xml', + 'properties' => [ + 'Foo' => [ + 'type' => 'string', + 'sentAs' => 'xsi:Foo', + 'data' => [ + 'xmlNamespace' => 'http://foobar.com' + ] + ] + ] + ], + ] + ], + ['Wrap' => [ + 'Foo' => 'test' + ]], + 'test' + ], + [ + [ + 'parameters' => [ + 'Foo' => [ + 'location' => 'xml', + 'type' => 'string', + 'data' => [ + 'xmlNamespace' => 'http://foo.com' + ] + ] + ] + ], + ['Foo' => '

This is a title

'], + 'This is a title]]>' + ], + // Flat array at top level + [ + [ + 'parameters' => [ + 'Bars' => [ + 'type' => 'array', + 'data' => ['xmlFlattened' => true], + 'location' => 'xml', + 'items' => [ + 'type' => 'object', + 'sentAs' => 'Bar', + 'properties' => [ + 'A' => [], + 'B' => [] + ] + ] + ], + 'Boos' => [ + 'type' => 'array', + 'data' => ['xmlFlattened' => true], + 'location' => 'xml', + 'items' => [ + 'sentAs' => 'Boo', + 'type' => 'string' + ] + ] + ] + ], + [ + 'Bars' => [ + ['A' => '1', 'B' => '2'], + ['A' => '3', 'B' => '4'] + ], + 'Boos' => ['test', '123'] + ], + '1234test123' + ], + // Nested flat arrays + [ + [ + 'parameters' => [ + 'Delete' => [ + 'type' => 'object', + 'location' => 'xml', + 'properties' => [ + 'Items' => [ + 'type' => 'array', + 'data' => ['xmlFlattened' => true], + 'items' => [ + 'type' => 'object', + 'sentAs' => 'Item', + 'properties' => [ + 'A' => [], + 'B' => [] + ] + ] + ] + ] + ] + ] + ], + [ + 'Delete' => [ + 'Items' => [ + ['A' => '1', 'B' => '2'], + ['A' => '3', 'B' => '4'] + ] + ] + ], + '1234' + ], + // Test adding root node attributes after nodes + [ + [ + 'data' => [ + 'xmlRoot' => [ + 'name' => 'test' + ] + ], + 'parameters' => [ + 'Foo' => ['location' => 'xml', 'type' => 'string'], + 'Baz' => ['location' => 'xml', 'type' => 'string', 'data' => ['xmlAttribute' => true]], + ] + ], + ['Foo' => 'test', 'Baz' => 'bar'], + 'test' + ], + ]; + } + + /** + * @param array $operation + * @param array $input + * @param string $xml + * @dataProvider xmlProvider + * @group RequestLocation + */ + public function testSerializesXml(array $operation, array $input, $xml) + { + $container = []; + $history = Middleware::history($container); + $mock = new MockHandler([new Response(200)]); + + $stack = new HandlerStack($mock); + $stack->push($history); + $operation['uri'] = 'http://httpbin.org'; + $client = new GuzzleClient( + new Client(['handler' => $stack]), + new Description([ + 'operations' => [ + 'foo' => $operation + ] + ]) + ); + + $command = $client->getCommand('foo', $input); + + $client->execute($command); + + $this->assertCount(1, $container); + + foreach ($container as $transaction) { + /** @var Request $request */ + $request = $transaction['request']; + if (empty($input)) { + if ($request->hasHeader('Content-Type')) { + $this->assertArraySubset([0 => ''], $request->getHeader('Content-Type')); + } + } else { + $this->assertArraySubset([0 => 'application/xml'], $request->getHeader('Content-Type')); + } + + $body = str_replace(["\n", ""], '', (string) $request->getBody()); + $this->assertEquals($xml, $body); + } + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/BodyLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/BodyLocationTest.php new file mode 100644 index 00000000..36eda588 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/BodyLocationTest.php @@ -0,0 +1,30 @@ + 'val', + 'filters' => ['strtoupper'] + ]); + $response = new Response(200, [], 'foo'); + $result = new Result(); + $result = $location->visit($result, $response, $parameter); + $this->assertEquals('FOO', $result['val']); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/HeaderLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/HeaderLocationTest.php new file mode 100644 index 00000000..763af38a --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/HeaderLocationTest.php @@ -0,0 +1,31 @@ + 'val', + 'sentAs' => 'X-Foo', + 'filters' => ['strtoupper'] + ]); + $response = new Response(200, ['X-Foo' => 'bar']); + $result = new Result(); + $result = $location->visit($result, $response, $parameter); + $this->assertEquals('BAR', $result['val']); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/JsonLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/JsonLocationTest.php new file mode 100644 index 00000000..52a44a8d --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/JsonLocationTest.php @@ -0,0 +1,581 @@ + 'val', + 'sentAs' => 'vim', + 'filters' => ['strtoupper'] + ]); + $response = new Response(200, [], '{"vim":"bar"}'); + $result = new Result(); + $result = $location->before($result, $response, $parameter); + $result = $location->visit($result, $response, $parameter); + $this->assertEquals('BAR', $result['val']); + } + /** + * @group ResponseLocation + * @param $name + * @param $expected + */ + public function testVisitsWiredArray() + { + $json = ['car_models' => ['ferrari', 'aston martin']]; + $body = \GuzzleHttp\json_encode($json); + $response = new Response(200, ['Content-Type' => 'application/json'], $body); + $mock = new MockHandler([$response]); + + $guzzle = new Client(['handler' => $mock]); + + $description = new Description([ + 'operations' => [ + 'getCars' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'Cars' + ] + ], + 'models' => [ + 'Cars' => [ + 'type' => 'object', + 'location' => 'json', + 'properties' => [ + 'cars' => [ + 'type' => 'array', + 'sentAs' => 'car_models', + 'items' => [ + 'type' => 'object', + ] + ] + ], + ] + ] + ]); + + $guzzle = new GuzzleClient($guzzle, $description); + $result = $guzzle->getCars(); + + $this->assertEquals(['cars' => ['ferrari', 'aston martin']], $result->toArray()); + } + + /** + * @group ResponseLocation + */ + public function testVisitsAdditionalProperties() + { + $location = new JsonLocation(); + $parameter = new Parameter(); + $model = new Parameter(['additionalProperties' => ['location' => 'json']]); + $response = new Response(200, [], '{"vim":"bar","qux":[1,2]}'); + $result = new Result(); + $result = $location->before($result, $response, $parameter); + $result = $location->visit($result, $response, $parameter); + $result = $location->after($result, $response, $model); + $this->assertEquals('bar', $result['vim']); + $this->assertEquals([1, 2], $result['qux']); + } + + /** + * @group ResponseLocation + */ + public function testVisitsAdditionalPropertiesWithEmptyResponse() + { + $location = new JsonLocation(); + $parameter = new Parameter(); + $model = new Parameter(['additionalProperties' => ['location' => 'json']]); + $response = new Response(204); + $result = new Result(); + $result = $location->before($result, $response, $parameter); + $result = $location->visit($result, $response, $parameter); + $result = $location->after($result, $response, $model); + $this->assertEquals([], $result->toArray()); + } + + public function jsonProvider() + { + return [ + [null, [['foo' => 'BAR'], ['baz' => 'BAM']]], + ['under_me', ['under_me' => [['foo' => 'BAR'], ['baz' => 'BAM']]]], + ]; + } + + /** + * @dataProvider jsonProvider + * @group ResponseLocation + * @param $name + * @param $expected + */ + public function testVisitsTopLevelArrays($name, $expected) + { + $json = [ + ['foo' => 'bar'], + ['baz' => 'bam'], + ]; + $body = \GuzzleHttp\json_encode($json); + $response = new Response(200, ['Content-Type' => 'application/json'], $body); + $mock = new MockHandler([$response]); + + $guzzle = new Client(['handler' => $mock]); + + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j' + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'array', + 'location' => 'json', + 'name' => $name, + 'items' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'type' => 'string', + 'filters' => ['strtoupper'] + ] + ] + ] + ] + ]); + $guzzle = new GuzzleClient($guzzle, $description); + /** @var ResultInterface $result */ + $result = $guzzle->foo(); + $this->assertEquals($expected, $result->toArray()); + } + + /** + * @group ResponseLocation + */ + public function testVisitsNestedArrays() + { + $json = [ + 'scalar' => 'foo', + 'nested' => [ + 'bar', + 'baz' + ] + ]; + $body = \GuzzleHttp\json_encode($json); + $response = new Response(200, ['Content-Type' => 'application/json'], $body); + $mock = new MockHandler([$response]); + + $httpClient = new Client(['handler' => $mock]); + + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j' + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object', + 'location' => 'json', + 'properties' => [ + 'scalar' => ['type' => 'string'], + 'nested' => [ + 'type' => 'array', + 'items' => ['type' => 'string'] + ] + ] + ] + ] + ]); + $guzzle = new GuzzleClient($httpClient, $description); + /** @var ResultInterface $result */ + $result = $guzzle->foo(); + $expected = [ + 'scalar' => 'foo', + 'nested' => [ + 'bar', + 'baz' + ] + ]; + $this->assertEquals($expected, $result->toArray()); + } + + public function nestedProvider() + { + return [ + [ + [ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j' + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object', + 'properties' => [ + 'nested' => [ + 'location' => 'json', + 'type' => 'object', + 'properties' => [ + 'foo' => ['type' => 'string'], + 'bar' => ['type' => 'number'], + 'bam' => [ + 'type' => 'object', + 'properties' => [ + 'abc' => [ + 'type' => 'number' + ] + ] + ] + ] + ] + ], + 'additionalProperties' => [ + 'location' => 'json', + 'type' => 'string', + 'filters' => ['strtoupper'] + ] + ] + ] + ] + ], + [ + [ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j' + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object', + 'location' => 'json', + 'properties' => [ + 'nested' => [ + 'type' => 'object', + 'properties' => [ + 'foo' => ['type' => 'string'], + 'bar' => ['type' => 'number'], + 'bam' => [ + 'type' => 'object', + 'properties' => [ + 'abc' => [ + 'type' => 'number' + ] + ] + ] + ] + ] + ], + 'additionalProperties' => [ + 'type' => 'string', + 'filters' => ['strtoupper'] + ] + ] + ] + ] + ] + ]; + } + + /** + * @dataProvider nestedProvider + * @group ResponseLocation + */ + public function testVisitsNestedProperties($desc) + { + $json = [ + 'nested' => [ + 'foo' => 'abc', + 'bar' => 123, + 'bam' => [ + 'abc' => 456 + ] + ], + 'baz' => 'boo' + ]; + $body = \GuzzleHttp\json_encode($json); + $response = new Response(200, ['Content-Type' => 'application/json'], $body); + $mock = new MockHandler([$response]); + + $httpClient = new Client(['handler' => $mock]); + + $description = new Description($desc); + $guzzle = new GuzzleClient($httpClient, $description); + /** @var ResultInterface $result */ + $result = $guzzle->foo(); + $expected = [ + 'nested' => [ + 'foo' => 'abc', + 'bar' => 123, + 'bam' => [ + 'abc' => 456 + ] + ], + 'baz' => 'BOO' + ]; + + $this->assertEquals($expected, $result->toArray()); + } + + /** + * @group ResponseLocation + */ + public function testVisitsNullResponseProperties() + { + + $json = [ + 'data' => [ + 'link' => null + ] + ]; + + $body = \GuzzleHttp\json_encode($json); + $response = new Response(200, ['Content-Type' => 'application/json'], $body); + $mock = new MockHandler([$response]); + + $httpClient = new Client(['handler' => $mock]); + + $description = new Description( + [ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j' + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object', + 'location' => 'json', + 'properties' => [ + 'scalar' => ['type' => 'string'], + 'data' => [ + 'type' => 'object', + 'location' => 'json', + 'properties' => [ + 'link' => [ + 'name' => 'val', + 'type' => 'string', + 'location' => 'json' + ], + ], + 'additionalProperties' => false + ] + ] + ] + ] + ] + ); + $guzzle = new GuzzleClient($httpClient, $description); + /** @var ResultInterface $result */ + $result = $guzzle->foo(); + + $expected = [ + 'data' => [ + 'link' => null + ] + ]; + + $this->assertEquals($expected, $result->toArray()); + } + + /** + * @group ResponseLocation + */ + public function testVisitsNestedArrayOfArrays() + { + $json = [ + 'scalar' => 'foo', + 'nested' => [ + [ + 'bar' => 123, + 'baz' => false, + ], + [ + 'bar' => 345, + 'baz' => true, + ], + [ + 'bar' => 678, + 'baz' => true, + ], + ] + ]; + + $body = \GuzzleHttp\json_encode($json); + $response = new Response(200, ['Content-Type' => 'application/json'], $body); + $mock = new MockHandler([$response]); + + $httpClient = new Client(['handler' => $mock]); + + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j' + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object', + 'properties' => [ + 'scalar' => [ + // for some reason (probably because location is also set on array of arrays) + // array of arrays sibling elements must have location set to `json` + // otherwise JsonLocation ignores them + 'location' => 'json', + 'type' => 'string' + ], + 'nested' => [ + // array of arrays type must be set to `array` + // without that JsonLocation throws an exception + 'type' => 'array', + // for array of arrays `location` must be set to `json` + // otherwise JsonLocation returns an empty array + 'location' => 'json', + 'items' => [ + // although this is array of arrays, array items type + // must be set as `object` + 'type' => 'object', + 'properties' => [ + 'bar' => [ + 'type' => 'integer', + ], + 'baz' => [ + 'type' => 'boolean', + ], + ], + ] + ] + ] + ] + ] + ]); + + $guzzle = new GuzzleClient($httpClient, $description); + /** @var ResultInterface $result */ + $result = $guzzle->foo(); + $expected = [ + 'scalar' => 'foo', + 'nested' => [ + [ + 'bar' => 123, + 'baz' => false, + ], + [ + 'bar' => 345, + 'baz' => true, + ], + [ + 'bar' => 678, + 'baz' => true, + ], + ] + ]; + + $this->assertEquals($expected, $result->toArray()); + } + + /** + * @group ResponseLocation + */ + public function testVisitsNestedArrayOfObjects() + { + $json = json_decode('{"scalar":"foo","nested":[{"bar":123,"baz":false},{"bar":345,"baz":true},{"bar":678,"baz":true}]}'); + + $body = \GuzzleHttp\json_encode($json); + $response = new Response(200, ['Content-Type' => 'application/json'], $body); + $mock = new MockHandler([$response]); + + $httpClient = new Client(['handler' => $mock]); + + $description = new Description([ + 'operations' => [ + 'foo' => [ + 'uri' => 'http://httpbin.org', + 'httpMethod' => 'GET', + 'responseModel' => 'j' + ] + ], + 'models' => [ + 'j' => [ + 'type' => 'object', + 'location' => 'json', + 'properties' => [ + 'scalar' => [ + 'type' => 'string' + ], + 'nested' => [ + // array of objects type must be set to `array` + // without that JsonLocation throws an exception + 'type' => 'array', + 'items' => [ + // array elements type must be set to `object` + 'type' => 'object', + 'properties' => [ + 'bar' => [ + 'type' => 'integer', + ], + 'baz' => [ + 'type' => 'boolean', + ], + ], + ] + ] + ] + ] + ] + ]); + + $guzzle = new GuzzleClient($httpClient, $description); + /** @var ResultInterface $result */ + $result = $guzzle->foo(); + $expected = [ + 'scalar' => 'foo', + 'nested' => [ + [ + 'bar' => 123, + 'baz' => false, + ], + [ + 'bar' => 345, + 'baz' => true, + ], + [ + 'bar' => 678, + 'baz' => true, + ], + ] + ]; + $this->assertEquals($expected, $result->toArray()); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/ReasonPhraseLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/ReasonPhraseLocationTest.php new file mode 100644 index 00000000..bfe77172 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/ReasonPhraseLocationTest.php @@ -0,0 +1,30 @@ + 'val', + 'filters' => ['strtolower'] + ]); + $response = new Response(200); + $result = new Result(); + $result = $location->visit($result, $response, $parameter); + $this->assertEquals('ok', $result['val']); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/StatusCodeLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/StatusCodeLocationTest.php new file mode 100644 index 00000000..1946e62b --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/StatusCodeLocationTest.php @@ -0,0 +1,27 @@ + 'val']); + $response = new Response(200); + $result = new Result(); + $result = $location->visit($result, $response, $parameter); + $this->assertEquals(200, $result['val']); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/XmlLocationTest.php b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/XmlLocationTest.php new file mode 100644 index 00000000..4e398ba9 --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/XmlLocationTest.php @@ -0,0 +1,795 @@ + 'val', + 'sentAs' => 'vim', + 'filters' => ['strtoupper'] + ]); + $model = new Parameter(); + $response = new Response(200, [], \GuzzleHttp\Psr7\stream_for('bar')); + $result = new Result(); + $result = $location->before($result, $response, $model); + $result = $location->visit($result, $response, $parameter); + $result = $location->after($result, $response, $model); + $this->assertEquals('BAR', $result['val']); + } + + /** + * @group ResponseLocation + */ + public function testVisitsAdditionalProperties() + { + $location = new XmlLocation(); + $parameter = new Parameter(); + $model = new Parameter(['additionalProperties' => ['location' => 'xml']]); + $response = new Response(200, [], \GuzzleHttp\Psr7\stream_for('bar')); + $result = new Result(); + $result = $location->before($result, $response, $parameter); + $result = $location->visit($result, $response, $parameter); + $result = $location->after($result, $response, $model); + $this->assertEquals('bar', $result['vim']); + } + + /** + * @group ResponseLocation + */ + public function testEnsuresFlatArraysAreFlat() + { + $param = new Parameter([ + 'location' => 'xml', + 'name' => 'foo', + 'type' => 'array', + 'items' => ['type' => 'string'], + ]); + + $xml = 'barbaz'; + $this->xmlTest($param, $xml, ['foo' => ['bar', 'baz']]); + $this->xmlTest($param, 'bar', ['foo' => ['bar']]); + } + + public function xmlDataProvider() + { + $param = new Parameter([ + 'location' => 'xml', + 'name' => 'Items', + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'name' => 'Item', + 'properties' => [ + 'Bar' => ['type' => 'string'], + 'Baz' => ['type' => 'string'], + ], + ], + ]); + + return [ + [$param, '12', [ + 'Items' => [ + ['Bar' => 1], + ['Bar' => 2], + ], + ]], + [$param, '1', [ + 'Items' => [ + ['Bar' => 1], + ] + ]], + [$param, '', [ + 'Items' => [], + ]] + ]; + } + + /** + * @dataProvider xmlDataProvider + * @group ResponseLocation + */ + public function testEnsuresWrappedArraysAreInCorrectLocations($param, $xml, $expected) + { + $location = new XmlLocation(); + $model = new Parameter(); + $response = new Response(200, [], \GuzzleHttp\Psr7\stream_for($xml)); + $result = new Result(); + $result = $location->before($result, $response, $param); + $result = $location->visit($result, $response, $param); + $result = $location->after($result, $response, $model); + $this->assertEquals($expected, $result->toArray()); + } + + /** + * @group ResponseLocation + */ + public function testCanRenameValues() + { + $param = new Parameter([ + 'name' => 'TerminatingInstances', + 'type' => 'array', + 'location' => 'xml', + 'sentAs' => 'instancesSet', + 'items' => [ + 'name' => 'item', + 'type' => 'object', + 'sentAs' => 'item', + 'properties' => [ + 'InstanceId' => [ + 'type' => 'string', + 'sentAs' => 'instanceId', + ], + 'CurrentState' => [ + 'type' => 'object', + 'sentAs' => 'currentState', + 'properties' => [ + 'Code' => [ + 'type' => 'numeric', + 'sentAs' => 'code', + ], + 'Name' => [ + 'type' => 'string', + 'sentAs' => 'name', + ], + ], + ], + 'PreviousState' => [ + 'type' => 'object', + 'sentAs' => 'previousState', + 'properties' => [ + 'Code' => [ + 'type' => 'numeric', + 'sentAs' => 'code', + ], + 'Name' => [ + 'type' => 'string', + 'sentAs' => 'name', + ], + ], + ], + ], + ] + ]); + + $xml = ' + + + + i-3ea74257 + + 32 + shutting-down + + + 16 + running + + + + + '; + + $this->xmlTest($param, $xml, [ + 'TerminatingInstances' => [ + [ + 'InstanceId' => 'i-3ea74257', + 'CurrentState' => [ + 'Code' => '32', + 'Name' => 'shutting-down', + ], + 'PreviousState' => [ + 'Code' => '16', + 'Name' => 'running', + ], + ], + ], + ]); + } + + /** + * @group ResponseLocation + */ + public function testCanRenameAttributes() + { + $param = new Parameter([ + 'name' => 'RunningQueues', + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'type' => 'object', + 'sentAs' => 'item', + 'properties' => [ + 'QueueId' => [ + 'type' => 'string', + 'sentAs' => 'queue_id', + 'data' => [ + 'xmlAttribute' => true, + ], + ], + 'CurrentState' => [ + 'type' => 'object', + 'properties' => [ + 'Code' => [ + 'type' => 'numeric', + 'sentAs' => 'code', + 'data' => [ + 'xmlAttribute' => true, + ], + ], + 'Name' => [ + 'sentAs' => 'name', + 'data' => [ + 'xmlAttribute' => true, + ], + ], + ], + ], + 'PreviousState' => [ + 'type' => 'object', + 'properties' => [ + 'Code' => [ + 'type' => 'numeric', + 'sentAs' => 'code', + 'data' => [ + 'xmlAttribute' => true, + ], + ], + 'Name' => [ + 'sentAs' => 'name', + 'data' => [ + 'xmlAttribute' => true, + ], + ], + ], + ], + ], + ] + ]); + + $xml = ' + + + + + + + + '; + + $this->xmlTest($param, $xml, [ + 'RunningQueues' => [ + [ + 'QueueId' => 'q-3ea74257', + 'CurrentState' => [ + 'Code' => '32', + 'Name' => 'processing', + ], + 'PreviousState' => [ + 'Code' => '16', + 'Name' => 'wait', + ], + ], + ], + ]); + } + + /** + * @group ResponseLocation + */ + public function testAddsEmptyArraysWhenValueIsMissing() + { + $param = new Parameter([ + 'name' => 'Foo', + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'Baz' => ['type' => 'array'], + 'Bar' => [ + 'type' => 'object', + 'properties' => [ + 'Baz' => ['type' => 'array'], + ], + ], + ], + ], + ]); + + $xml = ''; + + $this->xmlTest($param, $xml, [ + 'Foo' => [ + [ + 'Bar' => [], + ] + ], + ]); + } + + /** + * @group issue-399, ResponseLocation + * @link https://github.com/guzzle/guzzle/issues/399 + */ + public function testDiscardingUnknownProperties() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'additionalProperties' => false, + 'properties' => [ + 'bar' => [ + 'type' => 'string', + 'name' => 'bar', + ], + ], + ]); + + $xml = ' + + + 15 + discard me + + + '; + + $this->xmlTest($param, $xml, [ + 'foo' => [ + 'bar' => 15 + ] + ]); + } + + /** + * @group issue-399, ResponseLocation + * @link https://github.com/guzzle/guzzle/issues/399 + */ + public function testDiscardingUnknownPropertiesWithAliasing() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'additionalProperties' => false, + 'properties' => [ + 'bar' => [ + 'name' => 'bar', + 'sentAs' => 'baz', + ], + ], + ]); + + $xml = ' + + + 15 + discard me + + + '; + + $this->xmlTest($param, $xml, [ + 'foo' => [ + 'bar' => 15, + ], + ]); + } + + /** + * @group ResponseLocation + */ + public function testProcessingOfNestedAdditionalProperties() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => [ + 'bar' => [ + 'name' => 'bar', + 'sentAs' => 'baz', + ], + 'nestedNoAdditional' => [ + 'type' => 'object', + 'additionalProperties' => false, + 'properties' => [ + 'id' => [ + 'type' => 'integer', + ], + ], + ], + 'nestedWithAdditional' => [ + 'type' => 'object', + 'additionalProperties' => true, + ], + 'nestedWithAdditionalSchema' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'type' => 'array', + 'items' => [ + 'type' => 'string', + ], + ], + ], + ], + ]); + + $xml = ' + + + 15 + include me + + 15 + discard me + + + 15 + include me + + + + 1 + 2 + 3 + + + A + B + C + + + + + '; + + $this->xmlTest($param, $xml, [ + 'foo' => [ + 'bar' => '15', + 'additional' => 'include me', + 'nestedNoAdditional' => [ + 'id' => '15', + ], + 'nestedWithAdditional' => [ + 'id' => '15', + 'additional' => 'include me', + ], + 'nestedWithAdditionalSchema' => [ + 'arrayA' => ['1', '2', '3'], + 'arrayB' => ['A', 'B', 'C'], + ], + ], + ]); + } + + /** + * @group ResponseLocation + */ + public function testConvertsMultipleAssociativeElementsToArray() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'additionalProperties' => true, + ]); + + $xml = ' + + + 15 + 25 + hi + test + + + + '; + + $this->xmlTest($param, $xml, [ + 'foo' => [ + 'baz' => ['15', '25'], + 'bar' => 'hi', + 'bam' => [ + 'test', + ['@attributes' => ['attr' => 'hi']] + ] + ] + ]); + } + + /** + * @group ResponseLocation + */ + public function testUnderstandsNamespaces() + { + $param = new Parameter([ + 'name' => 'nstest', + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'name' => 'item', + 'type' => 'object', + 'sentAs' => 'item', + 'properties' => [ + 'id' => [ + 'type' => 'string', + ], + 'isbn:number' => [ + 'type' => 'string', + ], + 'meta' => [ + 'type' => 'object', + 'sentAs' => 'abstract:meta', + 'properties' => [ + 'foo' => [ + 'type' => 'numeric', + ], + 'bar' => [ + 'type' => 'object', + 'properties' =>[ + 'attribute' => [ + 'type' => 'string', + 'data' => [ + 'xmlAttribute' => true, + 'xmlNs' => 'abstract', + ], + ], + ], + ], + ], + ], + 'gamma' => [ + 'type' => 'object', + 'data' => [ + 'xmlNs' => 'abstract', + ], + 'additionalProperties' => true, + ], + 'nonExistent' => [ + 'type' => 'object', + 'data' => [ + 'xmlNs' => 'abstract', + ], + 'additionalProperties' => true, + ], + 'nonExistent2' => [ + 'type' => 'object', + 'additionalProperties' => true, + ], + ], + ], + ]); + + $xml = ' + + + + 101 + 1568491379 + + 10 + + + + bar + + + + 102 + 1568491999 + + 20 + + + + baz + + + + + '; + + $this->xmlTest($param, $xml, [ + 'nstest' => [ + [ + 'id' => '101', + 'isbn:number' => 1568491379, + 'meta' => [ + 'foo' => 10, + 'bar' => [ + 'attribute' => 'foo', + ], + ], + 'gamma' => [ + 'foo' => 'bar', + ], + ], + [ + 'id' => '102', + 'isbn:number' => 1568491999, + 'meta' => [ + 'foo' => 20, + 'bar' => [ + 'attribute' => 'bar' + ], + ], + 'gamma' => [ + 'foo' => 'baz', + ], + ], + ], + ]); + } + + /** + * @group ResponseLocation + */ + public function testCanWalkUndefinedPropertiesWithNamespace() + { + $param = new Parameter([ + 'name' => 'nstest', + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'name' => 'item', + 'type' => 'object', + 'sentAs' => 'item', + 'additionalProperties' => [ + 'type' => 'object', + 'data' => [ + 'xmlNs' => 'abstract' + ], + ], + 'properties' => [ + 'id' => [ + 'type' => 'string', + ], + 'isbn:number' => [ + 'type' => 'string', + ], + ], + ], + ]); + + $xml = ' + + + + 101 + 1568491379 + + 10 + baz + + + + 102 + 1568491999 + + 20 + foo + + + + + '; + + $this->xmlTest($param, $xml, [ + 'nstest' => [ + [ + 'id' => '101', + 'isbn:number' => 1568491379, + 'meta' => [ + 'foo' => 10, + 'bar' => 'baz', + ], + ], + [ + 'id' => '102', + 'isbn:number' => 1568491999, + 'meta' => [ + 'foo' => 20, + 'bar' => 'foo', + ], + ], + ] + ]); + } + + /** + * @group ResponseLocation + */ + public function testCanWalkSimpleArrayWithNamespace() + { + $param = new Parameter([ + 'name' => 'nstest', + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'type' => 'string', + 'sentAs' => 'number', + 'data' => [ + 'xmlNs' => 'isbn' + ], + ], + ]); + + $xml = ' + + + 1568491379 + 1568491999 + 1568492999 + + + '; + + $this->xmlTest($param, $xml, [ + 'nstest' => [ + 1568491379, + 1568491999, + 1568492999, + ], + ]); + } + + /** + * @group ResponseLocation + */ + public function testCanWalkSimpleArrayWithNamespace2() + { + $param = new Parameter([ + 'name' => 'nstest', + 'type' => 'array', + 'location' => 'xml', + 'items' => [ + 'type' => 'string', + 'sentAs' => 'isbn:number', + ] + ]); + + $xml = ' + + + 1568491379 + 1568491999 + 1568492999 + + + '; + + $this->xmlTest($param, $xml, [ + 'nstest' => [ + 1568491379, + 1568491999, + 1568492999, + ], + ]); + } + + private function xmlTest(Parameter $param, $xml, $expected) + { + $location = new XmlLocation(); + $model = new Parameter(); + $response = new Response(200, [], \GuzzleHttp\Psr7\stream_for($xml)); + $result = new Result(); + $result = $location->before($result, $response, $param); + $result = $location->visit($result, $response, $param); + $result = $location->after($result, $response, $model); + $this->assertEquals($expected, $result->toArray()); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/SchemaFormatterTest.php b/vendor/guzzlehttp/guzzle-services/tests/SchemaFormatterTest.php new file mode 100644 index 00000000..a8e051ac --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/SchemaFormatterTest.php @@ -0,0 +1,60 @@ +assertEquals($result, (new SchemaFormatter)->format($format, $value)); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testValidatesDateTimeInput() + { + (new SchemaFormatter)->format('date-time', false); + } + + public function testEnsuresTimestampsAreIntegers() + { + $t = time(); + $result = (new SchemaFormatter)->format('timestamp', $t); + $this->assertSame($t, $result); + $this->assertInternalType('int', $result); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/SchemaValidatorTest.php b/vendor/guzzlehttp/guzzle-services/tests/SchemaValidatorTest.php new file mode 100644 index 00000000..6db3d24c --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/SchemaValidatorTest.php @@ -0,0 +1,330 @@ +validator = new SchemaValidator(); + } + + public function testValidatesArrayListsAreNumericallyIndexed() + { + $value = [[1]]; + $this->assertFalse($this->validator->validate($this->getComplexParam(), $value)); + $this->assertEquals( + ['[Foo][0] must be an array of properties. Got a numerically indexed array.'], + $this->validator->getErrors() + ); + } + + public function testValidatesArrayListsContainProperItems() + { + $value = [true]; + $this->assertFalse($this->validator->validate($this->getComplexParam(), $value)); + $this->assertEquals( + ['[Foo][0] must be of type object'], + $this->validator->getErrors() + ); + } + + public function testAddsDefaultValuesInLists() + { + $value = [[]]; + $this->assertTrue($this->validator->validate($this->getComplexParam(), $value)); + $this->assertEquals([['Bar' => true]], $value); + } + + public function testMergesDefaultValuesInLists() + { + $value = [ + ['Baz' => 'hello!'], + ['Bar' => false], + ]; + $this->assertTrue($this->validator->validate($this->getComplexParam(), $value)); + $this->assertEquals([ + [ + 'Baz' => 'hello!', + 'Bar' => true, + ], + ['Bar' => false], + ], $value); + } + + public function testCorrectlyConvertsParametersToArrayWhenArraysArePresent() + { + $param = $this->getComplexParam(); + $result = $param->toArray(); + $this->assertInternalType('array', $result['items']); + $this->assertEquals('array', $result['type']); + $this->assertInstanceOf('GuzzleHttp\Command\Guzzle\Parameter', $param->getItems()); + } + + public function testEnforcesInstanceOfOnlyWhenObject() + { + $p = new Parameter([ + 'name' => 'foo', + 'type' => ['object', 'string'], + 'instanceOf' => get_class($this) + ]); + $this->assertTrue($this->validator->validate($p, $this)); + $s = 'test'; + $this->assertTrue($this->validator->validate($p, $s)); + } + + public function testConvertsObjectsToArraysWhenToArrayInterface() + { + $o = $this->getMockBuilder(ToArrayInterface::class) + ->setMethods(['toArray']) + ->getMockForAbstractClass(); + $o->expects($this->once()) + ->method('toArray') + ->will($this->returnValue(['foo' => 'bar'])); + $p = new Parameter([ + 'name' => 'test', + 'type' => 'object', + 'properties' => [ + 'foo' => ['required' => 'true'], + ], + ]); + $this->assertTrue($this->validator->validate($p, $o)); + } + + public function testMergesValidationErrorsInPropertiesWithParent() + { + $p = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'properties' => [ + 'bar' => ['type' => 'string', 'required' => true, 'description' => 'This is what it does'], + 'test' => ['type' => 'string', 'minLength' => 2, 'maxLength' => 5], + 'test2' => ['type' => 'string', 'minLength' => 2, 'maxLength' => 2], + 'test3' => ['type' => 'integer', 'minimum' => 100], + 'test4' => ['type' => 'integer', 'maximum' => 10], + 'test5' => ['type' => 'array', 'maxItems' => 2], + 'test6' => ['type' => 'string', 'enum' => ['a', 'bc']], + 'test7' => ['type' => 'string', 'pattern' => '/[0-9]+/'], + 'test8' => ['type' => 'number'], + 'baz' => [ + 'type' => 'array', + 'minItems' => 2, + 'required' => true, + "items" => ["type" => "string"], + ], + ], + ]); + + $value = [ + 'test' => 'a', + 'test2' => 'abc', + 'baz' => [false], + 'test3' => 10, + 'test4' => 100, + 'test5' => [1, 3, 4], + 'test6' => 'Foo', + 'test7' => 'abc', + 'test8' => 'abc', + ]; + + $this->assertFalse($this->validator->validate($p, $value)); + $this->assertEquals([ + '[foo][bar] is a required string: This is what it does', + '[foo][baz] must contain 2 or more elements', + '[foo][baz][0] must be of type string', + '[foo][test2] length must be less than or equal to 2', + '[foo][test3] must be greater than or equal to 100', + '[foo][test4] must be less than or equal to 10', + '[foo][test5] must contain 2 or fewer elements', + '[foo][test6] must be one of "a" or "bc"', + '[foo][test7] must match the following regular expression: /[0-9]+/', + '[foo][test8] must be of type number', + '[foo][test] length must be greater than or equal to 2', + ], $this->validator->getErrors()); + } + + public function testHandlesNullValuesInArraysWithDefaults() + { + $p = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'required' => true, + 'properties' => [ + 'bar' => [ + 'type' => 'object', + 'required' => true, + 'properties' => [ + 'foo' => ['default' => 'hi'], + ], + ], + ], + ]); + $value = []; + $this->assertTrue($this->validator->validate($p, $value)); + $this->assertEquals(['bar' => ['foo' => 'hi']], $value); + } + + public function testFailsWhenNullValuesInArraysWithNoDefaults() + { + $p = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'required' => true, + 'properties' => [ + 'bar' => [ + 'type' => 'object', + 'required' => true, + 'properties' => [ + 'foo' => ['type' => 'string'], + ], + ], + ], + ]); + $value = []; + $this->assertFalse($this->validator->validate($p, $value)); + $this->assertEquals(['[foo][bar] is a required object'], $this->validator->getErrors()); + } + + public function testChecksTypes() + { + $p = new SchemaValidator(); + $r = new \ReflectionMethod($p, 'determineType'); + $r->setAccessible(true); + $this->assertEquals('any', $r->invoke($p, 'any', 'hello')); + $this->assertEquals(false, $r->invoke($p, 'foo', 'foo')); + $this->assertEquals('string', $r->invoke($p, 'string', 'hello')); + $this->assertEquals(false, $r->invoke($p, 'string', false)); + $this->assertEquals('integer', $r->invoke($p, 'integer', 1)); + $this->assertEquals(false, $r->invoke($p, 'integer', 'abc')); + $this->assertEquals('numeric', $r->invoke($p, 'numeric', 1)); + $this->assertEquals('numeric', $r->invoke($p, 'numeric', '1')); + $this->assertEquals('number', $r->invoke($p, 'number', 1)); + $this->assertEquals('number', $r->invoke($p, 'number', '1')); + $this->assertEquals(false, $r->invoke($p, 'numeric', 'a')); + $this->assertEquals('boolean', $r->invoke($p, 'boolean', true)); + $this->assertEquals('boolean', $r->invoke($p, 'boolean', false)); + $this->assertEquals(false, $r->invoke($p, 'boolean', 'false')); + $this->assertEquals('null', $r->invoke($p, 'null', null)); + $this->assertEquals(false, $r->invoke($p, 'null', 'abc')); + $this->assertEquals('array', $r->invoke($p, 'array', [])); + $this->assertEquals(false, $r->invoke($p, 'array', 'foo')); + } + + public function testValidatesFalseAdditionalProperties() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'properties' => [ + 'bar' => ['type' => 'string'], + ], + 'additionalProperties' => false, + ]); + $value = ['test' => '123']; + $this->assertFalse($this->validator->validate($param, $value)); + $this->assertEquals(['[foo][test] is not an allowed property'], $this->validator->getErrors()); + $value = ['bar' => '123']; + $this->assertTrue($this->validator->validate($param, $value)); + } + + public function testAllowsUndefinedAdditionalProperties() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'properties' => [ + 'bar' => ['type' => 'string'], + ] + ]); + $value = ['test' => '123']; + $this->assertTrue($this->validator->validate($param, $value)); + } + + public function testValidatesAdditionalProperties() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'properties' => [ + 'bar' => ['type' => 'string'], + ], + 'additionalProperties' => ['type' => 'integer'], + ]); + $value = ['test' => 'foo']; + $this->assertFalse($this->validator->validate($param, $value)); + $this->assertEquals(['[foo][test] must be of type integer'], $this->validator->getErrors()); + } + + public function testValidatesAdditionalPropertiesThatArrayArrays() + { + $param = new Parameter([ + 'name' => 'foo', + 'type' => 'object', + 'additionalProperties' => [ + 'type' => 'array', + 'items' => ['type' => 'string'], + ], + ]); + $value = ['test' => [true]]; + $this->assertFalse($this->validator->validate($param, $value)); + $this->assertEquals(['[foo][test][0] must be of type string'], $this->validator->getErrors()); + } + + public function testIntegersCastToStringWhenTypeMismatch() + { + $param = new Parameter([ + 'name' => 'test', + 'type' => 'string', + ]); + $value = 12; + $this->assertTrue($this->validator->validate($param, $value)); + $this->assertEquals('12', $value); + } + + public function testRequiredMessageIncludesType() + { + $param = new Parameter([ + 'name' => 'test', + 'type' => [ + 'string', + 'boolean', + ], + 'required' => true, + ]); + $value = null; + $this->assertFalse($this->validator->validate($param, $value)); + $this->assertEquals(['[test] is a required string or boolean'], $this->validator->getErrors()); + } + + protected function getComplexParam() + { + return new Parameter([ + 'name' => 'Foo', + 'type' => 'array', + 'required' => true, + 'min' => 1, + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'Baz' => [ + 'type' => 'string', + ], + 'Bar' => [ + 'required' => true, + 'type' => 'boolean', + 'default' => true, + ], + ], + ], + ]); + } +} diff --git a/vendor/guzzlehttp/guzzle-services/tests/SerializerTest.php b/vendor/guzzlehttp/guzzle-services/tests/SerializerTest.php new file mode 100644 index 00000000..1d3a5a1e --- /dev/null +++ b/vendor/guzzlehttp/guzzle-services/tests/SerializerTest.php @@ -0,0 +1,39 @@ + 'http://test.com', + 'operations' => [ + 'test' => [ + 'httpMethod' => 'GET', + 'uri' => '/api/{key}/foo', + 'parameters' => [ + 'key' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'uri' + ], + ] + ] + ] + ]); + + $command = new Command('test', ['key' => 'bar']); + $serializer = new Serializer($description); + /** @var Request $request */ + $request = $serializer($command); + $this->assertEquals('http://test.com/api/bar/foo', $request->getUri()); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml b/vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml new file mode 100644 index 00000000..c1dced75 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml @@ -0,0 +1,37 @@ +name: format + +on: + push: + pull_request: + +jobs: + format: + name: Format Code + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: [ubuntu-latest] + php-version: ['8.0'] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Setup Dependencies + run: + composer install -o + + - name: Run + run: | + php bin/format + php bin/release + + - name: Commit Updated + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Format code diff --git a/vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml b/vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml new file mode 100644 index 00000000..6eb3a6f5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml @@ -0,0 +1,29 @@ +name: Support Multiple Versions + +on: + push: + pull_request: + +jobs: + install: + name: PHP${{ matrix.php-version }} Test Install + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: [ubuntu-latest] + php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + max-parallel: 10 + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Setup Dependencies + run: + composer install -o diff --git a/vendor/qcloud/cos-sdk-v5/CHANGELOG.md b/vendor/qcloud/cos-sdk-v5/CHANGELOG.md new file mode 100644 index 00000000..d8b3067c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/CHANGELOG.md @@ -0,0 +1,367 @@ +cos-php-sdk-v5 Upgrade Guide +==================== +2.6.0 to 2.6.1 +--------- +1. 多文件打包压缩 +2. 文件哈希值计算 +3. 文件解压 + +2.5.6 to 2.6.0 +--------- +1. 通用文字识别接口 +2. 取消存量任务 +3. 触发批量存量任务 +4. 新增动图模板 +5. 新增拼接模板 +6. 新增极速高清转码模板 +7. 新增图片处理模板 +8. 新增截图模板 +9. 新增超分辨率模板 +10. 新增转码模板 +11. 新增精彩集锦模板 +12. 新增视频增强模板 +13. 新增人声分离模板 +14. 新增水印模板 +15. 删除工作流 +16. 查询存量任务 +17. 批量拉取存量任务 +18. 查询模版列表 +19. 搜索工作流 +20. 获取工作流实例详情 +21. 获取工作流实例列表 +22. 手动触发工作流 +23. 更新动图模板 +24. 更新拼接模板 +25. 更新极速高清转码模板 +26. 更新图片处理模板 +27. 更新截图模板 +28. 更新超分辨率模板 +29. 更新转码模板 +30. 更新精彩集锦模板 +31. 更新视频增强模板 +32. 更新人声分离模板 +33. 更新水印模板 +34. 提交音频降噪任务 +35. 图片水印修复 +36. 图片处理参数使用demo +37. 开通以图搜图 +38. 添加图库图片 +39. 图片搜索接口 +40. 删除图库图片 +41. 绑定数据万象服务 +42. 查询数据万象服务 +43. 解绑数据万象服务 +44. 查询防盗链 +45. 设置防盗链 +46. 开通原图保护 +47. 查询原图保护状态 +48. 关闭原图保护 +49. 人脸检测 +50. 人脸特效 +51. 身份证识别 +52. 身份证识别-上传时处理 +53. 获取数字验证码 +54. 获取动作顺序 +55. 查询文档预览开通状态 +56. 更新文档转码队列 +57. 图片审核新增异步审核参数Async,新增部分审核结果参数 +58. 媒体处理任务接口新增UserData、JobLevel、CallBackFormat、CallBackType、CallBackMqConfig参数 +59. 图片批量审核新增Content参数,可以提交经过base64编码的图片文件内容进行审核 +60. 提交视频质量评分任务 +61. 提交音视频流分离任务 +2.5.5 to 2.5.6 +--------- +- 创建SDRtoHDR任务 +- 创建添加数字水印任务 +- 创建提取数字水印任务 +- 创建超分任务 +- 创建视频标签 +- 创建图片处理任务 +- 创建转封装任务 +- 审核各接口参数修改 +- 直播流审核接口 +- 取消直播流审核接口 +- 修复全球加速region不存在的问题 + +2.5.4 to 2.5.5 +--------- +- fix signHost type error + +2.5.3 to 2.5.4 +--------- +- 新增查询是否开通媒体处理接口 +- 新增获取pm3u8签名接口 +- 新增查询队列列表接口 +- 新增更新队列接口 +- 新增查询任务接口 +- 新增创建多任务接口 +- 新增创建截图任务接口 +- 新增创建转码任务接口 +- 新增创建动图任务接口 +- 新增创建拼接任务接口 +- 新增创建智能封面任务接口 +- 新增创建视频增强任务接口 +- 新增创建精彩集锦任务接口 +- 新增创建人声分离任务接口 +- 修复signHost值获取不到的问题 + +2.5.2 to 2.5.3 +--------- +- 增加ETag的兼容逻辑,防止因为特殊框架或者网关规则导致etag undefined + +2.5.1 to 2.5.2 +--------- +- 修复预签名中Headers参数无效的问题 + +2.5.0 to 2.5.1 +--------- +- 万象相关接口的DetectType审核类型参数可选 +- 万象内容审核接口增加DataId自定义业务标识 +- 新增万象网页审核任务相关接口 +- 新增部分参数校验 +- 修复PHP8.1中将null传递给不可为空的内部函数的问题 + +2.4.4 to 2.5.0 +--------- +- 万象支持病毒检测、人声分离任务接口 +- 万象转码任务支持多个水印参数/多任务接口/查询接口/列表接口 +- 修复签名长期存在的bug +- 修复copy接口404问题,copyObject示例添加注释 +- 审核接口增加仅支持https的说明 + +2.4.3 to 2.4.4 +--------- +- 修复图片水印签名问题 + +2.4.2 to 2.4.3 +--------- +- 优化审核接口返回相关字段 +- 增加host开关功能 +- GetObject接口支持万象自定义样式 +- 修复ip的host bug + +2.4.1 to 2.4.2 +--------- +- 修复图片处理相关接口403签名不对的bug + +2.4.0 to 2.4.1 +--------- +- 增加桶Bucket、GetBucket对应Sample详细注解 +- 对部分传入参数进行检查 +- 添加doesObjectExist、doesBucketExist对应Sample +- 调整整体项目架构,修复composer依赖问题 +- 调整UT + +2.3.4 to 2.4.0 +--------- +- 新增文档转码功能,包括提交、查询、拉取文档预览任务 +- 丰富头域参数说明 +- 修复预签名中将万象参数作为key报错问题 +- 调整travis与action,后续版本保证多版本测试正常 + +2.3.3 to 2.3.4 +--------- +- 修复laravel8中guzzlehttp/psr7报错问题,后续重新整理依赖 +- 修复putBucketAccelerate接口与目前API不一致的问题 + +2.3.2 to 2.3.3 +--------- +- 修复laravel8中guzzlehttp/psr7报错问题 +- 清理无用代码 + +2.3.1 to 2.3.2 +--------- +- 新增视频截帧,视频信息查询示例 +- 新增PUT/GET Bucket Referer示例 +- 对于相应接口添加CRC返回信息 +- 修复图片审核中ci-process param出现两次的问题 +- 修复PHP5.6 版本的依赖问题 +- 根据PHP版本自动composer install guzzle6.x或guzzle7 + +2.3.0 to 2.3.1 +--------- +- 修复文本检测的返回格式 +- 修复sample中的问题 +- 新增视频、文本、文档、音频检测 +- 新增媒体转码、截图、拼接 + +2.2.3 to 2.3.0 +--------- +- 新增图片审核,视频审核,音频审核,文本审核,文档审核接口 +- 新增单链接限速demo +- 暴露getPresigned接口Headers和Params参数接口 +- 补充textDetect UT +- 修复stream_for废弃问题 +- 修复x-cos头检测逻辑问题 +- 修复UT部分bug + +2.2.2 to 2.2.3 +- 在putObejct中新增x-cos-tagging头 +- 修复`GetObjectWithoutSign`bug + +2.2.1 to 2.2.2 +---------- +新增appendObject SDK,包括sample,service,test +增加无签名对象下载地址 SDK,包括sample,service,test +增加全球加速相关配置参数 +将COS_SECRETID修改为SECRETID、COS_SECRETKEY修改为SECRETKEY,防止混淆 +修复部分逻辑代码bug +修复部分拼写错误 +- Add `AppendObject` interface +- Add `GetObjectWithoutSign` interface +- Add `allow_accelerate` param to client +- Change const name `COS_SECRETID->SECRETID` `COS_SECRETKEY->SECRETKEY` +- Fix `getPresigned` interface +- Fix typo + +2.2.0 to 2.2.1 +---------- +- Add `PutObjectTagging` interface +- Add `GetObjectTagging` interface +- Add `DeleteObjectTagging` interface + +2.1.6 to 2.2.0 +---------- +- `PutObject` interface supports ci image process +- `GetObject` interface supports ci image process +- Add `ImageInfo` interface, which is used for get image info +- Add `ImageExif` interface, which is used for get image exif +- Add `ImageAve` interface, which is used for get image ave +- Add `ImageProcess` interface, which is used for data processing on cloud +- Add `Qrcode` interface, which is used for qrcode recognition +- Add `QrcodeGenerate` interface, which is used for generate qrcode +- Add `DetectLabel` interface, which is used for detect image label +- Add `PutBucketImageStyle` interface, which is used for add bucket image style +- Add `GetBucketImageStyle` interface, which is used for get bucket image style +- Add `DeleteBucketImageStyle` interface, which is used for delete bucket image style +- Add `PutBucketGuetzli` interface, which is used for open bucket guetzli state +- Add `GetBucketGuetzli` interface, which is used for get bucket guetzli state +- Add `DeleteBucketGuetzli` interface, which is used for close bucket guetzli state + +2.1.5 to 2.1.6 +---------- +- Add `allow_redirects` parameter +- Fix `selectObjectContent` interface + +2.1.3 to 2.1.5 +---------- +- The `download` interface supports breakpoint +- Rename `getPresignetUrl` to `getPresignedUrl` + +2.1.2 to 2.1.3 +---------- +- Add `download` interface, which is used for concurrent block download +- Add callback of `upload` and `download` progress +- Fix request retry + +2.1.1 to 2.1.2 +---------- +- The interface supports custom parameters +- Fix `ListBucketInventoryConfigurations` + +2.1.0 to 2.1.1 +---------- +- Fix bug of urlencode when calculating signature + +2.0.9 to 2.1.0 +---------- +- `upload` support upload with multithread +- Add `retry` params for interface retry +- Support add customer header +- Signature will restrict part of the header and all parameters +- Fix `listBuckets` with `doamin` + +2.0.8 to 2.0.9 +---------- +- Fix bug of `listObjectVersions` +- Update `getObject` with param of `saveas` + +2.0.7 to 2.0.8 +---------- +- Fix presigned url when using tmpSecretId/tmpSecretKey/Token + +2.0.6 to 2.0.7 +---------- +- Fix response of `ListParts` + +2.0.5 to 2.0.6 +---------- +- Support Domain +- Add Select Object Content Interface +- Add Traffic Limit +- Fix bug of object endswith / + +2.0.4 to 2.0.5 +---------- +- Fix bug when upload object with metadata + +2.0.3 to 2.0.4 +---------- +- Fix bug when using ip-port + +2.0.2 to 2.0.3 +---------- +- Fix path parse bug with /0/ + +2.0.1 to 2.0.2 +---------- +- Fix bug of `putObject` with `fopen` +- Add ut + + +2.0.0 to 2.0.1 +---------- +- Add interface of inventory/tagging/logging +- Fix bug of some interface with query string + + +1.3 to 2.0 +---------- +cos-php-sdk-v5 now uses [GuzzleHttp] for HTTP message. +Due to fact, it depending on PHP >= 5.6. + +- Use the `Qcloud\Cos\Client\getPresignetUrl()` method instead of the `Qcloud\Cos\Command\createPresignedUrl()` + +v2: +```php +$signedUrl = $cosClient->getPresignetUrl($method='putObject', + $args=['Bucket'=>'examplebucket-1250000000', 'Key'=>'exampleobject', 'Body'=>''], + $expires='+30 minutes'); +``` + +v1: +```php +$command = $cosClient->getCommand('putObject', array( + 'Bucket' => "examplebucket-1250000000", + 'Key' => "exampleobject", + 'Body' => '', +)); +$signedUrl = $command->createPresignedUrl('+30 minutes'); +``` + +- `$copSource` parameters of the `Qcloud\Cos\Client\Copy` interface are no longer compatible with older versions. + +v2: + +```php +$result = $cosClient->copy( + $bucket = '', + $Key = '', + $copySorce = array( + 'Region' => '', + 'Bucket' => '', + 'Key' => '', + ) +); +``` + +v1: +```php +$result = $cosClient->Copy( + $bucket = '', + $key = '', + $copysource = '.cos..myqcloud.com/' +); +``` +- Now when uploading files with using `open()` to upload stream, if the local file does not exist, a 0 byte file will be uploaded without throwing an exception, only a warning. + diff --git a/vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php b/vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php new file mode 100644 index 00000000..a67aea5e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片搜索接口 https://cloud.tencent.com/document/product/460/63901 + $result = $cosClient->imageSearch(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // ObjectKey + 'MatchThreshold' => 0, // 出参 Score 中,只有超过 MatchThreshold 值的结果才会返回。默认为0 + 'Offset' => 0, // 起始序号,默认值为0 + 'Limit' => 10, // 返回数量,默认值为10,最大值为100 + 'Filter' => '', // 针对入库时提交的 Tags 信息进行条件过滤。支持>、>=、<、<=、=、!=,多个条件之间支持 AND 和 OR 进行连接 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php b/vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php new file mode 100644 index 00000000..f7ef7e7d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 添加图库图片 https://cloud.tencent.com/document/product/460/63900 + $result = $cosClient->imageSearchAdd(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // ObjectKey + 'EntityId' => '', // 物品 ID,最多支持64个字符。若 EntityId 已存在,则对其追加图片 + 'CustomContent' => '', // 用户自定义的内容,最多支持4096个字符,查询时原样带回 + 'Tags' => '', // 图片自定义标签,最多不超过10个,json 字符串,格式为 key:value 对 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php b/vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php new file mode 100644 index 00000000..296b70f3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php @@ -0,0 +1,27 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 删除图库图片 https://cloud.tencent.com/document/product/460/63902 + $result = $cosClient->imageSearchDelete(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // ObjectKey + 'EntityId' => '', // 物品 ID + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php b/vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php new file mode 100644 index 00000000..e8eeb4be --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php @@ -0,0 +1,27 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 开通以图搜图 https://cloud.tencent.com/document/product/460/63899 + $result = $cosClient->imageSearchOpen(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'MaxCapacity' => 10000, // 图库容量限制 + 'MaxQps' => 10, // 图库访问限制,默认10 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/addHotLink.php b/vendor/qcloud/cos-sdk-v5/sample/addHotLink.php new file mode 100644 index 00000000..fdb7b16f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/addHotLink.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 设置防盗链 https://cloud.tencent.com/document/product/460/30116 + $result = $cosClient->addHotLink(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Urls' => array( + 'www.example1.com', + 'www.example2.com', + 'www.example3.com', + ), + 'Type' => 'white', + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/appendObject.php b/vendor/qcloud/cos-sdk-v5/sample/appendObject.php new file mode 100644 index 00000000..6320ba04 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/appendObject.php @@ -0,0 +1,36 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $result = $cosClient->appendObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Position' => 0, //追加对象位置 + 'Body' => fopen($local_path, 'rb'),//读取文件内容 + )); + /* + $result = $cosClient->appendObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Position' => (integer)$result['Position'], //取出上一个追加文件的对象位置进行追加 + 'Body' => "hello", //文件流 + )); + */ + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/bindCiService.php b/vendor/qcloud/cos-sdk-v5/sample/bindCiService.php new file mode 100644 index 00000000..fd888e82 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/bindCiService.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 绑定数据万象服务 https://cloud.tencent.com/document/product/460/30108 + $result = $cosClient->bindCiService(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php new file mode 100644 index 00000000..b0ad9c4f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate(); + $blindWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg"); + $blindWatermarkTemplate->setType(2); + $blindWatermarkTemplate->setLevel(3); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $blindWatermarkTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php b/vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php new file mode 100644 index 00000000..5be4543e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/71515 取消存量任务 + $result = $cosClient->cancelInventoryTriggerJob(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php b/vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php new file mode 100644 index 00000000..81c04f7b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->cancelLiveVideoAuditing(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php b/vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php new file mode 100644 index 00000000..870c0097 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $imageMogrTemplate->rotate(50); + $imageViewTemplate = new Qcloud\Cos\ImageParamTemplate\ImageViewTemplate(); + $imageViewTemplate->setMode(1); + $imageViewTemplate->setWidth(400); + $imageViewTemplate->setHeight(600); + $imageViewTemplate->setQuality(1, 85); + $ciParamTransformation = new Qcloud\Cos\ImageParamTemplate\CIParamTransformation(); + $ciParamTransformation->addRule($imageMogrTemplate); + $ciParamTransformation->addRule($imageViewTemplate); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $ciParamTransformation->queryString(), + 'SaveAs' => '/data/exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php b/vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php new file mode 100644 index 00000000..815181be --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 关闭原图保护 https://cloud.tencent.com/document/product/460/30122 + $result = $cosClient->closeOriginProtect(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/copy.php b/vendor/qcloud/cos-sdk-v5/sample/copy.php new file mode 100644 index 00000000..ce9a8da7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/copy.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $result = $cosClient->copy( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = 'exampleobject', + $copySource = array( + 'Region' => '', + 'Bucket' => '', + 'Key' => '', + ) + ); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/cosClient.php b/vendor/qcloud/cos-sdk-v5/sample/cosClient.php new file mode 100644 index 00000000..6fd386e1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/cosClient.php @@ -0,0 +1,30 @@ + $region, //园区 + 'schema' => 'https', //协议头部,默认为http + 'timeout' => 10, //超时时间 + 'connect_timeout' => 10, //连接超时时间 + 'ip' => '', //ip + 'port' => '', //端口 + 'endpoint' => '', //endpoint + 'domain' => '', //domain可以填写用户自定义域名,或者桶的全球加速域名 + 'proxy' => '', //代理服务器 + 'retry' => 10, //重试次数 + 'userAgent' => '', //UA + 'allow_redirects' => false, //是否follow302 + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey, + 'token' => $token, + 'anonymous' => true, //匿名模式 + ) + ) +); diff --git a/vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php new file mode 100644 index 00000000..f85f27ce --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php @@ -0,0 +1,49 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->createDocProcessJobs(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'DocProcess', //任务的 Tag:DocProcess 固定值 + 'QueueId' => 'pd8e422a2ea134165a92f2012ea43****', //任务所在的队列 ID + 'Input' => array( + 'Object' => 'Append功能测试.pdf' //待操作的文件对象 + ), + 'Operation' => array( + 'DocProcess' => array( + 'SrcType' => 'pdf', //源数据的后缀类型 + 'TgtType' => 'png', //转换输出目标文件类型 + 'SheetId' => 0, //表格文件参数,转换第 X 个表,默认为1 + 'StartPage' => 1, //从第 X 页开始转换,默认为1 + 'EndPage' => 3, //转换至第 X 页,默认为-1,即转换全部页 + 'ImageParams' => '', //转换后的图片处理参数 + 'DocPassword' => '', //Office 文档的打开密码 + 'Comments' => 0, //是否隐藏批注和应用修订,默认为 0 + 'PaperDirection' => 0, //表格文件转换纸张方向,默认为0 + 'Quality' => 100, //生成预览图的图片质量,取值范围 [1-100],默认值100 + 'Zoom' => 100, //预览图片的缩放参数,取值范围[10-200], 默认值100 + ), + 'Output' => array( + 'Region' => $region, //存储桶的地域 + 'Bucket' => 'examplebucket-1250000000', //存储结果的存储桶 + 'Object' => 'pic-${Page}.jpg', //输出文件路径 + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php new file mode 100644 index 00000000..4892e324 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php @@ -0,0 +1,54 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/83112 提交多文件打包压缩任务-异步 + $result = $cosClient->createFileCompressJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'FileCompress', +// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg', + 'Operation' => array( + 'UserData' => 'xxx', + 'FileCompressConfig' => array( + 'Flatten' => '0', + 'Format' => 'zip', +// 'UrlList' => 'test/index.csv', +// 'Prefix' => 'test/', + 'Keys' => array( + 'object1', // 待压缩桶文件 + 'object2', // 待压缩桶文件 + 'object3', // 待压缩桶文件 + ), + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'output/test.zip', + ), + ), +// 'CallBackFormat' => '', +// 'CallBackType' => '', +// 'CallBack' => '', +// 'CallBackMqConfig' => array( +// 'MqRegion' => '', +// 'MqMode' => '', +// 'MqName' => '', +// ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php new file mode 100644 index 00000000..4c9fb3db --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php @@ -0,0 +1,45 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/83108 提交哈希值计算任务-异步 + $result = $cosClient->createFileHashCodeJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'FileHashCode', +// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg', + 'Input' => array( + 'Object' => 'test.mp4', + ), + 'Operation' => array( + 'UserData' => 'xxx', + 'FileHashCodeConfig' => array( + 'Type' => 'MD5', + 'AddToHeader' => 'true', + ), + ), +// 'CallBackFormat' => '', +// 'CallBackType' => '', +// 'CallBack' => '', +// 'CallBackMqConfig' => array( +// 'MqRegion' => '', +// 'MqMode' => '', +// 'MqName' => '', +// ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php new file mode 100644 index 00000000..f3b741a1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php @@ -0,0 +1,49 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/83110 提交文件解压任务-异步 + $result = $cosClient->createFileUncompressJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'FileUncompress', +// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg', + 'Input' => array( + 'Object' => 'test.zip', + ), + 'Operation' => array( + 'UserData' => 'xxx', + 'FileUncompressConfig' => array( + 'Prefix' => 'prefix', + 'PrefixReplaced' => '1', + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + ), + ), +// 'CallBackFormat' => '', +// 'CallBackType' => '', +// 'CallBack' => '', +// 'CallBackMqConfig' => array( +// 'MqRegion' => '', +// 'MqMode' => '', +// 'MqName' => '', +// ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createFolder.php b/vendor/qcloud/cos-sdk-v5/sample/createFolder.php new file mode 100644 index 00000000..f008f60f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createFolder.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'folder/', + 'Body' => "", + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php b/vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php new file mode 100644 index 00000000..5ef3e2b7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php @@ -0,0 +1,39 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/71516 触发批量存量任务 + $result = $cosClient->createInventoryTriggerJob(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Name' => '存量触发任务名称', + 'Input' => array( +// 'Manifest' => '', +// 'UrlFile' => '', +// 'Prefix' => '', + 'Object' => 'test01.png', + ), + 'Operation' => array( + 'WorkflowIds' => 'w9938ed4b1435448783xxxxxxxxxxxxx', +// 'TimeInterval' => array( +// 'Start' => '', +// 'End' => '', +// ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php new file mode 100644 index 00000000..b1bd6491 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php @@ -0,0 +1,85 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交动图任务 https://cloud.tencent.com/document/product/436/54001 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaAnimationJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Animation', + 'QueueId' => 'p81e648af2aee49688xxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' => 't1de276cbdab16xxxxxxxxxxxxxxxxxxxxx', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'Animation.gif', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaAnimationJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Animation', + 'QueueId' => 'p81e648af2aee49688xxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'Animation' => array( + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'AnimateOnlyKeepKeyFrame' => '', + 'AnimateTimeIntervalOfFrame' => '', + 'AnimateFramesPerSecond' => '', + 'Quality' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'Animation.gif', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php new file mode 100644 index 00000000..de0f9af2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php @@ -0,0 +1,43 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->createMediaAnimationTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Animation', + 'Name' => 'Animation-Template-Name', + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'AnimateOnlyKeepKeyFrame' => '', + 'AnimateTimeIntervalOfFrame' => '', + 'AnimateFramesPerSecond' => '', + 'Quality' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php new file mode 100644 index 00000000..1a12df20 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php @@ -0,0 +1,100 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交拼接任务 https://cloud.tencent.com/document/product/436/54013 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaConcatJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Concat', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' => 'asdfafiahfiushdfisdhfuis', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'concat-video02.mp4', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaConcatJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Concat', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'concat-video03.mp4', + ), + 'ConcatTemplate' => array( + 'ConcatFragments' => array( + array( + 'Url' => 'https://example.com/video01.mp4', + 'Mode' => 'Start', +// 'StartTime' => '0', +// 'EndTime' => '7', + ), + array( + 'Url' => 'https://example.com/video02.mp4', + 'Mode' => 'Start', +// 'StartTime' => '0', +// 'EndTime' => '10', + ), + // ... repeated + ), + 'Index' => 1, + 'Container' => array( + 'Format' => 'mp4' + ), + 'Audio' => array( + 'Codec' => 'mp3', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + 'Video' => array( + 'Codec' => 'H.264', + 'Bitrate' => '1000', + 'Width' => '1280', + 'Height' => '', + 'Fps' => '30', + ), + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php new file mode 100644 index 00000000..bee8a541 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php @@ -0,0 +1,56 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54041 新增拼接模板 + $result = $cosClient->createMediaConcatTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Concat', + 'Name' => 'Concat-Template-Name', + 'ConcatTemplate' => array( + 'ConcatFragments' => array( + array( + 'Mode' => 'Start', + 'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/video01.mp4', + ), + array( + 'Mode' => 'End', + 'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/video02.mp4', + ), + ), + 'Audio' => array( + 'Codec' => 'aac', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + 'Video' => array( + 'Codec' => 'h.264', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Bitrate' => '', + 'Remove' => 'false', + ), + 'Container' => array( + 'Format' => 'mp4', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php new file mode 100644 index 00000000..51660ce4 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php @@ -0,0 +1,45 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 嵌入数字水印任务 https://cloud.tencent.com/document/product/436/65999 + $result = $cosClient->createMediaDigitalWatermarkJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'DigitalWatermark', + 'QueueId' => 'p81e648af2aee496885707caxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'DigitalWatermark' => array( + 'Message' => '123456789ab', + 'Type' => 'Text', + 'Version' => 'V1', + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'DigitalWatermark.mp4', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php new file mode 100644 index 00000000..c8e9ac21 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php @@ -0,0 +1,39 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提取数字水印任务 https://cloud.tencent.com/document/product/436/66007 + $result = $cosClient->createMediaExtractDigitalWatermarkJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'ExtractDigitalWatermark', + 'QueueId' => 'p81e648af2aee496885707caxxxxxxxxx', + 'Input' => array( + 'Object' => 'DigitalWatermark.mp4' + ), + 'Operation' => array( + 'ExtractDigitalWatermark' => array( + 'Type' => 'Text', + 'Version' => 'V1', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php new file mode 100644 index 00000000..127fac86 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php @@ -0,0 +1,60 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/58307 新增极速高清转码模板 + $result = $cosClient->createMediaHighSpeedHdTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'HighSpeedHd', + 'Name' => 'HighSpeedHd-Template-Name', + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Profile' => '', + 'Bitrate' => '', + 'Crf' => '', + 'Gop' => '', + 'Preset' => '', + 'Bufsize' => '', + 'Maxrate' => '', + 'HlsTsTime' => '', + 'Pixfmt' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + 'Audio' => array( + 'Codec' => '', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + 'TransConfig' => array( + 'IsCheckReso' => '', + 'ResoAdjMethod' => '', + 'IsHdr2Sdr' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php new file mode 100644 index 00000000..56dd9548 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php @@ -0,0 +1,56 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 多任务接口 https://cloud.tencent.com/document/product/436/58335 + $result = $cosClient->CreateMediaJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', // 可选,单一任务时,优先以Operation.Tag为准,当Operation无Tag参数时,该参数生效 + 'QueueId' => 'paaf4fce5521a40888a303xxxxxxxxxxxxxx', + 'CallBack' => '', + 'Input' => array( + 'Object' => 'example.mp4' + ), + 'Operation' => array( + array( + 'Tag' => 'Transcode', + 'TemplateId' => 't04e1ab86554984f1aa17cxxxxxxxxxxxxxx', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video01.mp4', + ), + 'WatermarkTemplateId' => array( + 't112d18d9b2a9b430e91dxxxxxxxxxxxxxx', + ), + ), + array( + 'Tag' => 'Transcode', + 'TemplateId' => 't04e1ab86554984f1aa17xxxxxxxxxxxxxx', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video02.mp4', + ), + 'WatermarkTemplateId' => array( + 't1bf713bb5c6a5496e859axxxxxxxxxxxxxx', + ), + ), + ), + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php new file mode 100644 index 00000000..65d83830 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php @@ -0,0 +1,39 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->createMediaNoiseReductionJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'NoiseReduction', + 'QueueId' => 'p81e648af2aee4968857xxxxxxxxxxxxxxxx', + 'CallBack' => '', + 'Input' => array( + 'Object' => 'sound01.mp3', + ), + 'Operation' => array( + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', + 'Object' => 'NoiseReduction.mp3', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php new file mode 100644 index 00000000..b3760e59 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php @@ -0,0 +1,71 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交图片处理任务 https://cloud.tencent.com/document/product/436/67194 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaPicProcessJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'PicProcess', + 'QueueId' => 'pcf4d6d9e5e734asd0as8d09as8d09a8d0', + 'Input' => array( + 'Object' => 'test01.png' + ), + 'Operation' => array( + 'TemplateId' => 't1648745f76c354e8ad8a09sd890ad80a8d', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'picprocess.jpg', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaPicProcessJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'PicProcess', + 'QueueId' => 'pcf4d6d9e5e734asd0as8d09as8d09a8d0', + 'Input' => array( + 'Object' => 'test01.png' + ), + 'Operation' => array( + 'PicProcess' => array( + 'IsPicInfo' => '', + 'ProcessRule' => '', + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'picprocess.jpg', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php new file mode 100644 index 00000000..fc6c5588 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/67225 新增图片处理模板 + $result = $cosClient->createMediaPicProcessTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'PicProcess', + 'Name' => 'PicProcess-Template-Name', + 'PicProcess' => array( + 'IsPicInfo' => '', + 'ProcessRule' => 'imageMogr2/rotate/90', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php new file mode 100644 index 00000000..59438118 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php @@ -0,0 +1,42 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交视频质量评分任务 https://cloud.tencent.com/document/product/460/76906 + $result = $cosClient->createMediaQualityEstimateJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'QualityEstimate', + 'QueueId' => 'p81e648af2aee4968857xxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'test.mp4', + ), + 'Operation' => array( + 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => 'http://xxx.com/callback', + 'CallBackFormat' => 'JSON', +// 'CallBackType' => '', +// 'CallBackMqConfig' => array( +// 'MqRegion' => '', +// 'MqMode' => '', +// 'MqName' => '', +// ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php new file mode 100644 index 00000000..96b9b8a0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php @@ -0,0 +1,45 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交 SDR to HDR 任务 https://cloud.tencent.com/document/product/436/60754 + $result = $cosClient->createMediaSDRtoHDRJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'SDRtoHDR', + 'QueueId' => 'p81e648af2aee496885a8d09a8s09d8a0sd6', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TranscodeTemplateId' => '', + 'WatermarkTemplateId' => '', + 'SDRtoHDR' => array( + 'HdrMode' => 'HLG', + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'SDRtoHDR.flv', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php new file mode 100644 index 00000000..76ac5790 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php @@ -0,0 +1,48 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交转封装任务 https://cloud.tencent.com/document/product/436/67186 + $result = $cosClient->createMediaSegmentJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Segment', + 'QueueId' => 'p81e648af2aee496885707ca0xxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'Segment' => array( + 'Format' => 'mkv', + 'Duration' => '5', + 'HlsEncrypt' => array( + 'IsHlsEncrypt' => 'false', + 'UriKey' => '', + ), + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', + 'Object' => 'Segment-trans${Number}.mkv', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php new file mode 100644 index 00000000..b7f448c1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php @@ -0,0 +1,50 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交智能封面任务 https://cloud.tencent.com/document/product/436/54017 + $result = $cosClient->createMediaSmartCoverJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'SmartCover', + 'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( +// 'TemplateId' => '', // 使用模版 + 'SmartCover' => array( + 'Format' => '', + 'Width' => '', + 'Height' => '', + 'Count' => '', + 'DeleteDuplicates' => '', + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'SmartCover-${Number}.jpg', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', +// 'CallBackFormat' => '', +// 'CallBackType' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php new file mode 100644 index 00000000..9e3ce752 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php @@ -0,0 +1,81 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交截图任务 https://cloud.tencent.com/document/product/436/76933 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaSnapshotJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Snapshot', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' => 'asdfafiahfiushdfisdhfuis', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'snapshot-${Number}.jpg', +// 'SpriteObject' => 'sprite-${Number}.jpg', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), +// 'CallBackMqConfig' => array( +// 'MqRegion' => '', +// 'MqMode' => '', +// 'MqName' => '', +// ), + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaSnapshotJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Snapshot', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'snapshot-${Number}.jpg', + ), + 'Snapshot' => array( + 'Mode' => 'Average', + 'Start' => 3, + 'TimeInterval' => '', + 'Count' => 3, + 'Width' => '1280', + 'Height' => '', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php new file mode 100644 index 00000000..07dc1b8a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54029 新增截图模板 + $result = $cosClient->createMediaSnapshotTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Snapshot', + 'Name' => 'Snapshot-Template-Name', + 'Snapshot' => array( + 'Mode' => '', + 'Start' => '', + 'TimeInterval' => '', + 'Count' => '', + 'Width' => '', + 'Height' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php new file mode 100644 index 00000000..71028f9b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php @@ -0,0 +1,56 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交一个音视频流分离任务 https://cloud.tencent.com/document/product/460/76911 + $result = $cosClient->createMediaStreamExtractJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'StreamExtract', + 'QueueId' => 'p81e648af2aee4968857xxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'test.mp4', + ), + 'Operation' => array( +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + 'Output' => array( + 'Bucket' => 'examplebucket-125000000', + 'Region' => $region, + 'StreamExtracts' => array( + array( + 'Index' => '0', + 'Object' => 'output/out0.mp4', + ), + array( + 'Index' => '1', + 'Object' => 'output/out1.mp4', + ), + ), + ), + ), + 'CallBack' => 'http://xxx.com/callback', + 'CallBackFormat' => 'JSON', +// 'CallBackType' => '', +// 'CallBackMqConfig' => array( +// 'MqRegion' => '', +// 'MqMode' => '', +// 'MqName' => '', +// ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php new file mode 100644 index 00000000..764976f3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php @@ -0,0 +1,161 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交超分辨率任务 https://cloud.tencent.com/document/product/436/67210 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaSuperResolutionJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'SuperResolution', + 'QueueId' => 'p81e648af2aee49688570xxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' =>'t19ea5e0c0b7054d7b904axxxxxxxxxxx', + 'TranscodeTemplateId' =>'t0b612860a293f41078xxxxxxxxxxx', + 'WatermarkTemplateId' =>'t185e2e24551b24259a02xxxxxxxxxxx', + 'DigitalWatermark' => array( + 'Message' => 'xxx', + 'Type' => 'Text', + 'Version' => 'V1', + 'IgnoreError' => 'true', + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'SuperResolution.flv', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaSuperResolutionJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'SuperResolution', + 'QueueId' => 'p81e648af2aee49688570xxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'SuperResolution' => array( + 'Resolution' => '', + 'EnableScaleUp' => '', + ), + 'Transcode' => array( + 'Tag' => '', + 'Name' => '', + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Remove' => '', + 'Profile' => '', + 'Bitrate' => '', + 'Crf' => '', + 'Gop' => '', + 'Preset' => '', + 'Bufsize' => '', + 'Maxrate' => '', + 'HlsTsTime' => '', + 'Pixfmt' => '', + 'LongShortMode' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + 'Audio' => array( + 'Codec' => '', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + 'Remove' => '', + 'KeepTwoTracks' => '', + 'SwitchTrack' => '', + 'SampleFormat' => '', + ), + 'TransConfig' => array( + 'AdjDarMethod' => '', + 'IsCheckReso' => '', + 'ResoAdjMethod' => '', + 'IsCheckVideoBitrate' => '', + 'VideoBitrateAdjMethod' => '', + 'IsCheckAudioBitrate' => '', + 'AudioBitrateAdjMethod' => '', + 'DeleteMetadata' => '', + 'IsHdr2Sdr' => '', + 'HlsEncrypt' => array( + 'IsHlsEncrypt' => '', + 'UriKey' => '', + ), + ), + ), + 'Watermark' => array( + 'Type' => '', + 'Pos' => '', + 'LocMode' => '', + 'Dx' => '', + 'Dy' => '', + 'StartTime' => '', + 'EndTime' => '', + 'Image' => array( + 'Url' => '', + 'Mode' => '', + 'Width' => '', + 'Height' => '', + 'Transparency' => '', + 'Background' => '', + ), + 'Text' => array( + 'FontSize' => '', + 'FontType' => '', + 'FontColor' => '', + 'Transparency' => '', + 'Text' => '', + ), + ), + 'DigitalWatermark' => array( + 'Message' => '', + 'Type' => '', + 'Version' => '', + 'IgnoreError' => '', + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'SuperResolution.flv', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php new file mode 100644 index 00000000..6c9fa6d4 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->createMediaSuperResolutionTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'SuperResolution', + 'Name' => 'SuperResolution-Template-Name', + 'Resolution' => '', + 'EnableScaleUp' => '', + 'Version' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php new file mode 100644 index 00000000..576ab79b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php @@ -0,0 +1,124 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交转码任务 https://cloud.tencent.com/document/product/436/54009 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaTranscodeJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', + 'QueueId' => 'paaf4fce5521a40888a3034a5de80f6ca', + 'Input' => array( + 'Object' => 'example.mp4' + ), + 'Operation' => array( + 'TemplateId' => 't04e1ab86554984f1aa17c062fbf6c007c', +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video02.mp4', + ), + 'Watermark' => array( + array( + 'Type' => 'Text', + 'LocMode' => 'Absolute', + 'Dx' => '64', + 'Dy' => '64', + 'Pos' => 'TopRight', + 'Text' => array( + 'Text' => '第一个水印', + 'FontSize' => '30', + 'FontType' => 'simfang.ttf', + 'FontColor' => '#99ff00', + 'Transparency' => '100', // 不透明度 + ), + ), + array( + 'Type' => 'Text', + 'LocMode' => 'Absolute', + 'Dx' => '64', + 'Dy' => '64', + 'Pos' => 'TopLeft', + 'Text' => array( + 'Text' => '第二个水印', + 'FontSize' => '30', + 'FontType' => 'simfang.ttf', + 'FontColor' => '#99ff00', + 'Transparency' => '100', // 不透明度 + ), + ), + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaTranscodeJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video01.mkv', + ), + 'Transcode' => array( + 'Container' => array( + 'Format' => 'mp4' + ), + 'Video' => array( + 'Codec' => 'H.264', + 'Profile' => 'high', + 'Bitrate' => '1000', + 'Preset' => 'medium', + 'Width' => '1280', + 'Fps' => '30', + ), + 'Audio' => array( + 'Codec' => 'aac', + 'Samplerate' => '44100', + 'Bitrate' => '128', + 'Channels' => '4', + ), + 'TransConfig' => array( + 'AdjDarMethod' => 'scale', + 'IsCheckReso' => 'false', + 'ResoAdjMethod' => '1', + ), + 'TimeInterval' => array( + 'Start' => '0', + 'Duration' => '60', + ), + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php new file mode 100644 index 00000000..9942dd52 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php @@ -0,0 +1,79 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54037 新增转码模板 + $result = $cosClient->createMediaTranscodeTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', + 'Name' => 'Transcode-Template-Name', + 'Container' => array( + 'Format' => '', + 'ClipConfig' => array( + 'Duration' => '', + ), + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Remove' => '', + 'Profile' => '', + 'Bitrate' => '', + 'Crf' => '', + 'Gop' => '', + 'Preset' => '', + 'Bufsize' => '', + 'Maxrate' => '', + 'Pixfmt' => '', + 'LongShortMode' => '', + 'Rotate' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + 'Audio' => array( + 'Codec' => '', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + 'Remove' => '', + 'KeepTwoTracks' => '', + 'SwitchTrack' => '', + 'SampleFormat' => '', + ), + 'TransConfig' => array( + 'AdjDarMethod' => '', + 'IsCheckReso' => '', + 'ResoAdjMethod' => '', + 'IsCheckVideoBitrate' => '', + 'VideoBitrateAdjMethod' => '', + 'IsCheckAudioBitrate' => '', + 'AudioBitrateAdjMethod' => '', + 'DeleteMetadata' => '', + 'IsHdr2Sdr' => '', + 'HlsEncrypt' => array( + 'IsHlsEncrypt' => '', + 'UriKey' => '', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php new file mode 100644 index 00000000..9dcf9b56 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php @@ -0,0 +1,87 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交精彩集锦任务 https://cloud.tencent.com/document/product/436/58337 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaVideoMontageJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VideoMontage', + 'QueueId' => 'p81e648af2aeexxxxxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' => 't1fcc3770199e04737axxxxxxxxxxxxxx', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VideoMontage.mp4', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaVideoMontageJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VideoMontage', + 'QueueId' => 'p81e648af2aeexxxxxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'VideoMontage' => array( + 'Duration' => '', + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Bitrate' => '', + 'Crf' => '', + ), + 'Audio' => array( + 'Codec' => '', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + 'Remove' => '', + ), + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VideoMontage.mp4', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php new file mode 100644 index 00000000..7d7bb4f0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php @@ -0,0 +1,51 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/58314 新增精彩集锦模板 + $result = $cosClient->createMediaVideoMontageTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VideoMontage', + 'Name' => 'VideoMontage-Template-Name', + 'Duration' => '', + 'Container' => array( + 'Format' => 'mp4', + ), + 'Video' => array( + 'Codec' => 'H.264', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Bitrate' => '', + 'Crf' => '', + ), + 'Audio' => array( + 'Codec' => 'aac', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + 'Remove' => '', + ), + 'AudioMix' => array( + 'AudioSource' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/test01.mp3', + 'MixMode' => 'Once', + 'Replace' => 'true', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php new file mode 100644 index 00000000..b9f7d44b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php @@ -0,0 +1,157 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交视频增强任务 https://cloud.tencent.com/document/product/436/60750 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaVideoProcessJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VideoProcess', + 'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' => 't13466f1ea41a14c0xxxxxxxxxxxxx', // 视频增强模板 ID + 'TranscodeTemplateId' => 't0b6a845f5e42847bd81xxxxxxxxxxxxx', // 转码模板 ID + 'WatermarkTemplateId' => 't185e2e24551b24259a0xxxxxxxxxxxxx', // 水印模板 ID + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VideoProcess.flv', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaVideoProcessJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VideoProcess', + 'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'VideoProcess' => array( + 'ColorEnhance' => array( + 'Enable' => '', + 'Contrast' => '', + 'Correction' => '', + 'Saturation' => '', + ), + 'MsSharpen' => array( + 'Enable' => '', + 'SharpenLevel' => '', + ), + ), + 'Transcode' => array( + 'Tag' => '', + 'Name' => '', + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Remove' => '', + 'Profile' => '', + 'Bitrate' => '', + 'Crf' => '', + 'Gop' => '', + 'Preset' => '', + 'Bufsize' => '', + 'Maxrate' => '', + 'HlsTsTime' => '', + 'Pixfmt' => '', + 'LongShortMode' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + 'Audio' => array( + 'Codec' => '', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + 'Remove' => '', + 'KeepTwoTracks' => '', + 'SwitchTrack' => '', + 'SampleFormat' => '', + ), + 'TransConfig' => array( + 'AdjDarMethod' => '', + 'IsCheckReso' => '', + 'ResoAdjMethod' => '', + 'IsCheckVideoBitrate' => '', + 'VideoBitrateAdjMethod' => '', + 'IsCheckAudioBitrate' => '', + 'AudioBitrateAdjMethod' => '', + 'DeleteMetadata' => '', + 'IsHdr2Sdr' => '', + 'HlsEncrypt' => array( + 'IsHlsEncrypt' => '', + 'UriKey' => '', + ), + ), + ), + 'Watermark' => array( + 'Type' => '', + 'Pos' => '', + 'LocMode' => '', + 'Dx' => '', + 'Dy' => '', + 'StartTime' => '', + 'EndTime' => '', + 'Image' => array( + 'Url' => '', + 'Mode' => '', + 'Width' => '', + 'Height' => '', + 'Transparency' => '', + 'Background' => '', + ), + 'Text' => array( + 'FontSize' => '', + 'FontType' => '', + 'FontColor' => '', + 'Transparency' => '', + 'Text' => '', + ), + ), + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VideoProcess.flv', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php new file mode 100644 index 00000000..8f1e5727 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php @@ -0,0 +1,37 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/60745 新增视频增强模板 + $result = $cosClient->createMediaVideoProcessTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VideoProcess', + 'Name' => 'VideoProcess-Template-Name', + 'ColorEnhance' => array( + 'Enable' => '', + 'Contrast' => '', + 'Correction' => '', + 'Saturation' => '', + ), + 'MsSharpen' => array( + 'Enable' => '', + 'SharpenLevel' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php new file mode 100644 index 00000000..64f84de1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交视频标签任务 https://cloud.tencent.com/document/product/436/67202 + $result = $cosClient->createMediaVideoTagJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VideoTag', + 'QueueId' => 'p81e648af2aee496885707ca0xxxxxxxxx', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'VideoTag' => array( + 'Scenario' => 'Stream', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + 'CallBack' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php new file mode 100644 index 00000000..b76784ec --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php @@ -0,0 +1,77 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 提交人声分离任务 https://cloud.tencent.com/document/product/436/58341 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaVoiceSeparateJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VoiceSeparate', + 'QueueId' => '', + 'CallBack' => '', + 'Input' => array( + 'Object' => 'test.mp3' + ), + 'Operation' => array( + 'TemplateId' => '', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VoiceSeparate01.mp3', + 'AuObject' => 'VoiceSeparate02.mp3', + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaVoiceSeparateJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VoiceSeparate', + 'QueueId' => '', + 'CallBack' => '', + 'Input' => array( + 'Object' => 'test.mp3' + ), + 'Operation' => array( + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VoiceSeparate01.mp3', + 'AuObject' => 'VoiceSeparate02.mp3', + ), + 'VoiceSeparate' => array( + 'AudioMode' => 'AudioAndBackground', + 'AudioConfig' => array( + 'Codec' => 'mp3', + 'Samplerate' => '11025', + 'Bitrate' => '256', + 'Channels' => '2', + ), + ), +// 'UserData' => 'xxx', // 透传用户信息 +// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php new file mode 100644 index 00000000..21905720 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php @@ -0,0 +1,34 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/58315 新增人声分离模板 + $result = $cosClient->createMediaVoiceSeparateTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VoiceSeparate', + 'Name' => 'VoiceSeparate-Template-Name', + 'AudioMode' => 'IsAudio', + 'AudioConfig' => array( + 'Codec' => 'aac', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php new file mode 100644 index 00000000..820e6304 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php @@ -0,0 +1,70 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54033 新增水印模板 + // 文本水印 + $result = $cosClient->createMediaWatermarkTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Watermark', + 'Name' => 'Watermark-Template-Name', + 'Watermark' => array( + 'Type' => 'Text', + 'Pos' => 'TopRight', + 'LocMode' => 'Absolute', + 'Dx' => '128', + 'Dy' => '128', + 'StartTime' => '', + 'EndTime' => '', + 'Text' => array( + 'FontSize' => '30', + 'FontType' => 'simfang', + 'FontColor' => '0x000000', + 'Transparency' => '30', + 'Text' => '水印内容', + ), + ), + )); + // 请求成功 + print_r($result); + + // 图片水印 + $result = $cosClient->createMediaWatermarkTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Watermark', + 'Name' => 'Watermark-Template-Name', + 'Watermark' => array( + 'Type' => 'Image', + 'Pos' => 'TopRight', + 'LocMode' => 'Absolute', + 'Dx' => '128', + 'Dy' => '128', + 'StartTime' => '', + 'EndTime' => '', + 'Image' => array( + 'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/test01.png', + 'Mode' => 'Proportion', + 'Width' => '10', + 'Height' => '', + 'Transparency' => '100', + 'Background' => '', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php new file mode 100644 index 00000000..abb462f0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketDomain(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php new file mode 100644 index 00000000..9b565d61 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->DeleteBucketGuetzli(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php new file mode 100644 index 00000000..f23cd912 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->DeleteBucketImageStyle(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'StyleName' => 'stylename', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php new file mode 100644 index 00000000..d9653688 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketTagging(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php new file mode 100644 index 00000000..a8dd3d82 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketWebsite(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php new file mode 100644 index 00000000..f2c61918 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php @@ -0,0 +1,52 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + //列出所有buckets + $buckets = $cosClient->listBuckets(); + + //若bucket列表不为空则进行删除逻辑,先删除对象,再判断是否有上传的任务进行删除,最后删除桶 + if (!empty($buckets['Buckets'][0])) { + foreach ($buckets['Buckets'][0]['Bucket'] as $key => $value) { + $result = $cosClient->listObjects(array('Bucket' => $value['Name'])); + if (isset($result['Contents'])) { + foreach ($result['Contents'] as $content) { + $cosClient->deleteObject(array('Bucket' => $value['Name'], 'Key' => $content['Key'])); + } + } + while(True){ + $result = $cosClient->ListMultipartUploads( + array('Bucket' => $value['Name'])); + if ($result['Uploads'] == array()) { + break; + } + foreach ($result['Uploads'] as $upload) { + try { + $cosClient->AbortMultipartUpload( + array('Bucket' => $value['Name'], + 'Key' => $upload['Key'], + 'UploadId' => $upload['UploadId'])); + } catch (\Exception $e) { + print_r($e); + } + } + } + $cosClient->deleteBucket(array('Bucket' => $value['Name'])); + } + } + print_r('DELETE ALL BUCKETS SUCCEED!'); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php b/vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php new file mode 100644 index 00000000..9d0fa4bb --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php @@ -0,0 +1,48 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +$cos_path = "cos/folder"; +$nextMarker = ''; +$isTruncated = true; +while ( $isTruncated ) { + try { + $result = $cosClient->listObjects( + ['Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Delimiter' => '', + 'EncodingType' => 'url', + 'Marker' => $nextMarker, + 'Prefix' => $cos_path, + 'MaxKeys' => 1000] + ); + $isTruncated = $result['IsTruncated']; + $nextMarker = $result['NextMarker']; + foreach ( $result['Contents'] as $content ) { + $cos_file_path = $content['Key']; + $local_file_path = $content['Key']; + // 按照需求自定义拼接下载路径 + try { + $cosClient->deleteObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => $cos_file_path, + )); + echo ( $cos_file_path . "\n" ); + } catch ( \Exception $e ) { + echo( $e ); + } + } + } catch ( \Exception $e ) { + echo( $e ); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php b/vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php new file mode 100644 index 00000000..3a1d528f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteObjectTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteWorkflow.php b/vendor/qcloud/cos-sdk-v5/sample/deleteWorkflow.php new file mode 100644 index 00000000..43ecea49 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteWorkflow.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/53990 删除工作流 + $result = $cosClient->deleteWorkflow(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // WorkflowId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJob.php b/vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJob.php new file mode 100644 index 00000000..0bbfa9e3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJob.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/71517 查询存量任务 + $result = $cosClient->describeInventoryTriggerJob(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJobs.php b/vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJobs.php new file mode 100644 index 00000000..1a50f501 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJobs.php @@ -0,0 +1,34 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/71518 批量拉取存量任务 + $result = $cosClient->describeInventoryTriggerJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket +// 'NextToken' => '', +// 'Size' => '', +// 'OrderByTime' => '', +// 'States' => '', +// 'StartCreationTime' => '', +// 'EndCreationTime' => '', +// 'WorkflowId' => '', +// 'JobId' => '', +// 'Name' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/describeMediaJob.php b/vendor/qcloud/cos-sdk-v5/sample/describeMediaJob.php new file mode 100644 index 00000000..db7bfb4e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/describeMediaJob.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 查询指定的任务 + $result = $cosClient->describeMediaJob(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/describeMediaJobs.php b/vendor/qcloud/cos-sdk-v5/sample/describeMediaJobs.php new file mode 100644 index 00000000..b9084a61 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/describeMediaJobs.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + /* + 拉取符合条件的任务, 支持 + Transcode、Snapshot、Animation、Concat、SmartCover、VideoProcess、VideoMontage、VoiceSeparate、SDRtoHDR、 + DigitalWatermark、ExtractDigitalWatermark、SuperResolution、VideoTag、PicProcess、Segment + */ + $result = $cosClient->describeMediaJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', // 任务 的Tag + 'QueueId' => 'paaf4fce5521a40888a3034a5dxxxxxxx', // queueId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/describeMediaTemplates.php b/vendor/qcloud/cos-sdk-v5/sample/describeMediaTemplates.php new file mode 100644 index 00000000..535368a0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/describeMediaTemplates.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 查询模版列表 + $result = $cosClient->describeMediaTemplates(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => '', // 模板 Tag:Animation、Snapshot、Watermark、Transcode、Concat、HighSpeedHd、VideoMontage、VoiceSeparate、VideoProcess、PicProcess + 'Category' => 'Custom', + 'Ids' => '', + 'Name' => '', + 'PageNumber' => '', + 'PageSize' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/describeWorkflow.php b/vendor/qcloud/cos-sdk-v5/sample/describeWorkflow.php new file mode 100644 index 00000000..b4576fcb --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/describeWorkflow.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/53991 搜索工作流 + $result = $cosClient->describeWorkflow(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket +// 'Ids' => '', +// 'Name' => '', +// 'PageNumber' => '', +// 'PageSize' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectAudio.php b/vendor/qcloud/cos-sdk-v5/sample/detectAudio.php new file mode 100644 index 00000000..c46f1950 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectAudio.php @@ -0,0 +1,67 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // start --------------- 桶文件审核 ----------------- // + $result = $cosClient->detectAudio(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'sound01.mp3', +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 +// 'UserInfo' => array( +// 'TokenId' => '', +// 'Nickname' => '', +// 'DeviceId' => '', +// 'AppId' => '', +// 'Room' => '', +// 'IP' => '', +// 'Type' => '', +// 'ReceiveTokenId' => '', +// 'Gender' => '', +// 'Level' => '', +// 'Role' => '', +// ), + ), +// 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 若不传此参数,BizType为空时走默认策略,BizType不为空走定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'CallbackVersion' => '', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 +// ), // 可选 走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 桶文件审核 ----------------- // + + // start --------------- 音频文件地址审核 ----------------- // + $result = $cosClient->detectAudio(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://example.com/test.mp3', +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 若不传此参数,BizType为空时走默认策略,BizType不为空走定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'CallbackVersion' => '', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 +// ), // 可选 走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 音频文件地址审核 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectDocument.php b/vendor/qcloud/cos-sdk-v5/sample/detectDocument.php new file mode 100644 index 00000000..6e1ec0c5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectDocument.php @@ -0,0 +1,63 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 存储桶文档审核 + $result = $cosClient->detectDocument(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test01.docx', +// 'Type' => 'docx', +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 +// 'UserInfo' => array( +// 'TokenId' => '', +// 'Nickname' => '', +// 'DeviceId' => '', +// 'AppId' => '', +// 'Room' => '', +// 'IP' => '', +// 'Type' => '', +// 'ReceiveTokenId' => '', +// 'Gender' => '', +// 'Level' => '', +// 'Role' => '', +// ), + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 回调URL 选填 +// ), // 选填 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + + // 文档URL审核 + $result = $cosClient->detectDocument(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://example.com/test01.docx', +// 'Type' => 'docx', +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 回调URL 选填 +// ), // 选填 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectImage.php b/vendor/qcloud/cos-sdk-v5/sample/detectImage.php new file mode 100644 index 00000000..054dca52 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectImage.php @@ -0,0 +1,55 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + //存储桶图片审核 + $result = $cosClient->detectImage(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', // 桶文件 + 'ci-process' => 'sensitive-content-recognition', +// 'BizType' => '', // 可选 定制化策略,不传走默认策略 +// 'DetectType' => 'porn,ads', // 可选 不填走默认策略 或 定制化策略,四种参数:porn,ads等,可使用多种规则,注意规则间不要加空格 +// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'LargeImageDetect' => '', +// 'DataId' => '', +// 'Async' => '', +// 'Callback' => '', + )); + // 请求成功 + print_r($result); + + + //图片链接审核 + $imgUrl = 'https://test.jpg'; + $result = $cosClient->detectImage(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '/', // 链接图片资源路径写 / 即可 + 'ci-process' => 'sensitive-content-recognition', + 'DetectUrl' => $imgUrl, +// 'BizType' => '', // 可选 定制化策略,不传走默认策略 +// 'DetectType' => 'porn,ads', // 可选 不填走默认策略 或 定制化策略,四种参数:porn,ads等,可使用多种规则,注意规则间不要加空格 +// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'LargeImageDetect' => '', +// 'DataId' => '', +// 'Async' => '', +// 'Callback' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectImages.php b/vendor/qcloud/cos-sdk-v5/sample/detectImages.php new file mode 100644 index 00000000..b2c564e3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectImages.php @@ -0,0 +1,56 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 获取图片base64编码 +// $localImageFile = '/tmp/test.jpg'; +// $img = file_get_contents($localImageFile); +// $imgInfo = getimagesize($localImageFile); +// $imgBase64Content = base64_encode($img); + + $result = $cosClient->detectImages(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Inputs' => array( + array( + 'Object' => 'test01.png', // 桶文件 +// 'Interval' => '', // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => '', // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'DataId' => 'aaa', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节 + ), + array( + 'Url' => 'http://example.com/test.png', // 图片URL +// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节 + ), +// array( +// 'Content' => $imgBase64Content, // 图片文件的内容,需要先经过 base64 编码。 +//// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔 +//// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 +//// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节 +// ), + ), +// 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略,不传走默认策略 +// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略 或 定制化策略,四种参数:Porn,Ads等,可使用多种规则,注意规则间不要加空格 +// 'Async' => 0, // 可选 是否异步进行审核,0:同步返回结果,1:异步进行审核。默认值为 0。 +// 'Callback' => '', // 可选 审核结果(Detail版本)以回调形式发送至您的回调地址 +// ) // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectLable.php b/vendor/qcloud/cos-sdk-v5/sample/detectLable.php new file mode 100644 index 00000000..993bd962 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectLable.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->DetectLabel(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectLiveVideo.php b/vendor/qcloud/cos-sdk-v5/sample/detectLiveVideo.php new file mode 100644 index 00000000..5694eda2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectLiveVideo.php @@ -0,0 +1,43 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->detectLiveVideo(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Type' => 'live_video', + 'Input' => array( + 'Url' => 'rtmp://example.com/live/123', // 直播流地址 +// 'DataId' => '', +// 'UserInfo' => array( +// 'TokenId' => '', +// 'Nickname' => '', +// 'DeviceId' => '', +// 'AppId' => '', +// 'Room' => '', +// 'IP' => '', +// 'Type' => '', +// ), + ), + 'Conf' => array( + 'Callback' => '', +// 'CallbackType' => 1, + 'BizType' => '07d41bbb5a3a93dca4xxxxxxxxxxx', // 直播流审核 BizType 必填,可联系工作人员生成后使用 + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectText.php b/vendor/qcloud/cos-sdk-v5/sample/detectText.php new file mode 100644 index 00000000..a348da74 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectText.php @@ -0,0 +1,71 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // start --------------- 文本内容审核 ----------------- // + $content = '敏感词'; + $result = $cosClient->detectText(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Content' => base64_encode($content), // 文本需base64_encode +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'DetectType' => 'Porn,Terrorism,Politics,Ads,Illegal,Abuse', // 选填,在只有BizType时走设定策略的审核场景 +// 'BizType' => '', +// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 文本内容审核 ----------------- // + + // start --------------- 存储桶文本文件审核 ----------------- // + $result = $cosClient->detectText(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test01.txt' +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 回调URL 选填 +// 'CallbackVersion' => 'Detail', // 选填 Detail、Simple 默认为 Simple +// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 存储桶文本文件审核 ----------------- // + + // start --------------- 文本文件Url审核 ----------------- // + $result = $cosClient->detectText(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'http://example.com/test.txt' +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 选填 回调URL +// 'CallbackVersion' => 'Detail', // 选填 Detail、Simple 默认为 Simple +// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 文本文件Url审核 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectVideo.php b/vendor/qcloud/cos-sdk-v5/sample/detectVideo.php new file mode 100644 index 00000000..6dc2c2f1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectVideo.php @@ -0,0 +1,77 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + //存储桶视频审核 + $result = $cosClient->detectVideo(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test.mp4', // 存储桶文件 +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 +// 'UserInfo' => array( +// 'TokenId' => '', +// 'Nickname' => '', +// 'DeviceId' => '', +// 'AppId' => '', +// 'Room' => '', +// 'IP' => '', +// 'Type' => '', +// 'ReceiveTokenId' => '', +// 'Gender' => '', +// 'Level' => '', +// 'Role' => '', +// ), + ), + 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 不传走默认策略或定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'DetectContent' => 1, // 可选 用于指定是否审核视频声音,当值为0时:表示只审核视频画面截图;值为1时:表示同时审核视频画面截图和视频声音。默认值为0。 +// 'CallbackVersion' => 'Detail', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 + 'Snapshot' => array( +// 'Mode' => 'Average', // 可选 截帧模式,默认值为 Interval。Interval 表示间隔模式;Average 表示平均模式;Fps 表示固定帧率模式。 +// 'TimeInterval' => 50, // 可选 视频截帧频率 + 'Count' => '3', // 视频截帧数量 + ), + ), + )); + + //视频url审核 + $videoUrl = 'http://example.com/test.mp4'; + $result = $cosClient->detectVideo(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => $videoUrl, // 视频url +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), + 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 不传走默认策略或定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'DetectContent' => 1, // 可选 用于指定是否审核视频声音,当值为0时:表示只审核视频画面截图;值为1时:表示同时审核视频画面截图和视频声音。默认值为0。 +// 'CallbackVersion' => 'Detail', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 + 'Snapshot' => array( +// 'Mode' => 'Average', // 可选 截帧模式,默认值为 Interval。Interval 表示间隔模式;Average 表示平均模式;Fps 表示固定帧率模式。 +// 'TimeInterval' => 50, // 可选 视频截帧频率 + 'Count' => '3', // 视频截帧数量 + ), + ), + )); + + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectVirus.php b/vendor/qcloud/cos-sdk-v5/sample/detectVirus.php new file mode 100644 index 00000000..a6984398 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectVirus.php @@ -0,0 +1,44 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 存储桶文件查毒 + $result = $cosClient->detectVirus(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test01.exe' + ), + 'Conf' => array( + 'DetectType' => 'Virus', +// 'Callback' => '', + ), + )); + + // URL查毒 + $result = $cosClient->detectVirus(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://example.com/test01.exe', + ), + 'Conf' => array( + 'DetectType' => 'Virus', +// 'Callback' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php b/vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php new file mode 100644 index 00000000..1095decc --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->detectWebpage(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://www.xxx.com/', +// 'DataId' => '' // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +//// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略 +//// 'ReturnHighlightHtml' => 'true', // 可选 'true' 或者 'false' +//// 'Callback' => '', // 可选 +// ), // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/document2dstType.php b/vendor/qcloud/cos-sdk-v5/sample/document2dstType.php new file mode 100644 index 00000000..8deedea6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/document2dstType.php @@ -0,0 +1,64 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 1. 文档转码 https://cloud.tencent.com/document/product/460/47074 + $bucket = 'examplebucket-125000000'; + $key = 'exampleobject'; + $url = $cosClient->getObjectUrl($bucket, $key); + $params = array( + 'ci-process' => 'doc-preview', +// 'srcType' => '', + 'page' => 3, + 'dstType' => 'png', +// 'password' => '', +// 'comment' => '', +// 'sheet' => '', +// 'excelPaperDirection' => '', +// 'excelRow' => '', +// 'excelCol' => '', +// 'excelPaperSize' => '', +// 'txtPagination' => '', + 'ImageParams' => 'imageMogr2/thumbnail/!50p', +// 'quality' => '', +// 'scale' => '', +// 'imageDpi' => '', + ); + $query = http_build_query($params); + echo $url . $query; // 生成的可访问链接 + + // 2. 文档转HTML https://cloud.tencent.com/document/product/460/52518 + $bucket = 'examplebucket-125000000'; + $key = 'exampleobject'; + $url = $cosClient->getObjectUrl($bucket, $key, "+30 minutes"); + $params = array( + 'ci-process' => 'doc-preview', +// 'srcType' => '', + 'dstType' => 'html', +// 'sign' => '', +// 'copyable' => '', +// 'htmlParams' => '', +// 'htmlwaterword' => '', +// 'htmlfillstyle' => '', +// 'htmlfront' => '', +// 'htmlrotate' => '', +// 'htmlhorizontal' => '', +// 'htmlvertical' => '', + ); + $query = http_build_query($params); + echo $url . $query; // 生成的可访问链接 +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php b/vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php new file mode 100644 index 00000000..481b8962 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->doesBucketExist( + 'examplebucket-125000000'//存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + ); ; + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php b/vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php new file mode 100644 index 00000000..bfcd85b6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->doesObjectExist( + 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'exampleobject' //对象名 + ); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/download.php b/vendor/qcloud/cos-sdk-v5/sample/download.php new file mode 100644 index 00000000..f36097b3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/download.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; + +$printbar = function($totalSize, $downloadedSize) { + printf("downloaded [%d/%d]\n", $downloadedSize, $totalSize); +}; + +try { + $result = $cosClient->download( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = 'exampleobject', + $saveAs = $local_path, + $options=['Progress' => $printbar, //指定进度条 + 'PartSize' => 10 * 1024 * 1024, //分块大小 + 'Concurrency' => 5, //并发数 + 'ResumableDownload' => true, //是否开启断点续传,默认为false + 'ResumableTaskFile' => 'tmp.cosresumabletask' //断点文件信息路径,默认为.cosresumabletask + ] + ); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php b/vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php new file mode 100644 index 00000000..8977fb86 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php @@ -0,0 +1,52 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey + ) + ) +); +$cos_path = 'cos/folder'; +$nextMarker = ''; +$isTruncated = true; + +while ( $isTruncated ) { + try { + $result = $cosClient->listObjects( + ['Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Delimiter' => '', + 'EncodingType' => 'url', + 'Marker' => $nextMarker, + 'Prefix' => $cos_path, + 'MaxKeys' => 1000] + ); + } catch ( \Exception $e ) { + echo( $e ); + } + $isTruncated = $result['IsTruncated']; + $nextMarker = $result['NextMarker']; + foreach ( $result['Contents'] as $content ) { + $cos_file_path = $content['Key']; + $local_file_path = $content['Key']; + // 按照需求自定义拼接下载路径 + try { + $result = $cosClient->download( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = $cos_file_path, + $saveAs = $local_file_path + ); + echo ( $cos_file_path . "\n" ); + } catch ( \Exception $e ) { + echo( $e ); + } + } +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/fileJobs4Hash.php b/vendor/qcloud/cos-sdk-v5/sample/fileJobs4Hash.php new file mode 100644 index 00000000..a32d90c7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/fileJobs4Hash.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/83107 哈希值计算同步请求 + $result = $cosClient->FileJobs4Hash(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'for-test.mp4', // 桶文件 + 'Type' => 'md5', // 支持的哈希算法类型,有效值:md5、sha1、sha256 +// 'AddToHeader' => 'true', // 是否将计算得到的哈希值,自动添加至文件的自定义header,格式为:x-cos-meta-md5/sha1/sha256; 有效值: true、false,不填则默认为false。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); + /** + * 可能出现的 Exception + * 1. Error Message: file processing is not active yet, please apply for file processing service first + * 解决方式:开通文件处理服务 + */ +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getActionSequence.php b/vendor/qcloud/cos-sdk-v5/sample/getActionSequence.php new file mode 100644 index 00000000..1cb5f8dc --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getActionSequence.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 获取动作顺序 https://cloud.tencent.com/document/product/460/48648 + $result = $cosClient->getActionSequence(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php new file mode 100644 index 00000000..366b1c52 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate(); + $blindWatermarkTemplate->setPick(); + $blindWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg"); + $blindWatermarkTemplate->setType(2); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($blindWatermarkTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php new file mode 100644 index 00000000..a6130f4b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketAccelerate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php new file mode 100644 index 00000000..8b1002d6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketDomain(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php new file mode 100644 index 00000000..e3ccc77d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->GetBucketGuetzli(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php new file mode 100644 index 00000000..5536c64e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->GetBucketImageStyle(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'StyleName' => 'stylename', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php new file mode 100644 index 00000000..882c76c6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketInvnetory(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Id' => 'string', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php new file mode 100644 index 00000000..ee6bf312 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketLogging(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php new file mode 100644 index 00000000..96dd058c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketReferer(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php new file mode 100644 index 00000000..39e1c2ca --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketTagging(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php new file mode 100644 index 00000000..ea466857 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketWebsite(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getCiService.php b/vendor/qcloud/cos-sdk-v5/sample/getCiService.php new file mode 100644 index 00000000..694cc671 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getCiService.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 查询数据万象服务 https://cloud.tencent.com/document/product/460/30109 + $result = $cosClient->getCiService(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessBuckets.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessBuckets.php new file mode 100644 index 00000000..3cd99a42 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessBuckets.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + // 查询文档预览开通状态 https://cloud.tencent.com/document/product/460/46945 + $result = $cosClient->describeDocProcessBuckets(array( + 'Regions' => '', // 可选 地域信息,例如 ap-shanghai、ap-beijing,若查询多个地域以“,”分隔字符串 + 'BucketNames' => '', // 可选 存储桶名称,以“,”分隔,支持多个存储桶,精确搜索 + 'BucketName' => '', // 可选 存储桶名称前缀,前缀搜索 + 'PageNumber' => 1, // 可选 第几页 + 'PageSize' => 20, // 可选 每页个数 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php new file mode 100644 index 00000000..17ddcfc6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->describeDocProcessJob(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'examplejobid', // JobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php new file mode 100644 index 00000000..1cbddc8b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDescribeDocProcessJobs(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'QueueId' => 'pd8e422a2ea134165a92f2012ea43****', //拉取该队列 ID 下的任务 + 'Tag' => 'DocProcess', //任务的 Tag:DocProcess 固定值 +// 'NextToken' => '143486', //请求的上下文,用于翻页。上次返回的值 +// 'OrderByTime' => 'Desc', //Desc 或者 Asc。默认为 Desc +// 'Size' => 2, //拉取的最大任务数。默认为10。最大为100 +// 'States' => 'All', //拉取该状态的任务,以,分割,支持多状态:All、Submitted、Running、Success、Failed、Pause、Cancel。默认为 All。 +// 'StartCreationTime' => '2021-10-10T16:20:07+0800', //拉取创建时间大于该时间的任务 +// 'EndCreationTime' => '2021-10-10T16:20:07+0800', //拉取创建时间小于该时间的任务 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php new file mode 100644 index 00000000..8f840b07 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->describeDocProcessQueues(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaBuckets.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaBuckets.php new file mode 100644 index 00000000..fbc0a19e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaBuckets.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->describeMediaBuckets(array( + 'Regions' => '', // 可选 地域信息,例如 ap-shanghai、ap-beijing,若查询多个地域以“,”分隔字符串 + 'BucketNames' => '', // 可选 存储桶名称,以“,”分隔,支持多个存储桶,精确搜索 + 'BucketName' => '', // 可选 存储桶名称前缀,前缀搜索 + 'PageNumber' => 1, // 可选 第几页 + 'PageSize' => 20, // 可选 每页个数 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaQueues.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaQueues.php new file mode 100644 index 00000000..9c446d6c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaQueues.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + // https://cloud.tencent.com/document/product/436/54045 搜索媒体处理队列 + $result = $cosClient->describeMediaQueues(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket +// 'QueueIds' => '', // 可选 队列 ID,以“,”符号分割字符串 +// 'Category' => 'Transcoding', // 可选 CateAll:所有类型;Transcoding:媒体处理队列;SpeedTranscoding:媒体处理倍速转码队列;默认为 Transcoding。 +// 'State' => 'Paused', // 可选 1. Active 表示队列内的作业会被媒体转码服务调度转码执行 2. Paused 表示队列暂停,作业不再会被媒体转码调度转码执行,队列内的所有作业状态维持在暂停状态,已经处于转码中的任务将继续转码,不受影响 +// 'PageNumber' => '1', // 可选 第几页 +// 'PageSize' => '2', // 可选 每页个数 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php new file mode 100644 index 00000000..db0c916d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->describeMediaVoiceSeparateJob(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'examplejobid', // JobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php new file mode 100644 index 00000000..717def13 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectAudioResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php new file mode 100644 index 00000000..7fdfcd1c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectDocumentResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php new file mode 100644 index 00000000..129b89e9 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectImageResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php new file mode 100644 index 00000000..e8bb960c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectTextResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php new file mode 100644 index 00000000..2bd35b79 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectVideoResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php new file mode 100644 index 00000000..b0f30ce7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectVirusResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php new file mode 100644 index 00000000..fa91d2bc --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectWebpageResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getFileCompressResult.php b/vendor/qcloud/cos-sdk-v5/sample/getFileCompressResult.php new file mode 100644 index 00000000..2c0e64c1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getFileCompressResult.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/83113 查询多文件打包压缩结果 + $result = $cosClient->getFileCompressResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getFileHashCodeResult.php b/vendor/qcloud/cos-sdk-v5/sample/getFileHashCodeResult.php new file mode 100644 index 00000000..d31d49d7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getFileHashCodeResult.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/83109 查询哈希值计算结果 + $result = $cosClient->getFileHashCodeResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getFileProcessQueueList.php b/vendor/qcloud/cos-sdk-v5/sample/getFileProcessQueueList.php new file mode 100644 index 00000000..83b5a5ee --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getFileProcessQueueList.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 搜索文件处理队列 +// $result = $cosClient->getFileProcessQueueList(array( +// 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket +//// 'QueueIds' => '', // 队列 ID,以“,”符号分割字符串 +//// 'State' => 'Active', // Active 表示队列内的作业会被调度执行; Paused 表示队列暂停 +//// 'PageNumber' => '1', // 第几页,默认值1 +//// 'PageSize' => '10', // 每页个数,默认值10 +// )); +// // 请求成功 +// print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getFileUncompressResult.php b/vendor/qcloud/cos-sdk-v5/sample/getFileUncompressResult.php new file mode 100644 index 00000000..f6fc7be3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getFileUncompressResult.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/83111 查询文件解压结果 + $result = $cosClient->getFileUncompressResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getHotLink.php b/vendor/qcloud/cos-sdk-v5/sample/getHotLink.php new file mode 100644 index 00000000..48f7749b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getHotLink.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 查询防盗链 https://cloud.tencent.com/document/product/460/30115 + $result = $cosClient->getHotLink(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getLiveCode.php b/vendor/qcloud/cos-sdk-v5/sample/getLiveCode.php new file mode 100644 index 00000000..19ddee67 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getLiveCode.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 获取数字验证码 https://cloud.tencent.com/document/product/460/48647 + $result = $cosClient->getLiveCode(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php b/vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php new file mode 100644 index 00000000..8f842b0f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->GetMediaInfo( + array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' =>'exampleobject', //桶中的媒体文件,如test.mp4 + 'ci-process' => 'videoinfo' //操作类型,固定使用 videoinfo + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php new file mode 100644 index 00000000..e8b5caf0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php @@ -0,0 +1,52 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + /** + * 此接口已不再维护 2021.11.25 + * 图片审核建议使用 detectImage & detectImages 两个接口 + * 新增功能字段会在 detectImage & detectImages 接口维护 + */ + //存储桶图片审核 + $result = $cosClient->getObjectSensitiveContentRecognition(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'DetectType' => 'porn,politics', //可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格 + 'ci-process' => 'sensitive-content-recognition', +// 'Interval' => 5, // 审核gif时使用 截帧的间隔 +// 'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'BizType' => '', // 审核策略 + )); + // 请求成功 + print_r($result); + + + //图片链接审核 + $imgUrl = 'https://test.jpg'; + $result = $cosClient->getObjectSensitiveContentRecognition(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '/', // 链接图片资源路径写 / 即可 + 'DetectType' => 'porn,ads',//可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格 + 'DetectUrl' => $imgUrl, + 'ci-process' => 'sensitive-content-recognition', +// 'Interval' => 5, // 审核gif时使用 截帧的间隔 +// 'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'BizType' => '', // 审核策略 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php new file mode 100644 index 00000000..283c95b3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getObjectTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php new file mode 100644 index 00000000..c295d351 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php @@ -0,0 +1,40 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey + ) + ) +); +$local_path = "/data/exampleobject"; + +try { + $bucket = "examplebucket-1250000000"; //存储桶,存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = "exampleobject"; //对象在存储桶中的位置,即对象键 + $signedUrl = $cosClient->getObjectUrl( + $bucket, + $key, + '+10 minutes', //签名的有效时间 + [ + 'ResponseContentDisposition' => '111', + 'Params' => [ // Params中可以传自定义querystring + 'aaa' => 'bbb', + 'ccc' => 'ddd' + ], + ] + ); + // 请求成功 + echo $signedUrl; +} catch (\Exception $e) { + // 请求失败 + print_r($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php new file mode 100644 index 00000000..74fa63e5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); + +try { + $bucket = 'examplebucket-125000000'; //存储桶,存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = "exampleobject"; //对象在存储桶中的位置,即对象键 + $signedUrl = $cosClient -> getObjectUrlWithoutSign($bucket, $key); + + // 请求成功 + echo $signedUrl; +} catch (\Exception $e) { + // 请求失败 + print_r($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getOriginProtect.php b/vendor/qcloud/cos-sdk-v5/sample/getOriginProtect.php new file mode 100644 index 00000000..821fcbdc --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getOriginProtect.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 查询原图保护状态 https://cloud.tencent.com/document/product/460/30120 + $result = $cosClient->getOriginProtect(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php b/vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php new file mode 100644 index 00000000..28753c53 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $signedUrl = $cosClient->getPresignedUrl( + $method='getObject', + $args=array( + 'Bucket'=>'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key'=>'exampleobject', + 'Body'=>'', + 'Params'=>array(), + 'Headers'=>array()), //若上传加入headers,content-md5写法为"content-md5" => base64_encode( md5( Body, true ) ) + $expires='+30 minutes'); + // 请求成功 + echo($signedUrl); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getPrivateM3U8.php b/vendor/qcloud/cos-sdk-v5/sample/getPrivateM3U8.php new file mode 100644 index 00000000..d8148164 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getPrivateM3U8.php @@ -0,0 +1,28 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->GetPrivateM3U8(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'xxx.m3u8', // 桶文件 + 'ci-process' => 'pm3u8', // 操作类型,固定使用 pm3u8 + 'expires' => '3600', // 私有 ts 资源 url 下载凭证的相对有效期,单位为秒,范围为[3600, 43200] + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php b/vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php new file mode 100644 index 00000000..7071eeec --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php @@ -0,0 +1,41 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$time = 3.14; +$local_path = "/data/exampleobject/test.jpg"; +try { + /* + * 如果访问400,media bucket unbinded, bucket's host is unavailable + * 请先在控制台开启媒体处理开关 + */ + $result = $cosClient->getSnapshot( + array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' =>'exampleobject', //桶中的媒体文件,如test.mp4 + 'ci-process' => 'snapshot', //操作类型,固定使用 snapshot + 'Time' => $time, //截图的时间点,单位为秒 + 'SaveAs' => $local_path, //本地保存路径 +// 'Width' => 0, +// 'Height' => 0, +// 'Format' => 'jpg', +// 'Rotate' => 'auto', +// 'Mode' => 'exactframe', + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstance.php b/vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstance.php new file mode 100644 index 00000000..7de15eea --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstance.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', // 默认http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/53992 获取工作流实例详情 + $result = $cosClient->getWorkflowInstance(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // RunId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstances.php b/vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstances.php new file mode 100644 index 00000000..ab76d09a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getWorkflowInstances.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', // 默认http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/53993 获取工作流实例列表 + $result = $cosClient->getWorkflowInstances(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'workflowId' => 'w9938ed4b1435448783xxxxxxxxxxxxxx', +// 'name' => '', +// 'orderByTime' => '', +// 'size' => '', +// 'states' => '', +// 'startCreationTime' => '', +// 'endCreationTime' => '', +// 'nextToken' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/iDCardOCR.php b/vendor/qcloud/cos-sdk-v5/sample/iDCardOCR.php new file mode 100644 index 00000000..9f9a0964 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/iDCardOCR.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 身份证识别 https://cloud.tencent.com/document/product/460/48638 + // 1. 云上数据处理 + $result = $cosClient->iDCardOCR(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // ObjectKey +// 'CardSide' => 'FRONT', // 身份证正反面 +// 'Config' => '{"CropIdCard":true,"CropPortrait":true}', + )); + print_r($result); + + // 2. 上传时处理 + $result = $cosClient->iDCardOCRByUpload(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // ObjectKey + 'Body' => fopen('/tmp/test.jpg', 'rb'), +// 'CardSide' => 'FRONT', // 身份证正反面 +// 'Config' => '{"CropIdCard":true,"CropPortrait":true}', + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageAssessQualityProcess.php b/vendor/qcloud/cos-sdk-v5/sample/imageAssessQualityProcess.php new file mode 100644 index 00000000..d1758fcd --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageAssessQualityProcess.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片质量评估 - https://cloud.tencent.com/document/product/460/63228 + $result = $cosClient->imageAssessQualityProcess(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageAve.php b/vendor/qcloud/cos-sdk-v5/sample/imageAve.php new file mode 100644 index 00000000..5f8b4a9f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageAve.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->ImageAve(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageDetectCarProcess.php b/vendor/qcloud/cos-sdk-v5/sample/imageDetectCarProcess.php new file mode 100644 index 00000000..4c9aff56 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageDetectCarProcess.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 车辆车牌检测 - https://cloud.tencent.com/document/product/460/63225 + $result = $cosClient->imageDetectCarProcess(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageDetectFace.php b/vendor/qcloud/cos-sdk-v5/sample/imageDetectFace.php new file mode 100644 index 00000000..06fb08d2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageDetectFace.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 人脸检测 https://cloud.tencent.com/document/product/460/63223 + $result = $cosClient->imageDetectFace(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // ObjectKey +// 'MaxFaceNum' => 1, // 最多处理的人脸数目。默认值为1(仅检测图片中面积最大的那张人脸),最大值为120。此参数用于控制处理待检测图片中的人脸个数,值越小,处理速度越快。 + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageExif.php b/vendor/qcloud/cos-sdk-v5/sample/imageExif.php new file mode 100644 index 00000000..01065426 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageExif.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->ImageExif(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageFaceEffect.php b/vendor/qcloud/cos-sdk-v5/sample/imageFaceEffect.php new file mode 100644 index 00000000..a022fe21 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageFaceEffect.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 人脸特效 https://cloud.tencent.com/document/product/460/47197 + $result = $cosClient->imageFaceEffect(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // ObjectKey + 'type' => 'face-beautify', // 人脸特效类型。人脸美颜:face-beautify;人脸性别转换:face-gender-transformation;人脸年龄变化:face-age-transformation;人像分割:face-segmentation + 'whitening' => 30, + 'smoothing' => 10, + 'faceLifting' => 70, + 'eyeEnlarging' => 70, + 'gender' => 1, + 'age' => 18, + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageInfo.php b/vendor/qcloud/cos-sdk-v5/sample/imageInfo.php new file mode 100644 index 00000000..271c2a61 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageInfo.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->ImageInfo(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageMogr.php b/vendor/qcloud/cos-sdk-v5/sample/imageMogr.php new file mode 100644 index 00000000..a622803e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageMogr.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $imageMogrTemplate->rotate(50); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $imageMogrTemplate->queryString(), + 'SaveAs' => '/data/exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcess.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcess.php new file mode 100644 index 00000000..15da864c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcess.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($imageMogrTemplate, "resultobject"); + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessBright.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessBright.php new file mode 100644 index 00000000..90bc4750 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessBright.php @@ -0,0 +1,57 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-亮度 https://cloud.tencent.com/document/product/460/51808 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->bright(70); // 图片亮度调节 /bright/ + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessChannel.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessChannel.php new file mode 100644 index 00000000..2039c95c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessChannel.php @@ -0,0 +1,65 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-管道操作符 https://cloud.tencent.com/document/product/460/15293 + $imageMogrRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrRule->thumbnailByScale(50); + $imageMogrRule->rotate(50); + $imageViewRule = new Qcloud\Cos\ImageParamTemplate\ImageViewTemplate(); + $imageViewRule->setMode(1); + $imageViewRule->setWidth(400); + $imageViewRule->setHeight(600); + $imageViewRule->setQuality(1, 85); + $ciParamChannel = new Qcloud\Cos\ImageParamTemplate\CIParamTransformation(); + $ciParamChannel->addRule($imageMogrRule); // 多种处理方式 以 “|” 连接 + $ciParamChannel->addRule($imageViewRule); // 多种处理方式 以 “|” 连接 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($ciParamChannel, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $ciParamChannel->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessContrast.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessContrast.php new file mode 100644 index 00000000..83ca0b08 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessContrast.php @@ -0,0 +1,57 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-对比度 https://cloud.tencent.com/document/product/460/51809 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->contrast(-70); // 图片对比度调节 /contrast/ + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessCrop.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessCrop.php new file mode 100644 index 00000000..75c6c900 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessCrop.php @@ -0,0 +1,62 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-裁剪 https://cloud.tencent.com/document/product/460/36541 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->cut(400, 400, 100, 100); // 普通裁剪参数 /cut/xxx + $imageRule->cropByWidth(400, 'center'); // 缩放裁剪参数 /crop/x + $imageRule->cropByHeight(400, 'center'); // 缩放裁剪参数 /crop/x + $imageRule->cropByWH(400, 400, 'center'); // 缩放裁剪参数 /crop/x + $imageRule->iradius(30); // 内切圆裁剪参数 /iradius/ + $imageRule->rradius(30); // 圆角裁剪参数 /rradius/ + $imageRule->scrop(30, 30); // 人脸智能裁剪参数 /scrop/x + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormat.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormat.php new file mode 100644 index 00000000..e2936458 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormat.php @@ -0,0 +1,58 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-格式转换 https://cloud.tencent.com/document/product/460/36543 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->format('jpg'); // 格式转换 /format/ + $imageRule->gifOptimization(1); // gif 格式优化 /cgif/ + $imageRule->jpegInterlaceMode(1); // 输出为渐进式 jpg 格式。Mode 可为0或1 /interlace/ + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatAvif.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatAvif.php new file mode 100644 index 00000000..7029b1fe --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatAvif.php @@ -0,0 +1,55 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-AVIF 压缩 https://cloud.tencent.com/document/product/460/60527 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->format('avif'); // 格式转换 /format/ + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatHeif.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatHeif.php new file mode 100644 index 00000000..05f7e404 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatHeif.php @@ -0,0 +1,55 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-HEIF 压缩 https://cloud.tencent.com/document/product/460/60525 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->format('heif'); // 格式转换 /format/ + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatSvgc.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatSvgc.php new file mode 100644 index 00000000..dcaaa91b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatSvgc.php @@ -0,0 +1,55 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-SVG 压缩 https://cloud.tencent.com/document/product/460/78141 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->format('svgc'); // 格式转换 /format/ + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.svg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.svg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.svg', + 'Body' => fopen('/tmp/local.svg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.svg', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatTpg.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatTpg.php new file mode 100644 index 00000000..9bdc9b9c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatTpg.php @@ -0,0 +1,55 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-TPG 压缩 https://cloud.tencent.com/document/product/460/60526 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->format('tpg'); // 格式转换 /format/ + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatWebp.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatWebp.php new file mode 100644 index 00000000..7fcf02a0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessFormatWebp.php @@ -0,0 +1,55 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-WebP 压缩 https://cloud.tencent.com/document/product/460/60524 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->format('webp'); // 格式转换 /format/ + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessGaussianBlur.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessGaussianBlur.php new file mode 100644 index 00000000..8f093813 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessGaussianBlur.php @@ -0,0 +1,56 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-高斯模糊 https://cloud.tencent.com/document/product/460/36545 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->blur(8, 5); // 高斯模糊 /blur/x + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessGrayscale.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessGrayscale.php new file mode 100644 index 00000000..6b7f7292 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessGrayscale.php @@ -0,0 +1,57 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-灰度图 https://cloud.tencent.com/document/product/460/66519 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->grayscale(1); // 将图片设置为灰度图 /grayscale/ + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessImageView.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessImageView.php new file mode 100644 index 00000000..342222e4 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessImageView.php @@ -0,0 +1,61 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-快速缩略模板 https://cloud.tencent.com/document/product/460/6929 + $imageViewRule = new Qcloud\Cos\ImageParamTemplate\ImageViewTemplate(); + $imageViewRule->setMode(1); // / + $imageViewRule->setWidth(400); // /w/ + $imageViewRule->setHeight(600); // /h/ + $imageViewRule->setFormat('jpg'); // /format/ + $imageViewRule->setQuality(1, 85); // 1-/q/; 2-/rq/; 3-/lq/ + $imageViewRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageViewRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageViewRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessQuality.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessQuality.php new file mode 100644 index 00000000..48082d81 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessQuality.php @@ -0,0 +1,58 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-质量变换 https://cloud.tencent.com/document/product/460/36544 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->quality(90, 1); // 绝对质量 /quality/ + $imageRule->lowestQuality(90); // 最低质量 /lquality/ + $imageRule->relativelyQuality(90); // 相对质量 /rquality/ + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessRotate.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessRotate.php new file mode 100644 index 00000000..dd15fb11 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessRotate.php @@ -0,0 +1,58 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-旋转 https://cloud.tencent.com/document/product/460/36542 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->rotate(90); // /rotate/ + $imageRule->autoOrient(); // /auto-orient + $imageRule->flip('vertical'); // /flip/ + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessSharpen.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessSharpen.php new file mode 100644 index 00000000..1a478077 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessSharpen.php @@ -0,0 +1,57 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-锐化 https://cloud.tencent.com/document/product/460/36546 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->sharpen(70); // 图片锐化 /sharpen/ + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessSizeLimit.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessSizeLimit.php new file mode 100644 index 00000000..ad666a4d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessSizeLimit.php @@ -0,0 +1,57 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-限制图片大小 https://cloud.tencent.com/document/product/460/56732 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->sizeLimit(15, 1); // 可限制图片处理(例如缩放、压缩等)后的文件大小 /size-limit/! + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessStrip.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessStrip.php new file mode 100644 index 00000000..b36e0894 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessStrip.php @@ -0,0 +1,57 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-去除元信息 https://cloud.tencent.com/document/product/460/36547 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->strip(); // 去除图片元信息,包括 exif 信息 /strip + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessThumbnail.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessThumbnail.php new file mode 100644 index 00000000..675ba86a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessThumbnail.php @@ -0,0 +1,68 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 图片处理-缩放 https://cloud.tencent.com/document/product/460/36540 + $imageRule = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageRule->thumbnailByScale(50); // /thumbnail/!p + $imageRule->thumbnailByWidthScale(50); // /thumbnail/!px + $imageRule->thumbnailByHeightScale(50); // /thumbnail/!xp + $imageRule->thumbnailByWidth(60); // /thumbnail/x + $imageRule->thumbnailByHeight(60); // /thumbnail/x + $imageRule->thumbnailByMaxWH(100, 100); // /thumbnail/x + $imageRule->thumbnailByMinWH(30, 30); // /thumbnail/!xr + $imageRule->thumbnailByWH(50, 50); // /thumbnail/x! + $imageRule->thumbnailByPixel(10000); // /thumbnail/@ + $imageRule->thumbnailEqualRatioReduceByWH(300, 300); // /thumbnail/x> + $imageRule->thumbnailEqualRatioEnlargeByWH(300, 300); // /thumbnail/x< + $imageRule->pad(1); // /pad/1 + $imageRule->color('#3D3D3D'); // /color/IzNEM0QzRA + $imageRule->ignoreError(); // /ignore-error/1 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkImage.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkImage.php new file mode 100644 index 00000000..5f5d9e98 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkImage.php @@ -0,0 +1,65 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-图片水印 https://cloud.tencent.com/document/product/460/6930 + $imageWatermarkRule = new Qcloud\Cos\ImageParamTemplate\ImageWatermarkTemplate(); + $imageWatermarkRule->setImage('https://www.xxx.com/xxx.jpg'); // 水印图片地址 + $imageWatermarkRule->setGravity('SouthEast'); // 图片水印位置 + $imageWatermarkRule->setDx(10); // 水平(横轴)边距,单位为像素,缺省值为0 + $imageWatermarkRule->setDy(10); // 垂直(纵轴)边距,单位为像素,默认值为0 + $imageWatermarkRule->setBlogo(1); // 水印图适配功能,适用于水印图尺寸过大的场景(如水印墙) + $imageWatermarkRule->setScatype(1); // 根据原图的大小,缩放调整水印图的大小 + $imageWatermarkRule->setSpcent(200); // 与 scatype 搭配使用 + $imageWatermarkRule->setDissolve(70); // 图片水印的透明度 + $imageWatermarkRule->setBatch(1); // 平铺水印功能,可将图片水印平铺至整张图片 + $imageWatermarkRule->setDegree(90); // 当 batch 值为1时生效。图片水印的旋转角度设置 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($imageWatermarkRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $imageWatermarkRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkText.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkText.php new file mode 100644 index 00000000..7b7f2d0e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcessWatermarkText.php @@ -0,0 +1,66 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 图片处理-文字水印 https://cloud.tencent.com/document/product/460/6951 + $textWatermarkRule = new Qcloud\Cos\ImageParamTemplate\TextWatermarkTemplate(); + $textWatermarkRule->setText('水印内容'); // 水印内容 + $textWatermarkRule->setFont('tahoma.ttf'); // 水印字体 + $textWatermarkRule->setFontsize(13); // 水印文字字体大小 + $textWatermarkRule->setFill('#3D3D3D'); // 字体颜色,缺省为灰色,需设置为十六进制 RGB 格式(例如 #FF0000) + $textWatermarkRule->setDissolve(90); // 文字透明度,取值1 - 100 ,默认90(90%不透明度) + $textWatermarkRule->setGravity('SouthEast'); // 文字水印位置,九宫格位置(参见九宫格方位图),默认值 SouthEast + $textWatermarkRule->setDx(10); // 水平(横轴)边距,单位为像素,缺省值为0 + $textWatermarkRule->setDy(10); // 垂直(纵轴)边距,单位为像素,默认值为0 + $textWatermarkRule->setBatch(1); // 平铺水印功能,可将文字水印平铺至整张图片。值为1时,表示开启平铺水印功能 + $textWatermarkRule->setDegree(10); // 当 batch 值为1时生效。文字水印的旋转角度设置,取值范围为0 - 360,默认0 + $textWatermarkRule->setShadow(10); // 文字阴影效果,有效值为[0,100],默认为0,表示无阴影 + + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($textWatermarkRule, "output.png"); // rules + + // -------------------- 1. 下载时处理 -------------------- // +// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接 + $downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接 + $rule = $textWatermarkRule->queryString(); + echo "{$downloadUrl}?{$rule}"; +// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接 + // -------------------- 1. 下载时处理 -------------------- // + + // -------------------- 2. 上传时处理 -------------------- // + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'object.jpg', + 'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 2. 上传时处理 -------------------- // + + // -------------------- 3. 云上数据处理 -------------------- // + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // -------------------- 3. 云上数据处理 -------------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageRepairProcess.php b/vendor/qcloud/cos-sdk-v5/sample/imageRepairProcess.php new file mode 100644 index 00000000..6d0d9107 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageRepairProcess.php @@ -0,0 +1,65 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // --------------------- 1. 保存效果图到本地 ------------------------------ // + $imageUrl = 'https://www.xxx.com/xxx.jpg'; + $result = $cosClient->imageRepairProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.jpg', + 'ci-process' => 'ImageRepair', + 'MaskPic' => base64_encode($imageUrl), +// 'MaskPoly' => base64_encode('[[[200, 200], [400, 200], [400, 400], [200, 400]]]'), + 'SaveAs' => '/tmp/imageRepair.jpg' // 本地保存路径 + )); + // 请求成功 + print_r($result); + // --------------------- 1. 保存效果图到本地 ------------------------------ // + + // --------------------- 2. 上传时处理 ------------------------------ // + $ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('ImageRepair'); + $ciProcessParams->addParam('MaskPic', 'https://www.xxx.com/xxx.jpg', true); // MaskPic/MaskPoly 二选一 +// $ciProcessParams->addParam('MaskPoly', '[[[200, 200], [400, 200], [400, 400], [200, 400]]]', true); // MaskPic/MaskPoly 二选一 + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($ciProcessParams, 'output.jpg', 'examplebucket-1250000000'); // rules + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'imageRepair.jpg', + 'Body' => fopen('/tmp/imageRepair.jpg', 'rb'), // 本地文件 + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // --------------------- 2. 上传时处理 ------------------------------ // + + // --------------------- 3. 云上数据处理 ------------------------------ // + $ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('ImageRepair'); + $ciProcessParams->addParam('MaskPic', 'https://www.xxx.com/xxx.jpg', true); // MaskPic/MaskPoly 二选一 +// $ciProcessParams->addParam('MaskPoly', '[[[200, 200], [400, 200], [400, 400], [200, 400]]]', true); // MaskPic/MaskPoly 二选一 + $picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperations->setIsPicInfo(1); // is_pic_info + $picOperations->addRule($ciProcessParams, 'output.jpg', 'examplebucket-1250000000'); // rules + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.jpg', + 'PicOperations' => $picOperations->queryString(), + )); + // 请求成功 + print_r($result); + // --------------------- 3. 云上数据处理 ------------------------------ // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageView.php b/vendor/qcloud/cos-sdk-v5/sample/imageView.php new file mode 100644 index 00000000..f5192248 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageView.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageViewTemplate = new Qcloud\Cos\ImageParamTemplate\ImageViewTemplate(); + $imageViewTemplate->setMode(1); + $imageViewTemplate->setWidth(400); + $imageViewTemplate->setHeight(600); + $imageViewTemplate->setQuality(1, 85); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $imageViewTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php new file mode 100644 index 00000000..71323d2a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\ImageWatermarkTemplate(); + $imageWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg"); + $imageWatermarkTemplate->setGravity('center'); + $imageWatermarkTemplate->setDx(10); + $imageWatermarkTemplate->setDy(10); + $imageWatermarkTemplate->setSpcent(100); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $imageWatermarkTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/listBuckets.php b/vendor/qcloud/cos-sdk-v5/sample/listBuckets.php new file mode 100644 index 00000000..6667dc73 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/listBuckets.php @@ -0,0 +1,23 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->listBuckets(); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/openFileProcessService.php b/vendor/qcloud/cos-sdk-v5/sample/openFileProcessService.php new file mode 100644 index 00000000..f46da1f0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/openFileProcessService.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 开通文件处理服务 +// $result = $cosClient->openFileProcessService(array( +// 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket +// )); +// // 请求成功 +// print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/openOriginProtect.php b/vendor/qcloud/cos-sdk-v5/sample/openOriginProtect.php new file mode 100644 index 00000000..39c2076f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/openOriginProtect.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 开通原图保护 https://cloud.tencent.com/document/product/460/30121 + $result = $cosClient->openOriginProtect(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/opticalOcrRecognition.php b/vendor/qcloud/cos-sdk-v5/sample/opticalOcrRecognition.php new file mode 100644 index 00000000..e85780c3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/opticalOcrRecognition.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/64324 通用文字识别 + $result = $cosClient->opticalOcrRecognition(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test01.pdf', + 'CiProcess' => 'OCR', + 'Type' => 'general', + 'LanguageType' => 'zh', + 'IsPDF' => 'true', + 'PdfPageNumber' => 2, + 'IsWord' => 'true', + 'EnableWordPolygon' => 'false', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/picOperations.php b/vendor/qcloud/cos-sdk-v5/sample/picOperations.php new file mode 100644 index 00000000..2f1bc720 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/picOperations.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(0); + $picOperationsTemplate->addRule($imageMogrTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php new file mode 100644 index 00000000..8735786e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php @@ -0,0 +1,34 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate(); + $blindWatermarkTemplate->setText("Test"); + $blindWatermarkTemplate->setType(3); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($blindWatermarkTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php new file mode 100644 index 00000000..dca62f34 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketAccelerate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Status' => 'Enabled' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php new file mode 100644 index 00000000..5d8f6ecd --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketDomain(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'DomainRules' => array( + array( + 'Name' => 'www.qq.com', + 'Status' => 'ENABLED', + 'Type' => 'REST', + 'ForcedReplacement' => 'CNAME', + ), + // ... repeated + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php new file mode 100644 index 00000000..11e896aa --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->PutBucketGuetzli(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php new file mode 100644 index 00000000..f50d6b39 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->PutBucketImageStyle(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'StyleName' => 'stylename', + 'StyleBody' => 'imageMogr2/thumbnail/!50px', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php new file mode 100644 index 00000000..5ad80708 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php @@ -0,0 +1,45 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketInventory(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Id' => 'string', + 'Destination' => array( + 'COSBucketDestination'=>array( + 'Format' => 'CSV', + 'AccountId' => '125000000', + 'Bucket' => 'qcs::cos:ap-chengdu::examplebucket-125000000', + 'Prefix' => 'string', + ) + ), + 'IsEnabled' => 'True', + 'Schedule' => array( + 'Frequency' => 'Daily', + ), + 'Filter' => array( + 'Prefix' => 'string', + ), + 'IncludedObjectVersions' => 'Current', + 'OptionalFields' => array( + 'Size', + 'ETag', + ) + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php new file mode 100644 index 00000000..0f1fcf06 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php @@ -0,0 +1,28 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketLogging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'LoggingEnabled' => array( + 'TargetBucket' => 'examplebucket2-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'TargetPrefix' => '', + ) + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php new file mode 100644 index 00000000..64ba0bcb --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketReferer( + array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Status' => 'Enabled', //是否开启防盗链,枚举值:Enabled、Disabled + 'RefererType' => 'White-List', //防盗链类型,枚举值:Black-List、White-List + 'DomainList' => array( + 'Domains' => array( + '*.qq.com', + '*.qcloud.com', + ) + ), //生效域名列表 +// 'EmptyReferConfiguration' => 'Allow',//是否允许空 Referer 访问,枚举值:Allow、Deny,默认值为 Deny + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php new file mode 100644 index 00000000..63fd9908 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'TagSet' => array( + array('Key'=>'key1', + 'Value'=>'value1', + ), + array('Key'=>'key2', + 'Value'=>'value2', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php new file mode 100644 index 00000000..52bcae3f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php @@ -0,0 +1,46 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->putBucketWebsite(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'IndexDocument' => array( + 'Suffix' => 'index.html', + ), + 'RedirectAllRequestsTo' => array( + 'Protocol' => 'https', + ), + 'ErrorDocument' => array( + 'Key' => 'Error.html', + ), + 'RoutingRules' => array( + array( + 'Condition' => array( + 'HttpErrorCodeReturnedEquals' => '405', + ), + 'Redirect' => array( + 'Protocol' => 'https', + 'ReplaceKeyWith' => '404.html', + ), + ), + // ... repeated + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php new file mode 100644 index 00000000..e3ad43c2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $imageStyleTemplate = new Qcloud\Cos\ImageParamTemplate\ImageStyleTemplate(); + $imageStyleTemplate->setStyle("stylename"); + $picOperationsTemplate = new \Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($imageStyleTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php b/vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php new file mode 100644 index 00000000..7a53ff3c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putObjectTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'TagSet' => array( + array('Key'=>'key1', + 'Value'=>'value1', + ), + array('Key'=>'key2', + 'Value'=>'value2', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putQrcode.php b/vendor/qcloud/cos-sdk-v5/sample/putQrcode.php new file mode 100644 index 00000000..e7a7d1a8 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putQrcode.php @@ -0,0 +1,34 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + // 图片上传时识别二维码 + $imageQrcodeTemplate = new Qcloud\Cos\ImageParamTemplate\ImageQrcodeTemplate(); + $imageQrcodeTemplate->setMode(0); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($imageQrcodeTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/qrcode.php b/vendor/qcloud/cos-sdk-v5/sample/qrcode.php new file mode 100644 index 00000000..1cf27d96 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/qrcode.php @@ -0,0 +1,27 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 二维码下载时识别 + $result = $cosClient->Qrcode(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Cover' => 0, + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php b/vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php new file mode 100644 index 00000000..b686a55a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php @@ -0,0 +1,28 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 二维码生成 + $result = $cosClient->QrcodeGenerate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'QrcodeContent' => '', + 'QrcodeMode' => 0, + 'QrcodeWidth' => '200', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php b/vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php new file mode 100644 index 00000000..8c80a22b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php @@ -0,0 +1,85 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey + ) +)); +try { + $result = $cosClient->selectObjectContent(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Expression' => 'Select * from COSObject s', + 'ExpressionType' => 'SQL', + 'InputSerialization' => array( + 'CompressionType' => 'None', + 'CSV' => array( + 'FileHeaderInfo' => 'NONE', + 'RecordDelimiter' => '\n', + 'FieldDelimiter' => ',', + 'QuoteEscapeCharacter' => '"', + 'Comments' => '#', + 'AllowQuotedRecordDelimiter' => 'FALSE' + ) + ), + 'OutputSerialization' => array( + 'CSV' => array( + 'QuoteField' => 'ASNEEDED', + 'RecordDelimiter' => '\n', + 'FieldDelimiter' => ',', + 'QuoteCharacter' => '"', + 'QuoteEscapeCharacter' => '"' + ) + ), + 'RequestProgress' => array( + 'Enabled' => 'FALSE' + ) + )); + // 请求成功 + foreach ($result['Data'] as $data) { + // 迭代遍历select结果 + print_r($data); + } +} catch (\Exception $e) { + // 请求失败 + echo($e); +} + +try { + $result = $cosClient->selectObjectContent(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Expression' => 'Select * from COSObject s', + 'ExpressionType' => 'SQL', + 'InputSerialization' => array( + 'CompressionType' => 'None', + 'JSON' => array( + 'Type' => 'DOCUMENT' + ) + ), + 'OutputSerialization' => array( + 'JSON' => array( + 'RecordDelimiter' => '\n', + ) + ), + 'RequestProgress' => array( + 'Enabled' => 'FALSE' + ) + )); + // 请求成功 + foreach ($result['Data'] as $data) { + // 迭代遍历select结果 + print_r($data); + } +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/textWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/textWatermark.php new file mode 100644 index 00000000..13ace3e5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/textWatermark.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $textWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\TextWatermarkTemplate(); + $textWatermarkTemplate->setText("testetst"); + $textWatermarkTemplate->setGravity('center'); + $textWatermarkTemplate->setFontsize(30); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $textWatermarkTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php b/vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php new file mode 100644 index 00000000..20d6bca6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php @@ -0,0 +1,40 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +$local_path = '/data/exampleobject'; +try { + //上传对象,单链接限速 + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'TrafficLimit' => 8 * 1024 * 1024 // 限制为1MB/s + )); + // 请求成功 + print_r($result); + + //下载对象,单链接限速 + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'SaveAs' => $local_path, + 'TrafficLimit' => 8 * 1024 * 1024 // 限制为1MB/s + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/triggerWorkflow.php b/vendor/qcloud/cos-sdk-v5/sample/triggerWorkflow.php new file mode 100644 index 00000000..91a70626 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/triggerWorkflow.php @@ -0,0 +1,28 @@ + $region, + 'schema' => 'https', // 默认http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54641 手动触发工作流 + $result = $cosClient->triggerWorkflow(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'workflowId' => 'w9938ed4b1435448783xxxxxxxxxxxxxx', + 'object' => 'test01.png', +// 'name' => 'xxx', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/unBindCiService.php b/vendor/qcloud/cos-sdk-v5/sample/unBindCiService.php new file mode 100644 index 00000000..03b42f53 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/unBindCiService.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + // 解绑数据万象服务 https://cloud.tencent.com/document/product/460/30110 + $result = $cosClient->unBindCiService(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateDocProcessQueue.php b/vendor/qcloud/cos-sdk-v5/sample/updateDocProcessQueue.php new file mode 100644 index 00000000..e38e0296 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateDocProcessQueue.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 更新文档转码队列 https://cloud.tencent.com/document/product/460/46947 + $result = $cosClient->updateDocProcessQueue(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // QueueID + 'Name' => '', + 'QueueID' => '', + 'State' => '', + 'NotifyConfig' => array( + 'Url' => '', + 'Type' => '', + 'Event' => '', + 'State' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateFileProcessQueue.php b/vendor/qcloud/cos-sdk-v5/sample/updateFileProcessQueue.php new file mode 100644 index 00000000..e0cbc4ba --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateFileProcessQueue.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 更新文件处理的队列 +// $result = $cosClient->updateFileProcessQueue(array( +// 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket +// 'Key' => 'pcc3ae89sa9d807fs89dg789sdg', // queueId +// 'Name' => 'queue-file-process-name', // 队列名称,长度不超过128 +// 'State' => 'Active', // Active 表示队列内的作业会被调度执行; Paused 表示队列暂停 +// 'NotifyConfig' => array( +// 'State' => '', +// 'Event' => '', +// 'ResultFormat' => '', +// 'Type' => '', +// 'Url' => '', +// 'MqMode' => '', +// 'MqRegion' => '', +// 'MqName' => '', +// ), +// )); +// // 请求成功 +// print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaAnimationTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaAnimationTemplate.php new file mode 100644 index 00000000..3403d9c1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaAnimationTemplate.php @@ -0,0 +1,45 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54028 更新动图模板 + $result = $cosClient->updateMediaAnimationTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'Animation', + 'Name' => 'Animation-Template-Name', + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'AnimateOnlyKeepKeyFrame' => '', + 'AnimateTimeIntervalOfFrame' => '', + 'AnimateFramesPerSecond' => '', + 'Quality' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaConcatTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaConcatTemplate.php new file mode 100644 index 00000000..ed325b79 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaConcatTemplate.php @@ -0,0 +1,57 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54044 更新拼接模板 + $result = $cosClient->updateMediaConcatTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'Concat', + 'Name' => 'Concat-Template-Name', + 'ConcatTemplate' => array( + 'ConcatFragments' => array( + array( + 'Mode' => 'Start', + 'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/video01.mp4', + ), + array( + 'Mode' => 'End', + 'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/video02.mp4', + ), + ), + 'Audio' => array( + 'Codec' => 'aac', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + 'Video' => array( + 'Codec' => 'h.264', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Bitrate' => '', + 'Remove' => 'false', + ), + 'Container' => array( + 'Format' => 'mp4', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaHighSpeedHdTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaHighSpeedHdTemplate.php new file mode 100644 index 00000000..4d8ce457 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaHighSpeedHdTemplate.php @@ -0,0 +1,61 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/58310 更新极速高清转码模板 + $result = $cosClient->updateMediaHighSpeedHdTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'HighSpeedHd', + 'Name' => 'HighSpeedHd-Template-Name', + 'Container' => array( + 'Format' => '', + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Profile' => '', + 'Bitrate' => '', + 'Crf' => '', + 'Gop' => '', + 'Preset' => '', + 'Bufsize' => '', + 'Maxrate' => '', + 'HlsTsTime' => '', + 'Pixfmt' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + 'Audio' => array( + 'Codec' => '', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + 'TransConfig' => array( + 'IsCheckReso' => '', + 'ResoAdjMethod' => '', + 'IsHdr2Sdr' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaPicProcessTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaPicProcessTemplate.php new file mode 100644 index 00000000..c6834370 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaPicProcessTemplate.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/67228 更新图片处理模板 + $result = $cosClient->updateMediaPicProcessTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'PicProcess', + 'Name' => 'PicProcess-Template-Name', + 'PicProcess' => array( + 'IsPicInfo' => '', + 'ProcessRule' => 'imageMogr2/rotate/90', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaQueue.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaQueue.php new file mode 100644 index 00000000..288ad2f7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaQueue.php @@ -0,0 +1,39 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + // https://cloud.tencent.com/document/product/436/54046 更新媒体处理队列 + $result = $cosClient->updateMediaQueue(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'xxx', // queueId + 'Name' => '', // 模板名称, 长度限制100字符 + 'State' => 'Active', // 管道状态 + 'NotifyConfig' => array( + 'State' => 'Off', +// 'Event' => '', +// 'ResultFormat' => '', +// 'Type' => '', +// 'Url' => '', +// 'MqMode' => '', +// 'MqRegion' => '', +// 'MqName' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaSnapshotTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaSnapshotTemplate.php new file mode 100644 index 00000000..1e4c94d5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaSnapshotTemplate.php @@ -0,0 +1,36 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54032 更新截图模板 + $result = $cosClient->updateMediaSnapshotTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'Snapshot', + 'Name' => 'Snapshot-Template-Name', + 'Snapshot' => array( + 'Mode' => '', + 'Start' => '', + 'TimeInterval' => '', + 'Count' => '', + 'Width' => '', + 'Height' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaSuperResolutionTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaSuperResolutionTemplate.php new file mode 100644 index 00000000..7358f67f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaSuperResolutionTemplate.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->updateMediaSuperResolutionTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'SuperResolution', + 'Name' => 'SuperResolution-Template-Name', + 'Resolution' => '', + 'EnableScaleUp' => '', + 'Version' => '', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaTranscodeTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaTranscodeTemplate.php new file mode 100644 index 00000000..68d4bd27 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaTranscodeTemplate.php @@ -0,0 +1,80 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54040 更新转码模板 + $result = $cosClient->updateMediaTranscodeTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'Transcode', + 'Name' => 'Transcode-Template-Name', + 'Container' => array( + 'Format' => '', + 'ClipConfig' => array( + 'Duration' => '', + ), + ), + 'Video' => array( + 'Codec' => '', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Remove' => '', + 'Profile' => '', + 'Bitrate' => '', + 'Crf' => '', + 'Gop' => '', + 'Preset' => '', + 'Bufsize' => '', + 'Maxrate' => '', + 'Pixfmt' => '', + 'LongShortMode' => '', + 'Rotate' => '', + ), + 'TimeInterval' => array( + 'Start' => '', + 'Duration' => '', + ), + 'Audio' => array( + 'Codec' => '', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + 'Remove' => '', + 'KeepTwoTracks' => '', + 'SwitchTrack' => '', + 'SampleFormat' => '', + ), + 'TransConfig' => array( + 'AdjDarMethod' => '', + 'IsCheckReso' => '', + 'ResoAdjMethod' => '', + 'IsCheckVideoBitrate' => '', + 'VideoBitrateAdjMethod' => '', + 'IsCheckAudioBitrate' => '', + 'AudioBitrateAdjMethod' => '', + 'DeleteMetadata' => '', + 'IsHdr2Sdr' => '', + 'HlsEncrypt' => array( + 'IsHlsEncrypt' => '', + 'UriKey' => '', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoMontageTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoMontageTemplate.php new file mode 100644 index 00000000..61391228 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoMontageTemplate.php @@ -0,0 +1,52 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/58311 更新精彩集锦模板 + $result = $cosClient->updateMediaVideoMontageTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'VideoMontage', + 'Name' => 'VideoMontage-Template-Name', + 'Duration' => '', + 'Container' => array( + 'Format' => 'mp4', + ), + 'Video' => array( + 'Codec' => 'H.264', + 'Width' => '', + 'Height' => '', + 'Fps' => '', + 'Bitrate' => '', + 'Crf' => '', + ), + 'Audio' => array( + 'Codec' => 'aac', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + 'Remove' => '', + ), + 'AudioMix' => array( + 'AudioSource' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/test01.mp3', + 'MixMode' => 'Once', + 'Replace' => 'true', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoProcessTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoProcessTemplate.php new file mode 100644 index 00000000..8087f943 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaVideoProcessTemplate.php @@ -0,0 +1,37 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->updateMediaVideoProcessTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'VideoProcess', + 'Name' => 'VideoProcess-Template-Name', + 'ColorEnhance' => array( + 'Enable' => '', + 'Contrast' => '', + 'Correction' => '', + 'Saturation' => '', + ), + 'MsSharpen' => array( + 'Enable' => '', + 'SharpenLevel' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaVoiceSeparateTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaVoiceSeparateTemplate.php new file mode 100644 index 00000000..1bf20f54 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaVoiceSeparateTemplate.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/58318 更新人声分离模板 + $result = $cosClient->updateMediaVoiceSeparateTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'VoiceSeparate', + 'Name' => 'VoiceSeparate-Template-Name', + 'AudioMode' => 'IsAudio', + 'AudioConfig' => array( + 'Codec' => 'aac', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/updateMediaWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/sample/updateMediaWatermarkTemplate.php new file mode 100644 index 00000000..d58e238a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/updateMediaWatermarkTemplate.php @@ -0,0 +1,72 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // https://cloud.tencent.com/document/product/436/54036 更新水印模板 + // 文本 + $result = $cosClient->updateMediaWatermarkTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'Watermark', + 'Name' => 'Watermark-Template-Name', + 'Watermark' => array( + 'Type' => 'Text', + 'Pos' => 'TopRight', + 'LocMode' => 'Absolute', + 'Dx' => '128', + 'Dy' => '128', + 'StartTime' => '', + 'EndTime' => '', + 'Text' => array( + 'FontSize' => '30', + 'FontType' => 'simfang', + 'FontColor' => '0x000000', + 'Transparency' => '30', + 'Text' => '水印内容', + ), + ), + )); + // 请求成功 + print_r($result); + + // 图片 + $result = $cosClient->updateMediaWatermarkTemplate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // TemplateId + 'Tag' => 'Watermark', + 'Name' => 'Watermark-Template-Name2-1', + 'Watermark' => array( + 'Type' => 'Image', + 'Pos' => 'TopRight', + 'LocMode' => 'Absolute', + 'Dx' => '128', + 'Dy' => '128', + 'StartTime' => '', + 'EndTime' => '', + 'Image' => array( + 'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/test01.png', + 'Mode' => 'Proportion', + 'Width' => '10', + 'Height' => '', + 'Transparency' => '100', + 'Background' => '', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php b/vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php new file mode 100644 index 00000000..25e6a5ba --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php @@ -0,0 +1,42 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey + ) + ) +); + +function uploadfiles( $path, $cosClient ) { + foreach ( scandir( $path ) as $afile ) { + if ( $afile == '.' || $afile == '..' ) continue; + if ( is_dir( $path.'/'.$afile ) ) { + uploadfiles( $path.'/'.$afile, $cosClient ); + } else { + $local_file_path = $path.'/'.$afile; + $cos_file_path = $local_file_path; + // 按照需求自定义拼接上传路径 + try { + $cosClient->upload( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = $cos_file_path, + $body = fopen( $cos_file_path, 'rb' ) + ); + } catch ( \Exception $e ) { + echo( $e ); + } + } + } +} + +$local_path = '/data/home/folder'; +uploadfiles( $local_path, $cosClient ); diff --git a/vendor/qcloud/cos-sdk-v5/src/Client.php b/vendor/qcloud/cos-sdk-v5/src/Client.php new file mode 100644 index 00000000..168c103a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Client.php @@ -0,0 +1,577 @@ +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); + }; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php b/vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php new file mode 100644 index 00000000..b76e8d1e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php @@ -0,0 +1,379 @@ +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, + 'OpenFileProcessService' => 1, + 'GetFileProcessQueueList' => 1, + 'UpdateFileProcessQueue' => 1, + 'CreateFileHashCodeJobs' => 1, + 'GetFileHashCodeResult' => 1, + 'CreateFileUncompressJobs' => 1, + 'GetFileUncompressResult' => 1, + 'CreateFileCompressJobs' => 1, + 'GetFileCompressResult' => 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() { + } + + } diff --git a/vendor/qcloud/cos-sdk-v5/src/Common.php b/vendor/qcloud/cos-sdk-v5/src/Common.php new file mode 100644 index 00000000..1cc32464 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Common.php @@ -0,0 +1,69 @@ + '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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Copy.php b/vendor/qcloud/cos-sdk-v5/src/Copy.php new file mode 100644 index 00000000..18b3d035 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Copy.php @@ -0,0 +1,140 @@ +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']; + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Descriptions.php b/vendor/qcloud/cos-sdk-v5/src/Descriptions.php new file mode 100644 index 00000000..2b075bb5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Descriptions.php @@ -0,0 +1,12885 @@ + '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' ), + 'Category' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'category' ), + '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',), + 'Category' => array( 'type' => 'string', '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',), + 'ResultFormat' => array( 'type' => 'string', 'location' => 'xml',), + 'MqMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqName' => 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( 'location' => 'xml', 'type' => 'string', ), + 'QueueID' => array( 'location' => 'xml', 'type' => 'string', ), + 'State' => array( 'location' => 'xml', 'type' => 'string', ), + 'NotifyConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'Event' => array( 'type' => 'string', 'location' => 'xml', ), + 'ResultFormat' => array( 'type' => 'string', 'location' => 'xml', ), + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqName' => array( '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', + ), + ), + ); + } + + public static function FileJobs4Hash() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}?ci-process=filehash', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'FileJobs4HashOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Key' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Type' => array( 'required' => true, 'type' => 'string', 'location' => 'query', 'sentAs' => 'type', ), + 'AddToHeader' => array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'addtoheader', ), + ), + ); + } + public static function FileJobs4HashOutput() { + 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',), + 'FileHashCodeResult' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'MD5' => array( 'type' => 'string', 'location' => 'xml',), + 'SHA1' => array( 'type' => 'string', 'location' => 'xml',), + 'SHA256' => array( 'type' => 'string', 'location' => 'xml',), + 'FileSize' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + 'Input' => 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',), + ), + ), + ) + ); + } + + public static function OpenFileProcessService() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}file_bucket', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'OpenFileProcessServiceOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + ), + ); + } + public static function OpenFileProcessServiceOutput() { + 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',), + 'FileBucket' => 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 GetFileProcessQueueList() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}file_queue', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetFileProcessQueueListOutput', + '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 GetFileProcessQueueListOutput() { + 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',), + 'TotalCount' => array( 'type' => 'numeric', 'location' => 'xml',), + 'PageNumber' => array( 'type' => 'numeric', 'location' => 'xml',), + 'PageSize' => array( 'type' => 'numeric', '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',), + 'Category' => 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',), + 'ResultFormat' => array( 'type' => 'string', 'location' => 'xml',), + 'MqMode' => array( 'type' => 'string', 'location' => 'xml',), + 'MqRegion' => array( 'type' => 'string', 'location' => 'xml',), + 'MqName' => array( 'type' => 'string', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'NonExistPIDs' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + ) + ); + } + + public static function UpdateFileProcessQueue() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}file_queue/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'UpdateFileProcessQueueOutput', + '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( 'location' => 'xml', 'type' => 'string', ), + 'State' => array( 'location' => 'xml', 'type' => 'string', ), + 'NotifyConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'Event' => array( 'type' => 'string', 'location' => 'xml', ), + 'ResultFormat' => array( 'type' => 'string', 'location' => 'xml', ), + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqName' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + public static function UpdateFileProcessQueueOutput() { + 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',), + 'Category' => array( 'type' => 'string', 'location' => 'xml',), + 'CreateTime' => array( 'type' => 'string', 'location' => 'xml',), + 'UpdateTime' => array( 'type' => 'string', 'location' => 'xml',), + 'MaxSize' => array( 'type' => 'numeric', 'location' => 'xml',), + 'MaxConcurrent' => array( 'type' => 'numeric', 'location' => 'xml',), + 'NotifyConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'Event' => array( 'type' => 'string', 'location' => 'xml', ), + 'ResultFormat' => array( 'type' => 'string', 'location' => 'xml', ), + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqRegion' => array( 'type' => 'string', 'location' => 'xml', ), + 'MqName' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ); + } + + public static function CreateFileHashCodeJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}file_jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateFileHashCodeJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'location' => 'xml', 'type' => 'string', ), + 'Input' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileHashCodeConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'AddToHeader' => 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 CreateFileHashCodeJobsOutput() { + 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', ), + 'Tag' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'QueueId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Input' => 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', ), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileHashCodeConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'AddToHeader' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'FileHashCodeResult' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'MD5' => array( 'type' => 'string', 'location' => 'xml', ), + 'SHA1' => array( 'type' => 'string', 'location' => 'xml', ), + 'SHA256' => array( 'type' => 'string', 'location' => 'xml', ), + 'LastModified' => array( 'type' => 'string', 'location' => 'xml', ), + 'Etag' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileSize' => array( 'type' => 'numeric', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function GetFileHashCodeResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}file_jobs/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetFileHashCodeResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetFileHashCodeResultOutput() { + 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', ), + 'Tag' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'QueueId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Input' => 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', ), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileHashCodeConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'AddToHeader' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'FileHashCodeResult' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'MD5' => array( 'type' => 'string', 'location' => 'xml', ), + 'SHA1' => array( 'type' => 'string', 'location' => 'xml', ), + 'SHA256' => array( 'type' => 'string', 'location' => 'xml', ), + 'LastModified' => array( 'type' => 'string', 'location' => 'xml', ), + 'Etag' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileSize' => array( 'type' => 'numeric', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + 'NonExistJobIds' => array('type' => 'string', 'location' => 'xml',), + ), + ); + } + + public static function CreateFileUncompressJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}file_jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateFileUncompressJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'location' => 'xml', 'type' => 'string', ), + 'Input' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileUncompressConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Prefix' => array( 'type' => 'string', 'location' => 'xml', ), + 'PrefixReplaced' => 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', ), + ), + ), + ), + ), + '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 CreateFileUncompressJobsOutput() { + 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', ), + 'Tag' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'QueueId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Input' => 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', ), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => 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', ), + ), + ), + 'FileUncompressConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Prefix' => array( 'type' => 'string', 'location' => 'xml', ), + 'PrefixReplaced' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'FileUncompressResult' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bucket' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileCount' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function GetFileUncompressResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}file_jobs/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetFileUncompressResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetFileUncompressResultOutput() { + 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', ), + 'Tag' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'QueueId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Input' => 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', ), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => 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', ), + ), + ), + 'FileUncompressConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Prefix' => array( 'type' => 'string', 'location' => 'xml', ), + 'PrefixReplaced' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'FileUncompressResult' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bucket' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileCount' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + 'NonExistJobIds' => array('type' => 'string', 'location' => 'xml',), + ), + ); + } + + public static function CreateFileCompressJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}file_jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateFileCompressJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBackFormat' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBackType' => array( 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'location' => 'xml', 'type' => 'string', ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => array( 'type' => 'string', 'location' => 'xml', ), + 'FileCompressConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Flatten' => array( 'type' => 'string', 'location' => 'xml', ), + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + 'UrlList' => array( 'type' => 'string', 'location' => 'xml', ), + 'Prefix' => array( 'type' => 'string', 'location' => 'xml', ), + 'Keys' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true), + 'items' => array( + 'name' => 'Key', + 'type' => 'string', + 'sentAs' => 'Key', + '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 CreateFileCompressJobsOutput() { + 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', ), + 'Tag' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'QueueId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => 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', ), + ), + ), + 'FileCompressConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Flatten' => array( 'type' => 'string', 'location' => 'xml', ), + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + 'UrlList' => array( 'type' => 'string', 'location' => 'xml', ), + 'Prefix' => array( 'type' => 'string', 'location' => 'xml', ), + 'Key' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + 'FileCompressResult' => 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', ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function GetFileCompressResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}file_jobs/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetFileCompressResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetFileCompressResultOutput() { + 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', ), + 'Tag' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'QueueId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'UserData' => 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', ), + ), + ), + 'FileCompressConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Flatten' => array( 'type' => 'string', 'location' => 'xml', ), + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + 'UrlList' => array( 'type' => 'string', 'location' => 'xml', ), + 'Prefix' => array( 'type' => 'string', 'location' => 'xml', ), + 'Key' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + 'FileCompressResult' => 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', ), + ), + ), + ), + ), + ), + ), + 'NonExistJobIds' => array('type' => 'string', 'location' => 'xml',), + ), + ); + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php b/vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php new file mode 100644 index 00000000..8e482c63 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php @@ -0,0 +1,5 @@ +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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php b/vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php new file mode 100644 index 00000000..3bc980af --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php @@ -0,0 +1,71 @@ +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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php b/vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php new file mode 100644 index 00000000..c15400bb --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php @@ -0,0 +1,112 @@ + 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]; + } + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php new file mode 100644 index 00000000..0f03b1ea --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php @@ -0,0 +1,87 @@ +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 = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php new file mode 100644 index 00000000..0ee780aa --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php @@ -0,0 +1,39 @@ +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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIProcessTransformation.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIProcessTransformation.php new file mode 100644 index 00000000..89889099 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIProcessTransformation.php @@ -0,0 +1,31 @@ +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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php new file mode 100644 index 00000000..0f8c24f2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php @@ -0,0 +1,374 @@ +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,默认值为原图质量;取原图质量和指定质量的最小值;后面加“!”表示强制使用指定值,例如: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(); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php new file mode 100644 index 00000000..606168b1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php @@ -0,0 +1,37 @@ +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 = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php new file mode 100644 index 00000000..c8fa5332 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php @@ -0,0 +1,33 @@ +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 = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php new file mode 100644 index 00000000..eabe676b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php @@ -0,0 +1,18 @@ +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 = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php new file mode 100644 index 00000000..89069434 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php @@ -0,0 +1,212 @@ +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 = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php new file mode 100644 index 00000000..a2f10dea --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php @@ -0,0 +1,64 @@ +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(); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php new file mode 100644 index 00000000..7f359931 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php @@ -0,0 +1,180 @@ +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 = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php b/vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php new file mode 100644 index 00000000..2eec9c0c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php @@ -0,0 +1,167 @@ +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']; + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/RangeDownload.php b/vendor/qcloud/cos-sdk-v5/src/RangeDownload.php new file mode 100644 index 00000000..77f50f7c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/RangeDownload.php @@ -0,0 +1,145 @@ +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(); + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php b/vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php new file mode 100644 index 00000000..73787fd5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php @@ -0,0 +1,49 @@ +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)); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php b/vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php new file mode 100644 index 00000000..8ccc28ee --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php @@ -0,0 +1,260 @@ +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() { + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Serializer.php b/vendor/qcloud/cos-sdk-v5/src/Serializer.php new file mode 100644 index 00000000..1999e1b7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Serializer.php @@ -0,0 +1,81 @@ +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); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Service.php b/vendor/qcloud/cos-sdk-v5/src/Service.php new file mode 100644 index 00000000..61cfbb1d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Service.php @@ -0,0 +1,7407 @@ + '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(), // 提交音视频流分离任务 + 'FileJobs4Hash' => Descriptions::FileJobs4Hash(), // 哈希值计算同步请求 + 'OpenFileProcessService' => Descriptions::OpenFileProcessService(), // 开通文件处理服务 + 'GetFileProcessQueueList' => Descriptions::GetFileProcessQueueList(), // 搜索文件处理队列 + 'UpdateFileProcessQueue' => Descriptions::UpdateFileProcessQueue(), // 更新文件处理的队列 + 'CreateFileHashCodeJobs' => Descriptions::CreateFileHashCodeJobs(), // 提交哈希值计算任务 + 'GetFileHashCodeResult' => Descriptions::GetFileHashCodeResult(), // 查询哈希值计算结果 + 'CreateFileUncompressJobs' => Descriptions::CreateFileUncompressJobs(), // 提交文件解压任务 + 'GetFileUncompressResult' => Descriptions::GetFileUncompressResult(), // 查询文件解压结果 + 'CreateFileCompressJobs' => Descriptions::CreateFileCompressJobs(), // 提交多文件打包压缩任务 + 'GetFileCompressResult' => Descriptions::GetFileCompressResult(), // 查询多文件打包压缩结果 + ), + '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(), + 'FileJobs4HashOutput' => Descriptions::FileJobs4HashOutput(), + 'OpenFileProcessServiceOutput' => Descriptions::OpenFileProcessServiceOutput(), + 'GetFileProcessQueueListOutput' => Descriptions::GetFileProcessQueueListOutput(), + 'UpdateFileProcessQueueOutput' => Descriptions::UpdateFileProcessQueueOutput(), + 'CreateFileHashCodeJobsOutput' => Descriptions::CreateFileHashCodeJobsOutput(), + 'GetFileHashCodeResultOutput' => Descriptions::GetFileHashCodeResultOutput(), + 'CreateFileUncompressJobsOutput' => Descriptions::CreateFileUncompressJobsOutput(), + 'GetFileUncompressResultOutput' => Descriptions::GetFileUncompressResultOutput(), + 'CreateFileCompressJobsOutput' => Descriptions::CreateFileCompressJobsOutput(), + 'GetFileCompressResultOutput' => Descriptions::GetFileCompressResultOutput(), + ) + ); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Signature.php b/vendor/qcloud/cos-sdk-v5/src/Signature.php new file mode 100644 index 00000000..457c0842 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Signature.php @@ -0,0 +1,124 @@ +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', + 'transfer-encoding', + ]; + 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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php b/vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php new file mode 100644 index 00000000..ff825540 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php @@ -0,0 +1,23 @@ +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); + } +} diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 00000000..fe6e6910 --- /dev/null +++ b/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000..2b955423 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[Attribute(Attribute::TARGET_CLASS)] +final class Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 00000000..bd1212f6 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class PhpToken extends Symfony\Polyfill\Php80\PhpToken + { + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 00000000..01c6c6c8 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class UnhandledMatchError extends Error + { + } +} diff --git a/vendor/symfony/translation-contracts/CHANGELOG.md b/vendor/symfony/translation-contracts/CHANGELOG.md new file mode 100644 index 00000000..7932e261 --- /dev/null +++ b/vendor/symfony/translation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/translation-contracts/TranslatableInterface.php b/vendor/symfony/translation-contracts/TranslatableInterface.php new file mode 100644 index 00000000..47fd6fa0 --- /dev/null +++ b/vendor/symfony/translation-contracts/TranslatableInterface.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +/** + * @author Nicolas Grekas + */ +interface TranslatableInterface +{ + public function trans(TranslatorInterface $translator, string $locale = null): string; +}