From e18ac68719ded596db25f77403b4a331648f2433 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Mon, 4 Jul 2022 12:58:37 +0000 Subject: [PATCH] Add API QueryEmbeddedStaus. --- CHANGELOG | 3 + VERSION | 2 +- quickbi-public/CMakeLists.txt | 4 ++ .../quickbi-public/Quickbi_publicClient.h | 8 +++ .../model/QueryEmbeddedStatusRequest.h | 48 +++++++++++++++ .../model/QueryEmbeddedStatusResult.h | 53 +++++++++++++++++ quickbi-public/src/Quickbi-publicClient.cc | 42 +++++++++++++- .../src/model/QueryEmbeddedStatusRequest.cc | 54 +++++++++++++++++ .../src/model/QueryEmbeddedStatusResult.cc | 58 +++++++++++++++++++ 9 files changed, 268 insertions(+), 4 deletions(-) create mode 100644 quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusRequest.h create mode 100644 quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusResult.h create mode 100644 quickbi-public/src/model/QueryEmbeddedStatusRequest.cc create mode 100644 quickbi-public/src/model/QueryEmbeddedStatusResult.cc diff --git a/CHANGELOG b/CHANGELOG index 3881b6b45..a14413c2d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2022-07-04 Version: 1.36.1168 +- Add API QueryEmbeddedStaus. + 2022-07-04 Version: 1.36.1167 - Update API error codes. - Adjust parameters verification rules for some APIs. diff --git a/VERSION b/VERSION index c2be32b85..76fd2cb2f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1167 \ No newline at end of file +1.36.1168 \ No newline at end of file diff --git a/quickbi-public/CMakeLists.txt b/quickbi-public/CMakeLists.txt index e99d52e33..171d277c6 100644 --- a/quickbi-public/CMakeLists.txt +++ b/quickbi-public/CMakeLists.txt @@ -109,6 +109,8 @@ set(quickbi-public_public_header_model include/alibabacloud/quickbi-public/model/QueryDatasetSwitchInfoResult.h include/alibabacloud/quickbi-public/model/QueryEmbeddedInfoRequest.h include/alibabacloud/quickbi-public/model/QueryEmbeddedInfoResult.h + include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusRequest.h + include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusResult.h include/alibabacloud/quickbi-public/model/QueryOrganizationWorkspaceListRequest.h include/alibabacloud/quickbi-public/model/QueryOrganizationWorkspaceListResult.h include/alibabacloud/quickbi-public/model/QueryReadableResourcesListByUserIdRequest.h @@ -266,6 +268,8 @@ set(quickbi-public_src src/model/QueryDatasetSwitchInfoResult.cc src/model/QueryEmbeddedInfoRequest.cc src/model/QueryEmbeddedInfoResult.cc + src/model/QueryEmbeddedStatusRequest.cc + src/model/QueryEmbeddedStatusResult.cc src/model/QueryOrganizationWorkspaceListRequest.cc src/model/QueryOrganizationWorkspaceListResult.cc src/model/QueryReadableResourcesListByUserIdRequest.cc diff --git a/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h b/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h index aa001f3d2..ad3d165eb 100644 --- a/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h +++ b/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h @@ -110,6 +110,8 @@ #include "model/QueryDatasetSwitchInfoResult.h" #include "model/QueryEmbeddedInfoRequest.h" #include "model/QueryEmbeddedInfoResult.h" +#include "model/QueryEmbeddedStatusRequest.h" +#include "model/QueryEmbeddedStatusResult.h" #include "model/QueryOrganizationWorkspaceListRequest.h" #include "model/QueryOrganizationWorkspaceListResult.h" #include "model/QueryReadableResourcesListByUserIdRequest.h" @@ -317,6 +319,9 @@ namespace AlibabaCloud typedef Outcome QueryEmbeddedInfoOutcome; typedef std::future QueryEmbeddedInfoOutcomeCallable; typedef std::function&)> QueryEmbeddedInfoAsyncHandler; + typedef Outcome QueryEmbeddedStatusOutcome; + typedef std::future QueryEmbeddedStatusOutcomeCallable; + typedef std::function&)> QueryEmbeddedStatusAsyncHandler; typedef Outcome QueryOrganizationWorkspaceListOutcome; typedef std::future QueryOrganizationWorkspaceListOutcomeCallable; typedef std::function&)> QueryOrganizationWorkspaceListAsyncHandler; @@ -553,6 +558,9 @@ namespace AlibabaCloud QueryEmbeddedInfoOutcome queryEmbeddedInfo(const Model::QueryEmbeddedInfoRequest &request)const; void queryEmbeddedInfoAsync(const Model::QueryEmbeddedInfoRequest& request, const QueryEmbeddedInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryEmbeddedInfoOutcomeCallable queryEmbeddedInfoCallable(const Model::QueryEmbeddedInfoRequest& request) const; + QueryEmbeddedStatusOutcome queryEmbeddedStatus(const Model::QueryEmbeddedStatusRequest &request)const; + void queryEmbeddedStatusAsync(const Model::QueryEmbeddedStatusRequest& request, const QueryEmbeddedStatusAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + QueryEmbeddedStatusOutcomeCallable queryEmbeddedStatusCallable(const Model::QueryEmbeddedStatusRequest& request) const; QueryOrganizationWorkspaceListOutcome queryOrganizationWorkspaceList(const Model::QueryOrganizationWorkspaceListRequest &request)const; void queryOrganizationWorkspaceListAsync(const Model::QueryOrganizationWorkspaceListRequest& request, const QueryOrganizationWorkspaceListAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryOrganizationWorkspaceListOutcomeCallable queryOrganizationWorkspaceListCallable(const Model::QueryOrganizationWorkspaceListRequest& request) const; diff --git a/quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusRequest.h b/quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusRequest.h new file mode 100644 index 000000000..79d077e15 --- /dev/null +++ b/quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusRequest.h @@ -0,0 +1,48 @@ +/* + * 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_QUICKBI_PUBLIC_MODEL_QUERYEMBEDDEDSTATUSREQUEST_H_ +#define ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_QUERYEMBEDDEDSTATUSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Quickbi_public { +namespace Model { +class ALIBABACLOUD_QUICKBI_PUBLIC_EXPORT QueryEmbeddedStatusRequest : public RpcServiceRequest { +public: + QueryEmbeddedStatusRequest(); + ~QueryEmbeddedStatusRequest(); + std::string getWorksId() const; + void setWorksId(const std::string &worksId); + std::string getAccessPoint() const; + void setAccessPoint(const std::string &accessPoint); + std::string getSignType() const; + void setSignType(const std::string &signType); + +private: + std::string worksId_; + std::string accessPoint_; + std::string signType_; +}; +} // namespace Model +} // namespace Quickbi_public +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_QUERYEMBEDDEDSTATUSREQUEST_H_ diff --git a/quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusResult.h b/quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusResult.h new file mode 100644 index 000000000..889524554 --- /dev/null +++ b/quickbi-public/include/alibabacloud/quickbi-public/model/QueryEmbeddedStatusResult.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_QUICKBI_PUBLIC_MODEL_QUERYEMBEDDEDSTATUSRESULT_H_ +#define ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_QUERYEMBEDDEDSTATUSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Quickbi_public + { + namespace Model + { + class ALIBABACLOUD_QUICKBI_PUBLIC_EXPORT QueryEmbeddedStatusResult : public ServiceResult + { + public: + + + QueryEmbeddedStatusResult(); + explicit QueryEmbeddedStatusResult(const std::string &payload); + ~QueryEmbeddedStatusResult(); + bool getSuccess()const; + bool getResult()const; + + protected: + void parse(const std::string &payload); + private: + bool success_; + bool result_; + + }; + } + } +} +#endif // !ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_QUERYEMBEDDEDSTATUSRESULT_H_ \ No newline at end of file diff --git a/quickbi-public/src/Quickbi-publicClient.cc b/quickbi-public/src/Quickbi-publicClient.cc index 1ed7fff83..59112fd98 100644 --- a/quickbi-public/src/Quickbi-publicClient.cc +++ b/quickbi-public/src/Quickbi-publicClient.cc @@ -31,21 +31,21 @@ Quickbi_publicClient::Quickbi_publicClient(const Credentials &credentials, const RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "quick"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "quickbi"); } Quickbi_publicClient::Quickbi_publicClient(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, "quick"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "quickbi"); } Quickbi_publicClient::Quickbi_publicClient(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, "quick"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "quickbi"); } Quickbi_publicClient::~Quickbi_publicClient() @@ -1635,6 +1635,42 @@ Quickbi_publicClient::QueryEmbeddedInfoOutcomeCallable Quickbi_publicClient::que return task->get_future(); } +Quickbi_publicClient::QueryEmbeddedStatusOutcome Quickbi_publicClient::queryEmbeddedStatus(const QueryEmbeddedStatusRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return QueryEmbeddedStatusOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return QueryEmbeddedStatusOutcome(QueryEmbeddedStatusResult(outcome.result())); + else + return QueryEmbeddedStatusOutcome(outcome.error()); +} + +void Quickbi_publicClient::queryEmbeddedStatusAsync(const QueryEmbeddedStatusRequest& request, const QueryEmbeddedStatusAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, queryEmbeddedStatus(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Quickbi_publicClient::QueryEmbeddedStatusOutcomeCallable Quickbi_publicClient::queryEmbeddedStatusCallable(const QueryEmbeddedStatusRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->queryEmbeddedStatus(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Quickbi_publicClient::QueryOrganizationWorkspaceListOutcome Quickbi_publicClient::queryOrganizationWorkspaceList(const QueryOrganizationWorkspaceListRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/quickbi-public/src/model/QueryEmbeddedStatusRequest.cc b/quickbi-public/src/model/QueryEmbeddedStatusRequest.cc new file mode 100644 index 000000000..f012de872 --- /dev/null +++ b/quickbi-public/src/model/QueryEmbeddedStatusRequest.cc @@ -0,0 +1,54 @@ +/* + * 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::Quickbi_public::Model::QueryEmbeddedStatusRequest; + +QueryEmbeddedStatusRequest::QueryEmbeddedStatusRequest() + : RpcServiceRequest("quickbi-public", "2022-01-01", "QueryEmbeddedStatus") { + setMethod(HttpRequest::Method::Post); +} + +QueryEmbeddedStatusRequest::~QueryEmbeddedStatusRequest() {} + +std::string QueryEmbeddedStatusRequest::getWorksId() const { + return worksId_; +} + +void QueryEmbeddedStatusRequest::setWorksId(const std::string &worksId) { + worksId_ = worksId; + setParameter(std::string("WorksId"), worksId); +} + +std::string QueryEmbeddedStatusRequest::getAccessPoint() const { + return accessPoint_; +} + +void QueryEmbeddedStatusRequest::setAccessPoint(const std::string &accessPoint) { + accessPoint_ = accessPoint; + setParameter(std::string("AccessPoint"), accessPoint); +} + +std::string QueryEmbeddedStatusRequest::getSignType() const { + return signType_; +} + +void QueryEmbeddedStatusRequest::setSignType(const std::string &signType) { + signType_ = signType; + setParameter(std::string("SignType"), signType); +} + diff --git a/quickbi-public/src/model/QueryEmbeddedStatusResult.cc b/quickbi-public/src/model/QueryEmbeddedStatusResult.cc new file mode 100644 index 000000000..a3071d47f --- /dev/null +++ b/quickbi-public/src/model/QueryEmbeddedStatusResult.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::Quickbi_public; +using namespace AlibabaCloud::Quickbi_public::Model; + +QueryEmbeddedStatusResult::QueryEmbeddedStatusResult() : + ServiceResult() +{} + +QueryEmbeddedStatusResult::QueryEmbeddedStatusResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +QueryEmbeddedStatusResult::~QueryEmbeddedStatusResult() +{} + +void QueryEmbeddedStatusResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Result"].isNull()) + result_ = value["Result"].asString() == "true"; + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +bool QueryEmbeddedStatusResult::getSuccess()const +{ + return success_; +} + +bool QueryEmbeddedStatusResult::getResult()const +{ + return result_; +} +