diff --git a/CHANGELOG b/CHANGELOG index c0160fa2b..c8a7ed282 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-12-31 Version 1.36.226 +- Supported image for process. + 2019-12-31 Version 1.36.225 - Generated 2019-09-28 for `reid`. diff --git a/VERSION b/VERSION index a277199c6..6cf634ca9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.225 \ No newline at end of file +1.36.226 \ No newline at end of file diff --git a/imm/CMakeLists.txt b/imm/CMakeLists.txt index 55312ddec..f34060408 100644 --- a/imm/CMakeLists.txt +++ b/imm/CMakeLists.txt @@ -35,6 +35,8 @@ set(imm_public_header_model include/alibabacloud/imm/model/CreateGrabFrameTaskResult.h include/alibabacloud/imm/model/CreateGroupFacesJobRequest.h include/alibabacloud/imm/model/CreateGroupFacesJobResult.h + include/alibabacloud/imm/model/CreateImageProcessTaskRequest.h + include/alibabacloud/imm/model/CreateImageProcessTaskResult.h include/alibabacloud/imm/model/CreateMediaComplexTaskRequest.h include/alibabacloud/imm/model/CreateMediaComplexTaskResult.h include/alibabacloud/imm/model/CreateMergeFaceGroupsJobRequest.h @@ -109,6 +111,8 @@ set(imm_public_header_model include/alibabacloud/imm/model/GetMediaMetaResult.h include/alibabacloud/imm/model/GetOfficeConversionTaskRequest.h include/alibabacloud/imm/model/GetOfficeConversionTaskResult.h + include/alibabacloud/imm/model/GetOfficePreviewURLRequest.h + include/alibabacloud/imm/model/GetOfficePreviewURLResult.h include/alibabacloud/imm/model/GetProjectRequest.h include/alibabacloud/imm/model/GetProjectResult.h include/alibabacloud/imm/model/GetSetRequest.h @@ -178,6 +182,8 @@ set(imm_src src/model/CreateGrabFrameTaskResult.cc src/model/CreateGroupFacesJobRequest.cc src/model/CreateGroupFacesJobResult.cc + src/model/CreateImageProcessTaskRequest.cc + src/model/CreateImageProcessTaskResult.cc src/model/CreateMediaComplexTaskRequest.cc src/model/CreateMediaComplexTaskResult.cc src/model/CreateMergeFaceGroupsJobRequest.cc @@ -252,6 +258,8 @@ set(imm_src src/model/GetMediaMetaResult.cc src/model/GetOfficeConversionTaskRequest.cc src/model/GetOfficeConversionTaskResult.cc + src/model/GetOfficePreviewURLRequest.cc + src/model/GetOfficePreviewURLResult.cc src/model/GetProjectRequest.cc src/model/GetProjectResult.cc src/model/GetSetRequest.cc diff --git a/imm/include/alibabacloud/imm/ImmClient.h b/imm/include/alibabacloud/imm/ImmClient.h index 1d6157587..424fe48da 100644 --- a/imm/include/alibabacloud/imm/ImmClient.h +++ b/imm/include/alibabacloud/imm/ImmClient.h @@ -36,6 +36,8 @@ #include "model/CreateGrabFrameTaskResult.h" #include "model/CreateGroupFacesJobRequest.h" #include "model/CreateGroupFacesJobResult.h" +#include "model/CreateImageProcessTaskRequest.h" +#include "model/CreateImageProcessTaskResult.h" #include "model/CreateMediaComplexTaskRequest.h" #include "model/CreateMediaComplexTaskResult.h" #include "model/CreateMergeFaceGroupsJobRequest.h" @@ -110,6 +112,8 @@ #include "model/GetMediaMetaResult.h" #include "model/GetOfficeConversionTaskRequest.h" #include "model/GetOfficeConversionTaskResult.h" +#include "model/GetOfficePreviewURLRequest.h" +#include "model/GetOfficePreviewURLResult.h" #include "model/GetProjectRequest.h" #include "model/GetProjectResult.h" #include "model/GetSetRequest.h" @@ -192,6 +196,9 @@ namespace AlibabaCloud typedef Outcome CreateGroupFacesJobOutcome; typedef std::future CreateGroupFacesJobOutcomeCallable; typedef std::function&)> CreateGroupFacesJobAsyncHandler; + typedef Outcome CreateImageProcessTaskOutcome; + typedef std::future CreateImageProcessTaskOutcomeCallable; + typedef std::function&)> CreateImageProcessTaskAsyncHandler; typedef Outcome CreateMediaComplexTaskOutcome; typedef std::future CreateMediaComplexTaskOutcomeCallable; typedef std::function&)> CreateMediaComplexTaskAsyncHandler; @@ -303,6 +310,9 @@ namespace AlibabaCloud typedef Outcome GetOfficeConversionTaskOutcome; typedef std::future GetOfficeConversionTaskOutcomeCallable; typedef std::function&)> GetOfficeConversionTaskAsyncHandler; + typedef Outcome GetOfficePreviewURLOutcome; + typedef std::future GetOfficePreviewURLOutcomeCallable; + typedef std::function&)> GetOfficePreviewURLAsyncHandler; typedef Outcome GetProjectOutcome; typedef std::future GetProjectOutcomeCallable; typedef std::function&)> GetProjectAsyncHandler; @@ -407,6 +417,9 @@ namespace AlibabaCloud CreateGroupFacesJobOutcome createGroupFacesJob(const Model::CreateGroupFacesJobRequest &request)const; void createGroupFacesJobAsync(const Model::CreateGroupFacesJobRequest& request, const CreateGroupFacesJobAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateGroupFacesJobOutcomeCallable createGroupFacesJobCallable(const Model::CreateGroupFacesJobRequest& request) const; + CreateImageProcessTaskOutcome createImageProcessTask(const Model::CreateImageProcessTaskRequest &request)const; + void createImageProcessTaskAsync(const Model::CreateImageProcessTaskRequest& request, const CreateImageProcessTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateImageProcessTaskOutcomeCallable createImageProcessTaskCallable(const Model::CreateImageProcessTaskRequest& request) const; CreateMediaComplexTaskOutcome createMediaComplexTask(const Model::CreateMediaComplexTaskRequest &request)const; void createMediaComplexTaskAsync(const Model::CreateMediaComplexTaskRequest& request, const CreateMediaComplexTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateMediaComplexTaskOutcomeCallable createMediaComplexTaskCallable(const Model::CreateMediaComplexTaskRequest& request) const; @@ -518,6 +531,9 @@ namespace AlibabaCloud GetOfficeConversionTaskOutcome getOfficeConversionTask(const Model::GetOfficeConversionTaskRequest &request)const; void getOfficeConversionTaskAsync(const Model::GetOfficeConversionTaskRequest& request, const GetOfficeConversionTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetOfficeConversionTaskOutcomeCallable getOfficeConversionTaskCallable(const Model::GetOfficeConversionTaskRequest& request) const; + GetOfficePreviewURLOutcome getOfficePreviewURL(const Model::GetOfficePreviewURLRequest &request)const; + void getOfficePreviewURLAsync(const Model::GetOfficePreviewURLRequest& request, const GetOfficePreviewURLAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetOfficePreviewURLOutcomeCallable getOfficePreviewURLCallable(const Model::GetOfficePreviewURLRequest& request) const; GetProjectOutcome getProject(const Model::GetProjectRequest &request)const; void getProjectAsync(const Model::GetProjectRequest& request, const GetProjectAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetProjectOutcomeCallable getProjectCallable(const Model::GetProjectRequest& request) const; diff --git a/imm/include/alibabacloud/imm/model/CreateImageProcessTaskRequest.h b/imm/include/alibabacloud/imm/model/CreateImageProcessTaskRequest.h new file mode 100644 index 000000000..5e1ce1cdc --- /dev/null +++ b/imm/include/alibabacloud/imm/model/CreateImageProcessTaskRequest.h @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_IMM_MODEL_CREATEIMAGEPROCESSTASKREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_CREATEIMAGEPROCESSTASKREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT CreateImageProcessTaskRequest : public RpcServiceRequest + { + + public: + CreateImageProcessTaskRequest(); + ~CreateImageProcessTaskRequest(); + + std::string getProject()const; + void setProject(const std::string& project); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getNotifyEndpoint()const; + void setNotifyEndpoint(const std::string& notifyEndpoint); + std::string getNotifyTopicName()const; + void setNotifyTopicName(const std::string& notifyTopicName); + std::string getTargetList()const; + void setTargetList(const std::string& targetList); + std::string getImageUri()const; + void setImageUri(const std::string& imageUri); + + private: + std::string project_; + std::string accessKeyId_; + std::string notifyEndpoint_; + std::string notifyTopicName_; + std::string targetList_; + std::string imageUri_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_CREATEIMAGEPROCESSTASKREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/CreateImageProcessTaskResult.h b/imm/include/alibabacloud/imm/model/CreateImageProcessTaskResult.h new file mode 100644 index 000000000..824bc17fe --- /dev/null +++ b/imm/include/alibabacloud/imm/model/CreateImageProcessTaskResult.h @@ -0,0 +1,53 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_IMM_MODEL_CREATEIMAGEPROCESSTASKRESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_CREATEIMAGEPROCESSTASKRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT CreateImageProcessTaskResult : public ServiceResult + { + public: + + + CreateImageProcessTaskResult(); + explicit CreateImageProcessTaskResult(const std::string &payload); + ~CreateImageProcessTaskResult(); + std::string getTaskId()const; + std::string getTaskType()const; + + protected: + void parse(const std::string &payload); + private: + std::string taskId_; + std::string taskType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_CREATEIMAGEPROCESSTASKRESULT_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/GetOfficePreviewURLRequest.h b/imm/include/alibabacloud/imm/model/GetOfficePreviewURLRequest.h new file mode 100644 index 000000000..cf043395a --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetOfficePreviewURLRequest.h @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_IMM_MODEL_GETOFFICEPREVIEWURLREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_GETOFFICEPREVIEWURLREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetOfficePreviewURLRequest : public RpcServiceRequest + { + + public: + GetOfficePreviewURLRequest(); + ~GetOfficePreviewURLRequest(); + + std::string getSrcType()const; + void setSrcType(const std::string& srcType); + int getExpires()const; + void setExpires(int expires); + std::string getProject()const; + void setProject(const std::string& project); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + bool getUseHTTPS()const; + void setUseHTTPS(bool useHTTPS); + std::string getSrcUri()const; + void setSrcUri(const std::string& srcUri); + + private: + std::string srcType_; + int expires_; + std::string project_; + std::string accessKeyId_; + bool useHTTPS_; + std::string srcUri_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETOFFICEPREVIEWURLREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/GetOfficePreviewURLResult.h b/imm/include/alibabacloud/imm/model/GetOfficePreviewURLResult.h new file mode 100644 index 000000000..9697aa846 --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetOfficePreviewURLResult.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_IMM_MODEL_GETOFFICEPREVIEWURLRESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_GETOFFICEPREVIEWURLRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetOfficePreviewURLResult : public ServiceResult + { + public: + + + GetOfficePreviewURLResult(); + explicit GetOfficePreviewURLResult(const std::string &payload); + ~GetOfficePreviewURLResult(); + std::string getPreviewURL()const; + + protected: + void parse(const std::string &payload); + private: + std::string previewURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETOFFICEPREVIEWURLRESULT_H_ \ No newline at end of file diff --git a/imm/src/ImmClient.cc b/imm/src/ImmClient.cc index 35e24d76a..968671efd 100644 --- a/imm/src/ImmClient.cc +++ b/imm/src/ImmClient.cc @@ -303,6 +303,42 @@ ImmClient::CreateGroupFacesJobOutcomeCallable ImmClient::createGroupFacesJobCall return task->get_future(); } +ImmClient::CreateImageProcessTaskOutcome ImmClient::createImageProcessTask(const CreateImageProcessTaskRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateImageProcessTaskOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateImageProcessTaskOutcome(CreateImageProcessTaskResult(outcome.result())); + else + return CreateImageProcessTaskOutcome(outcome.error()); +} + +void ImmClient::createImageProcessTaskAsync(const CreateImageProcessTaskRequest& request, const CreateImageProcessTaskAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createImageProcessTask(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::CreateImageProcessTaskOutcomeCallable ImmClient::createImageProcessTaskCallable(const CreateImageProcessTaskRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createImageProcessTask(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ImmClient::CreateMediaComplexTaskOutcome ImmClient::createMediaComplexTask(const CreateMediaComplexTaskRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1635,6 +1671,42 @@ ImmClient::GetOfficeConversionTaskOutcomeCallable ImmClient::getOfficeConversion return task->get_future(); } +ImmClient::GetOfficePreviewURLOutcome ImmClient::getOfficePreviewURL(const GetOfficePreviewURLRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetOfficePreviewURLOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetOfficePreviewURLOutcome(GetOfficePreviewURLResult(outcome.result())); + else + return GetOfficePreviewURLOutcome(outcome.error()); +} + +void ImmClient::getOfficePreviewURLAsync(const GetOfficePreviewURLRequest& request, const GetOfficePreviewURLAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getOfficePreviewURL(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::GetOfficePreviewURLOutcomeCallable ImmClient::getOfficePreviewURLCallable(const GetOfficePreviewURLRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getOfficePreviewURL(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ImmClient::GetProjectOutcome ImmClient::getProject(const GetProjectRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/imm/src/model/CreateImageProcessTaskRequest.cc b/imm/src/model/CreateImageProcessTaskRequest.cc new file mode 100644 index 000000000..9e50c99fa --- /dev/null +++ b/imm/src/model/CreateImageProcessTaskRequest.cc @@ -0,0 +1,95 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Imm::Model::CreateImageProcessTaskRequest; + +CreateImageProcessTaskRequest::CreateImageProcessTaskRequest() : + RpcServiceRequest("imm", "2017-09-06", "CreateImageProcessTask") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateImageProcessTaskRequest::~CreateImageProcessTaskRequest() +{} + +std::string CreateImageProcessTaskRequest::getProject()const +{ + return project_; +} + +void CreateImageProcessTaskRequest::setProject(const std::string& project) +{ + project_ = project; + setCoreParameter("Project", project); +} + +std::string CreateImageProcessTaskRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void CreateImageProcessTaskRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setCoreParameter("AccessKeyId", accessKeyId); +} + +std::string CreateImageProcessTaskRequest::getNotifyEndpoint()const +{ + return notifyEndpoint_; +} + +void CreateImageProcessTaskRequest::setNotifyEndpoint(const std::string& notifyEndpoint) +{ + notifyEndpoint_ = notifyEndpoint; + setCoreParameter("NotifyEndpoint", notifyEndpoint); +} + +std::string CreateImageProcessTaskRequest::getNotifyTopicName()const +{ + return notifyTopicName_; +} + +void CreateImageProcessTaskRequest::setNotifyTopicName(const std::string& notifyTopicName) +{ + notifyTopicName_ = notifyTopicName; + setCoreParameter("NotifyTopicName", notifyTopicName); +} + +std::string CreateImageProcessTaskRequest::getTargetList()const +{ + return targetList_; +} + +void CreateImageProcessTaskRequest::setTargetList(const std::string& targetList) +{ + targetList_ = targetList; + setCoreParameter("TargetList", targetList); +} + +std::string CreateImageProcessTaskRequest::getImageUri()const +{ + return imageUri_; +} + +void CreateImageProcessTaskRequest::setImageUri(const std::string& imageUri) +{ + imageUri_ = imageUri; + setCoreParameter("ImageUri", imageUri); +} + diff --git a/imm/src/model/CreateImageProcessTaskResult.cc b/imm/src/model/CreateImageProcessTaskResult.cc new file mode 100644 index 000000000..01eb85ff9 --- /dev/null +++ b/imm/src/model/CreateImageProcessTaskResult.cc @@ -0,0 +1,58 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Imm; +using namespace AlibabaCloud::Imm::Model; + +CreateImageProcessTaskResult::CreateImageProcessTaskResult() : + ServiceResult() +{} + +CreateImageProcessTaskResult::CreateImageProcessTaskResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateImageProcessTaskResult::~CreateImageProcessTaskResult() +{} + +void CreateImageProcessTaskResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["TaskId"].isNull()) + taskId_ = value["TaskId"].asString(); + if(!value["TaskType"].isNull()) + taskType_ = value["TaskType"].asString(); + +} + +std::string CreateImageProcessTaskResult::getTaskId()const +{ + return taskId_; +} + +std::string CreateImageProcessTaskResult::getTaskType()const +{ + return taskType_; +} + diff --git a/imm/src/model/GetOfficePreviewURLRequest.cc b/imm/src/model/GetOfficePreviewURLRequest.cc new file mode 100644 index 000000000..667fb1ebd --- /dev/null +++ b/imm/src/model/GetOfficePreviewURLRequest.cc @@ -0,0 +1,95 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Imm::Model::GetOfficePreviewURLRequest; + +GetOfficePreviewURLRequest::GetOfficePreviewURLRequest() : + RpcServiceRequest("imm", "2017-09-06", "GetOfficePreviewURL") +{ + setMethod(HttpRequest::Method::Post); +} + +GetOfficePreviewURLRequest::~GetOfficePreviewURLRequest() +{} + +std::string GetOfficePreviewURLRequest::getSrcType()const +{ + return srcType_; +} + +void GetOfficePreviewURLRequest::setSrcType(const std::string& srcType) +{ + srcType_ = srcType; + setCoreParameter("SrcType", srcType); +} + +int GetOfficePreviewURLRequest::getExpires()const +{ + return expires_; +} + +void GetOfficePreviewURLRequest::setExpires(int expires) +{ + expires_ = expires; + setCoreParameter("Expires", std::to_string(expires)); +} + +std::string GetOfficePreviewURLRequest::getProject()const +{ + return project_; +} + +void GetOfficePreviewURLRequest::setProject(const std::string& project) +{ + project_ = project; + setCoreParameter("Project", project); +} + +std::string GetOfficePreviewURLRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void GetOfficePreviewURLRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setCoreParameter("AccessKeyId", accessKeyId); +} + +bool GetOfficePreviewURLRequest::getUseHTTPS()const +{ + return useHTTPS_; +} + +void GetOfficePreviewURLRequest::setUseHTTPS(bool useHTTPS) +{ + useHTTPS_ = useHTTPS; + setCoreParameter("UseHTTPS", useHTTPS ? "true" : "false"); +} + +std::string GetOfficePreviewURLRequest::getSrcUri()const +{ + return srcUri_; +} + +void GetOfficePreviewURLRequest::setSrcUri(const std::string& srcUri) +{ + srcUri_ = srcUri; + setCoreParameter("SrcUri", srcUri); +} + diff --git a/imm/src/model/GetOfficePreviewURLResult.cc b/imm/src/model/GetOfficePreviewURLResult.cc new file mode 100644 index 000000000..3e1f008d5 --- /dev/null +++ b/imm/src/model/GetOfficePreviewURLResult.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Imm; +using namespace AlibabaCloud::Imm::Model; + +GetOfficePreviewURLResult::GetOfficePreviewURLResult() : + ServiceResult() +{} + +GetOfficePreviewURLResult::GetOfficePreviewURLResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetOfficePreviewURLResult::~GetOfficePreviewURLResult() +{} + +void GetOfficePreviewURLResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["PreviewURL"].isNull()) + previewURL_ = value["PreviewURL"].asString(); + +} + +std::string GetOfficePreviewURLResult::getPreviewURL()const +{ + return previewURL_; +} +