diff --git a/CHANGELOG b/CHANGELOG index 11a96deed..91c0a8b20 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-12-25 Version: patch +- Supported for weboffice edit. + 2020-12-24 Version: patch - Modify ConfigureBackupPlan. diff --git a/imm/CMakeLists.txt b/imm/CMakeLists.txt index 136b87dda..928309a2c 100644 --- a/imm/CMakeLists.txt +++ b/imm/CMakeLists.txt @@ -125,6 +125,8 @@ set(imm_public_header_model include/alibabacloud/imm/model/GetVideoResult.h include/alibabacloud/imm/model/GetVideoTaskRequest.h include/alibabacloud/imm/model/GetVideoTaskResult.h + include/alibabacloud/imm/model/GetWebofficeURLRequest.h + include/alibabacloud/imm/model/GetWebofficeURLResult.h include/alibabacloud/imm/model/IndexImageRequest.h include/alibabacloud/imm/model/IndexImageResult.h include/alibabacloud/imm/model/IndexVideoRequest.h @@ -161,6 +163,8 @@ set(imm_public_header_model include/alibabacloud/imm/model/RefreshOfficeEditTokenResult.h include/alibabacloud/imm/model/RefreshOfficePreviewTokenRequest.h include/alibabacloud/imm/model/RefreshOfficePreviewTokenResult.h + include/alibabacloud/imm/model/RefreshWebofficeTokenRequest.h + include/alibabacloud/imm/model/RefreshWebofficeTokenResult.h include/alibabacloud/imm/model/SearchDocIndexRequest.h include/alibabacloud/imm/model/SearchDocIndexResult.h include/alibabacloud/imm/model/StopStreamAnalyseTaskRequest.h @@ -284,6 +288,8 @@ set(imm_src src/model/GetVideoResult.cc src/model/GetVideoTaskRequest.cc src/model/GetVideoTaskResult.cc + src/model/GetWebofficeURLRequest.cc + src/model/GetWebofficeURLResult.cc src/model/IndexImageRequest.cc src/model/IndexImageResult.cc src/model/IndexVideoRequest.cc @@ -320,6 +326,8 @@ set(imm_src src/model/RefreshOfficeEditTokenResult.cc src/model/RefreshOfficePreviewTokenRequest.cc src/model/RefreshOfficePreviewTokenResult.cc + src/model/RefreshWebofficeTokenRequest.cc + src/model/RefreshWebofficeTokenResult.cc src/model/SearchDocIndexRequest.cc src/model/SearchDocIndexResult.cc src/model/StopStreamAnalyseTaskRequest.cc diff --git a/imm/include/alibabacloud/imm/ImmClient.h b/imm/include/alibabacloud/imm/ImmClient.h index 892b10627..f02ee9fa6 100644 --- a/imm/include/alibabacloud/imm/ImmClient.h +++ b/imm/include/alibabacloud/imm/ImmClient.h @@ -126,6 +126,8 @@ #include "model/GetVideoResult.h" #include "model/GetVideoTaskRequest.h" #include "model/GetVideoTaskResult.h" +#include "model/GetWebofficeURLRequest.h" +#include "model/GetWebofficeURLResult.h" #include "model/IndexImageRequest.h" #include "model/IndexImageResult.h" #include "model/IndexVideoRequest.h" @@ -162,6 +164,8 @@ #include "model/RefreshOfficeEditTokenResult.h" #include "model/RefreshOfficePreviewTokenRequest.h" #include "model/RefreshOfficePreviewTokenResult.h" +#include "model/RefreshWebofficeTokenRequest.h" +#include "model/RefreshWebofficeTokenResult.h" #include "model/SearchDocIndexRequest.h" #include "model/SearchDocIndexResult.h" #include "model/StopStreamAnalyseTaskRequest.h" @@ -343,6 +347,9 @@ namespace AlibabaCloud typedef Outcome GetVideoTaskOutcome; typedef std::future GetVideoTaskOutcomeCallable; typedef std::function&)> GetVideoTaskAsyncHandler; + typedef Outcome GetWebofficeURLOutcome; + typedef std::future GetWebofficeURLOutcomeCallable; + typedef std::function&)> GetWebofficeURLAsyncHandler; typedef Outcome IndexImageOutcome; typedef std::future IndexImageOutcomeCallable; typedef std::function&)> IndexImageAsyncHandler; @@ -397,6 +404,9 @@ namespace AlibabaCloud typedef Outcome RefreshOfficePreviewTokenOutcome; typedef std::future RefreshOfficePreviewTokenOutcomeCallable; typedef std::function&)> RefreshOfficePreviewTokenAsyncHandler; + typedef Outcome RefreshWebofficeTokenOutcome; + typedef std::future RefreshWebofficeTokenOutcomeCallable; + typedef std::function&)> RefreshWebofficeTokenAsyncHandler; typedef Outcome SearchDocIndexOutcome; typedef std::future SearchDocIndexOutcomeCallable; typedef std::function&)> SearchDocIndexAsyncHandler; @@ -582,6 +592,9 @@ namespace AlibabaCloud GetVideoTaskOutcome getVideoTask(const Model::GetVideoTaskRequest &request)const; void getVideoTaskAsync(const Model::GetVideoTaskRequest& request, const GetVideoTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetVideoTaskOutcomeCallable getVideoTaskCallable(const Model::GetVideoTaskRequest& request) const; + GetWebofficeURLOutcome getWebofficeURL(const Model::GetWebofficeURLRequest &request)const; + void getWebofficeURLAsync(const Model::GetWebofficeURLRequest& request, const GetWebofficeURLAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetWebofficeURLOutcomeCallable getWebofficeURLCallable(const Model::GetWebofficeURLRequest& request) const; IndexImageOutcome indexImage(const Model::IndexImageRequest &request)const; void indexImageAsync(const Model::IndexImageRequest& request, const IndexImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; IndexImageOutcomeCallable indexImageCallable(const Model::IndexImageRequest& request) const; @@ -636,6 +649,9 @@ namespace AlibabaCloud RefreshOfficePreviewTokenOutcome refreshOfficePreviewToken(const Model::RefreshOfficePreviewTokenRequest &request)const; void refreshOfficePreviewTokenAsync(const Model::RefreshOfficePreviewTokenRequest& request, const RefreshOfficePreviewTokenAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RefreshOfficePreviewTokenOutcomeCallable refreshOfficePreviewTokenCallable(const Model::RefreshOfficePreviewTokenRequest& request) const; + RefreshWebofficeTokenOutcome refreshWebofficeToken(const Model::RefreshWebofficeTokenRequest &request)const; + void refreshWebofficeTokenAsync(const Model::RefreshWebofficeTokenRequest& request, const RefreshWebofficeTokenAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RefreshWebofficeTokenOutcomeCallable refreshWebofficeTokenCallable(const Model::RefreshWebofficeTokenRequest& request) const; SearchDocIndexOutcome searchDocIndex(const Model::SearchDocIndexRequest &request)const; void searchDocIndexAsync(const Model::SearchDocIndexRequest& request, const SearchDocIndexAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SearchDocIndexOutcomeCallable searchDocIndexCallable(const Model::SearchDocIndexRequest& request) const; diff --git a/imm/include/alibabacloud/imm/model/GetWebofficeURLRequest.h b/imm/include/alibabacloud/imm/model/GetWebofficeURLRequest.h new file mode 100644 index 000000000..8b2b71c4b --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetWebofficeURLRequest.h @@ -0,0 +1,72 @@ +/* + * 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_GETWEBOFFICEURLREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_GETWEBOFFICEURLREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetWebofficeURLRequest : public RpcServiceRequest + { + + public: + GetWebofficeURLRequest(); + ~GetWebofficeURLRequest(); + + std::string getSrcType()const; + void setSrcType(const std::string& srcType); + std::string getProject()const; + void setProject(const std::string& project); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getFile()const; + void setFile(const std::string& file); + std::string getNotifyEndpoint()const; + void setNotifyEndpoint(const std::string& notifyEndpoint); + std::string getFileID()const; + void setFileID(const std::string& fileID); + std::string getNotifyTopicName()const; + void setNotifyTopicName(const std::string& notifyTopicName); + std::string getPermission()const; + void setPermission(const std::string& permission); + std::string getUser()const; + void setUser(const std::string& user); + + private: + std::string srcType_; + std::string project_; + std::string accessKeyId_; + std::string file_; + std::string notifyEndpoint_; + std::string fileID_; + std::string notifyTopicName_; + std::string permission_; + std::string user_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETWEBOFFICEURLREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/GetWebofficeURLResult.h b/imm/include/alibabacloud/imm/model/GetWebofficeURLResult.h new file mode 100644 index 000000000..6fd13fd74 --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetWebofficeURLResult.h @@ -0,0 +1,59 @@ +/* + * 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_GETWEBOFFICEURLRESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_GETWEBOFFICEURLRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetWebofficeURLResult : public ServiceResult + { + public: + + + GetWebofficeURLResult(); + explicit GetWebofficeURLResult(const std::string &payload); + ~GetWebofficeURLResult(); + std::string getRefreshToken()const; + std::string getAccessToken()const; + std::string getRefreshTokenExpiredTime()const; + std::string getWebofficeURL()const; + std::string getAccessTokenExpiredTime()const; + + protected: + void parse(const std::string &payload); + private: + std::string refreshToken_; + std::string accessToken_; + std::string refreshTokenExpiredTime_; + std::string webofficeURL_; + std::string accessTokenExpiredTime_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETWEBOFFICEURLRESULT_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/RefreshWebofficeTokenRequest.h b/imm/include/alibabacloud/imm/model/RefreshWebofficeTokenRequest.h new file mode 100644 index 000000000..79ccababd --- /dev/null +++ b/imm/include/alibabacloud/imm/model/RefreshWebofficeTokenRequest.h @@ -0,0 +1,57 @@ +/* + * 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_REFRESHWEBOFFICETOKENREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_REFRESHWEBOFFICETOKENREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT RefreshWebofficeTokenRequest : public RpcServiceRequest + { + + public: + RefreshWebofficeTokenRequest(); + ~RefreshWebofficeTokenRequest(); + + std::string getProject()const; + void setProject(const std::string& project); + std::string getAccessToken()const; + void setAccessToken(const std::string& accessToken); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getRefreshToken()const; + void setRefreshToken(const std::string& refreshToken); + + private: + std::string project_; + std::string accessToken_; + std::string accessKeyId_; + std::string refreshToken_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_REFRESHWEBOFFICETOKENREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/RefreshWebofficeTokenResult.h b/imm/include/alibabacloud/imm/model/RefreshWebofficeTokenResult.h new file mode 100644 index 000000000..645c4882f --- /dev/null +++ b/imm/include/alibabacloud/imm/model/RefreshWebofficeTokenResult.h @@ -0,0 +1,57 @@ +/* + * 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_REFRESHWEBOFFICETOKENRESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_REFRESHWEBOFFICETOKENRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT RefreshWebofficeTokenResult : public ServiceResult + { + public: + + + RefreshWebofficeTokenResult(); + explicit RefreshWebofficeTokenResult(const std::string &payload); + ~RefreshWebofficeTokenResult(); + std::string getRefreshToken()const; + std::string getAccessToken()const; + std::string getRefreshTokenExpiredTime()const; + std::string getAccessTokenExpiredTime()const; + + protected: + void parse(const std::string &payload); + private: + std::string refreshToken_; + std::string accessToken_; + std::string refreshTokenExpiredTime_; + std::string accessTokenExpiredTime_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_REFRESHWEBOFFICETOKENRESULT_H_ \ No newline at end of file diff --git a/imm/src/ImmClient.cc b/imm/src/ImmClient.cc index 5ca93902a..47ba270c3 100644 --- a/imm/src/ImmClient.cc +++ b/imm/src/ImmClient.cc @@ -31,21 +31,21 @@ ImmClient::ImmClient(const Credentials &credentials, const ClientConfiguration & RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "imm"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } ImmClient::ImmClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "imm"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } ImmClient::ImmClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "imm"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } ImmClient::~ImmClient() @@ -1923,6 +1923,42 @@ ImmClient::GetVideoTaskOutcomeCallable ImmClient::getVideoTaskCallable(const Get return task->get_future(); } +ImmClient::GetWebofficeURLOutcome ImmClient::getWebofficeURL(const GetWebofficeURLRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetWebofficeURLOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetWebofficeURLOutcome(GetWebofficeURLResult(outcome.result())); + else + return GetWebofficeURLOutcome(outcome.error()); +} + +void ImmClient::getWebofficeURLAsync(const GetWebofficeURLRequest& request, const GetWebofficeURLAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getWebofficeURL(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::GetWebofficeURLOutcomeCallable ImmClient::getWebofficeURLCallable(const GetWebofficeURLRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getWebofficeURL(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ImmClient::IndexImageOutcome ImmClient::indexImage(const IndexImageRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2571,6 +2607,42 @@ ImmClient::RefreshOfficePreviewTokenOutcomeCallable ImmClient::refreshOfficePrev return task->get_future(); } +ImmClient::RefreshWebofficeTokenOutcome ImmClient::refreshWebofficeToken(const RefreshWebofficeTokenRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RefreshWebofficeTokenOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RefreshWebofficeTokenOutcome(RefreshWebofficeTokenResult(outcome.result())); + else + return RefreshWebofficeTokenOutcome(outcome.error()); +} + +void ImmClient::refreshWebofficeTokenAsync(const RefreshWebofficeTokenRequest& request, const RefreshWebofficeTokenAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, refreshWebofficeToken(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::RefreshWebofficeTokenOutcomeCallable ImmClient::refreshWebofficeTokenCallable(const RefreshWebofficeTokenRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->refreshWebofficeToken(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ImmClient::SearchDocIndexOutcome ImmClient::searchDocIndex(const SearchDocIndexRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/imm/src/model/GetWebofficeURLRequest.cc b/imm/src/model/GetWebofficeURLRequest.cc new file mode 100644 index 000000000..a3dd1490c --- /dev/null +++ b/imm/src/model/GetWebofficeURLRequest.cc @@ -0,0 +1,128 @@ +/* + * 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::GetWebofficeURLRequest; + +GetWebofficeURLRequest::GetWebofficeURLRequest() : + RpcServiceRequest("imm", "2017-09-06", "GetWebofficeURL") +{ + setMethod(HttpRequest::Method::Post); +} + +GetWebofficeURLRequest::~GetWebofficeURLRequest() +{} + +std::string GetWebofficeURLRequest::getSrcType()const +{ + return srcType_; +} + +void GetWebofficeURLRequest::setSrcType(const std::string& srcType) +{ + srcType_ = srcType; + setParameter("SrcType", srcType); +} + +std::string GetWebofficeURLRequest::getProject()const +{ + return project_; +} + +void GetWebofficeURLRequest::setProject(const std::string& project) +{ + project_ = project; + setParameter("Project", project); +} + +std::string GetWebofficeURLRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void GetWebofficeURLRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string GetWebofficeURLRequest::getFile()const +{ + return file_; +} + +void GetWebofficeURLRequest::setFile(const std::string& file) +{ + file_ = file; + setParameter("File", file); +} + +std::string GetWebofficeURLRequest::getNotifyEndpoint()const +{ + return notifyEndpoint_; +} + +void GetWebofficeURLRequest::setNotifyEndpoint(const std::string& notifyEndpoint) +{ + notifyEndpoint_ = notifyEndpoint; + setParameter("NotifyEndpoint", notifyEndpoint); +} + +std::string GetWebofficeURLRequest::getFileID()const +{ + return fileID_; +} + +void GetWebofficeURLRequest::setFileID(const std::string& fileID) +{ + fileID_ = fileID; + setParameter("FileID", fileID); +} + +std::string GetWebofficeURLRequest::getNotifyTopicName()const +{ + return notifyTopicName_; +} + +void GetWebofficeURLRequest::setNotifyTopicName(const std::string& notifyTopicName) +{ + notifyTopicName_ = notifyTopicName; + setParameter("NotifyTopicName", notifyTopicName); +} + +std::string GetWebofficeURLRequest::getPermission()const +{ + return permission_; +} + +void GetWebofficeURLRequest::setPermission(const std::string& permission) +{ + permission_ = permission; + setParameter("Permission", permission); +} + +std::string GetWebofficeURLRequest::getUser()const +{ + return user_; +} + +void GetWebofficeURLRequest::setUser(const std::string& user) +{ + user_ = user; + setParameter("User", user); +} + diff --git a/imm/src/model/GetWebofficeURLResult.cc b/imm/src/model/GetWebofficeURLResult.cc new file mode 100644 index 000000000..cf6ea6444 --- /dev/null +++ b/imm/src/model/GetWebofficeURLResult.cc @@ -0,0 +1,79 @@ +/* + * 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; + +GetWebofficeURLResult::GetWebofficeURLResult() : + ServiceResult() +{} + +GetWebofficeURLResult::GetWebofficeURLResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetWebofficeURLResult::~GetWebofficeURLResult() +{} + +void GetWebofficeURLResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["WebofficeURL"].isNull()) + webofficeURL_ = value["WebofficeURL"].asString(); + if(!value["AccessToken"].isNull()) + accessToken_ = value["AccessToken"].asString(); + if(!value["RefreshToken"].isNull()) + refreshToken_ = value["RefreshToken"].asString(); + if(!value["AccessTokenExpiredTime"].isNull()) + accessTokenExpiredTime_ = value["AccessTokenExpiredTime"].asString(); + if(!value["RefreshTokenExpiredTime"].isNull()) + refreshTokenExpiredTime_ = value["RefreshTokenExpiredTime"].asString(); + +} + +std::string GetWebofficeURLResult::getRefreshToken()const +{ + return refreshToken_; +} + +std::string GetWebofficeURLResult::getAccessToken()const +{ + return accessToken_; +} + +std::string GetWebofficeURLResult::getRefreshTokenExpiredTime()const +{ + return refreshTokenExpiredTime_; +} + +std::string GetWebofficeURLResult::getWebofficeURL()const +{ + return webofficeURL_; +} + +std::string GetWebofficeURLResult::getAccessTokenExpiredTime()const +{ + return accessTokenExpiredTime_; +} + diff --git a/imm/src/model/RefreshWebofficeTokenRequest.cc b/imm/src/model/RefreshWebofficeTokenRequest.cc new file mode 100644 index 000000000..f17158bdf --- /dev/null +++ b/imm/src/model/RefreshWebofficeTokenRequest.cc @@ -0,0 +1,73 @@ +/* + * 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::RefreshWebofficeTokenRequest; + +RefreshWebofficeTokenRequest::RefreshWebofficeTokenRequest() : + RpcServiceRequest("imm", "2017-09-06", "RefreshWebofficeToken") +{ + setMethod(HttpRequest::Method::Post); +} + +RefreshWebofficeTokenRequest::~RefreshWebofficeTokenRequest() +{} + +std::string RefreshWebofficeTokenRequest::getProject()const +{ + return project_; +} + +void RefreshWebofficeTokenRequest::setProject(const std::string& project) +{ + project_ = project; + setParameter("Project", project); +} + +std::string RefreshWebofficeTokenRequest::getAccessToken()const +{ + return accessToken_; +} + +void RefreshWebofficeTokenRequest::setAccessToken(const std::string& accessToken) +{ + accessToken_ = accessToken; + setParameter("AccessToken", accessToken); +} + +std::string RefreshWebofficeTokenRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void RefreshWebofficeTokenRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string RefreshWebofficeTokenRequest::getRefreshToken()const +{ + return refreshToken_; +} + +void RefreshWebofficeTokenRequest::setRefreshToken(const std::string& refreshToken) +{ + refreshToken_ = refreshToken; + setParameter("RefreshToken", refreshToken); +} + diff --git a/imm/src/model/RefreshWebofficeTokenResult.cc b/imm/src/model/RefreshWebofficeTokenResult.cc new file mode 100644 index 000000000..a91227952 --- /dev/null +++ b/imm/src/model/RefreshWebofficeTokenResult.cc @@ -0,0 +1,72 @@ +/* + * 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; + +RefreshWebofficeTokenResult::RefreshWebofficeTokenResult() : + ServiceResult() +{} + +RefreshWebofficeTokenResult::RefreshWebofficeTokenResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RefreshWebofficeTokenResult::~RefreshWebofficeTokenResult() +{} + +void RefreshWebofficeTokenResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["AccessToken"].isNull()) + accessToken_ = value["AccessToken"].asString(); + if(!value["AccessTokenExpiredTime"].isNull()) + accessTokenExpiredTime_ = value["AccessTokenExpiredTime"].asString(); + if(!value["RefreshToken"].isNull()) + refreshToken_ = value["RefreshToken"].asString(); + if(!value["RefreshTokenExpiredTime"].isNull()) + refreshTokenExpiredTime_ = value["RefreshTokenExpiredTime"].asString(); + +} + +std::string RefreshWebofficeTokenResult::getRefreshToken()const +{ + return refreshToken_; +} + +std::string RefreshWebofficeTokenResult::getAccessToken()const +{ + return accessToken_; +} + +std::string RefreshWebofficeTokenResult::getRefreshTokenExpiredTime()const +{ + return refreshTokenExpiredTime_; +} + +std::string RefreshWebofficeTokenResult::getAccessTokenExpiredTime()const +{ + return accessTokenExpiredTime_; +} +