diff --git a/CHANGELOG b/CHANGELOG index d9eb8ac7b..2809a05da 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-02-04 Version: patch +- Supported scheduler for outbound call. + 2021-02-04 Version: patch - Supported console. diff --git a/outboundbot/CMakeLists.txt b/outboundbot/CMakeLists.txt index 8b56d89f6..346f6804d 100644 --- a/outboundbot/CMakeLists.txt +++ b/outboundbot/CMakeLists.txt @@ -91,6 +91,8 @@ set(outboundbot_public_header_model include/alibabacloud/outboundbot/model/ExportScriptResult.h include/alibabacloud/outboundbot/model/ImportScriptRequest.h include/alibabacloud/outboundbot/model/ImportScriptResult.h + include/alibabacloud/outboundbot/model/InflightTaskTimeoutRequest.h + include/alibabacloud/outboundbot/model/InflightTaskTimeoutResult.h include/alibabacloud/outboundbot/model/ListDialogueFlowsRequest.h include/alibabacloud/outboundbot/model/ListDialogueFlowsResult.h include/alibabacloud/outboundbot/model/ListGlobalQuestionsRequest.h @@ -109,6 +111,8 @@ set(outboundbot_public_header_model include/alibabacloud/outboundbot/model/ListMediaResult.h include/alibabacloud/outboundbot/model/ListOutboundCallNumbersRequest.h include/alibabacloud/outboundbot/model/ListOutboundCallNumbersResult.h + include/alibabacloud/outboundbot/model/ListSchedulerInstancesRequest.h + include/alibabacloud/outboundbot/model/ListSchedulerInstancesResult.h include/alibabacloud/outboundbot/model/ListScriptPublishHistoriesRequest.h include/alibabacloud/outboundbot/model/ListScriptPublishHistoriesResult.h include/alibabacloud/outboundbot/model/ListScriptVoiceConfigsRequest.h @@ -165,6 +169,8 @@ set(outboundbot_public_header_model include/alibabacloud/outboundbot/model/SubmitScriptReviewResult.h include/alibabacloud/outboundbot/model/SuspendJobsRequest.h include/alibabacloud/outboundbot/model/SuspendJobsResult.h + include/alibabacloud/outboundbot/model/TaskPreparingRequest.h + include/alibabacloud/outboundbot/model/TaskPreparingResult.h include/alibabacloud/outboundbot/model/WithdrawScriptReviewRequest.h include/alibabacloud/outboundbot/model/WithdrawScriptReviewResult.h ) @@ -240,6 +246,8 @@ set(outboundbot_src src/model/ExportScriptResult.cc src/model/ImportScriptRequest.cc src/model/ImportScriptResult.cc + src/model/InflightTaskTimeoutRequest.cc + src/model/InflightTaskTimeoutResult.cc src/model/ListDialogueFlowsRequest.cc src/model/ListDialogueFlowsResult.cc src/model/ListGlobalQuestionsRequest.cc @@ -258,6 +266,8 @@ set(outboundbot_src src/model/ListMediaResult.cc src/model/ListOutboundCallNumbersRequest.cc src/model/ListOutboundCallNumbersResult.cc + src/model/ListSchedulerInstancesRequest.cc + src/model/ListSchedulerInstancesResult.cc src/model/ListScriptPublishHistoriesRequest.cc src/model/ListScriptPublishHistoriesResult.cc src/model/ListScriptVoiceConfigsRequest.cc @@ -314,6 +324,8 @@ set(outboundbot_src src/model/SubmitScriptReviewResult.cc src/model/SuspendJobsRequest.cc src/model/SuspendJobsResult.cc + src/model/TaskPreparingRequest.cc + src/model/TaskPreparingResult.cc src/model/WithdrawScriptReviewRequest.cc src/model/WithdrawScriptReviewResult.cc ) diff --git a/outboundbot/include/alibabacloud/outboundbot/OutboundBotClient.h b/outboundbot/include/alibabacloud/outboundbot/OutboundBotClient.h index 6138d9e15..1e35a39ad 100644 --- a/outboundbot/include/alibabacloud/outboundbot/OutboundBotClient.h +++ b/outboundbot/include/alibabacloud/outboundbot/OutboundBotClient.h @@ -92,6 +92,8 @@ #include "model/ExportScriptResult.h" #include "model/ImportScriptRequest.h" #include "model/ImportScriptResult.h" +#include "model/InflightTaskTimeoutRequest.h" +#include "model/InflightTaskTimeoutResult.h" #include "model/ListDialogueFlowsRequest.h" #include "model/ListDialogueFlowsResult.h" #include "model/ListGlobalQuestionsRequest.h" @@ -110,6 +112,8 @@ #include "model/ListMediaResult.h" #include "model/ListOutboundCallNumbersRequest.h" #include "model/ListOutboundCallNumbersResult.h" +#include "model/ListSchedulerInstancesRequest.h" +#include "model/ListSchedulerInstancesResult.h" #include "model/ListScriptPublishHistoriesRequest.h" #include "model/ListScriptPublishHistoriesResult.h" #include "model/ListScriptVoiceConfigsRequest.h" @@ -166,6 +170,8 @@ #include "model/SubmitScriptReviewResult.h" #include "model/SuspendJobsRequest.h" #include "model/SuspendJobsResult.h" +#include "model/TaskPreparingRequest.h" +#include "model/TaskPreparingResult.h" #include "model/WithdrawScriptReviewRequest.h" #include "model/WithdrawScriptReviewResult.h" @@ -282,6 +288,9 @@ namespace AlibabaCloud typedef Outcome ImportScriptOutcome; typedef std::future ImportScriptOutcomeCallable; typedef std::function&)> ImportScriptAsyncHandler; + typedef Outcome InflightTaskTimeoutOutcome; + typedef std::future InflightTaskTimeoutOutcomeCallable; + typedef std::function&)> InflightTaskTimeoutAsyncHandler; typedef Outcome ListDialogueFlowsOutcome; typedef std::future ListDialogueFlowsOutcomeCallable; typedef std::function&)> ListDialogueFlowsAsyncHandler; @@ -309,6 +318,9 @@ namespace AlibabaCloud typedef Outcome ListOutboundCallNumbersOutcome; typedef std::future ListOutboundCallNumbersOutcomeCallable; typedef std::function&)> ListOutboundCallNumbersAsyncHandler; + typedef Outcome ListSchedulerInstancesOutcome; + typedef std::future ListSchedulerInstancesOutcomeCallable; + typedef std::function&)> ListSchedulerInstancesAsyncHandler; typedef Outcome ListScriptPublishHistoriesOutcome; typedef std::future ListScriptPublishHistoriesOutcomeCallable; typedef std::function&)> ListScriptPublishHistoriesAsyncHandler; @@ -393,6 +405,9 @@ namespace AlibabaCloud typedef Outcome SuspendJobsOutcome; typedef std::future SuspendJobsOutcomeCallable; typedef std::function&)> SuspendJobsAsyncHandler; + typedef Outcome TaskPreparingOutcome; + typedef std::future TaskPreparingOutcomeCallable; + typedef std::function&)> TaskPreparingAsyncHandler; typedef Outcome WithdrawScriptReviewOutcome; typedef std::future WithdrawScriptReviewOutcomeCallable; typedef std::function&)> WithdrawScriptReviewAsyncHandler; @@ -506,6 +521,9 @@ namespace AlibabaCloud ImportScriptOutcome importScript(const Model::ImportScriptRequest &request)const; void importScriptAsync(const Model::ImportScriptRequest& request, const ImportScriptAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ImportScriptOutcomeCallable importScriptCallable(const Model::ImportScriptRequest& request) const; + InflightTaskTimeoutOutcome inflightTaskTimeout(const Model::InflightTaskTimeoutRequest &request)const; + void inflightTaskTimeoutAsync(const Model::InflightTaskTimeoutRequest& request, const InflightTaskTimeoutAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + InflightTaskTimeoutOutcomeCallable inflightTaskTimeoutCallable(const Model::InflightTaskTimeoutRequest& request) const; ListDialogueFlowsOutcome listDialogueFlows(const Model::ListDialogueFlowsRequest &request)const; void listDialogueFlowsAsync(const Model::ListDialogueFlowsRequest& request, const ListDialogueFlowsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListDialogueFlowsOutcomeCallable listDialogueFlowsCallable(const Model::ListDialogueFlowsRequest& request) const; @@ -533,6 +551,9 @@ namespace AlibabaCloud ListOutboundCallNumbersOutcome listOutboundCallNumbers(const Model::ListOutboundCallNumbersRequest &request)const; void listOutboundCallNumbersAsync(const Model::ListOutboundCallNumbersRequest& request, const ListOutboundCallNumbersAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListOutboundCallNumbersOutcomeCallable listOutboundCallNumbersCallable(const Model::ListOutboundCallNumbersRequest& request) const; + ListSchedulerInstancesOutcome listSchedulerInstances(const Model::ListSchedulerInstancesRequest &request)const; + void listSchedulerInstancesAsync(const Model::ListSchedulerInstancesRequest& request, const ListSchedulerInstancesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListSchedulerInstancesOutcomeCallable listSchedulerInstancesCallable(const Model::ListSchedulerInstancesRequest& request) const; ListScriptPublishHistoriesOutcome listScriptPublishHistories(const Model::ListScriptPublishHistoriesRequest &request)const; void listScriptPublishHistoriesAsync(const Model::ListScriptPublishHistoriesRequest& request, const ListScriptPublishHistoriesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListScriptPublishHistoriesOutcomeCallable listScriptPublishHistoriesCallable(const Model::ListScriptPublishHistoriesRequest& request) const; @@ -617,6 +638,9 @@ namespace AlibabaCloud SuspendJobsOutcome suspendJobs(const Model::SuspendJobsRequest &request)const; void suspendJobsAsync(const Model::SuspendJobsRequest& request, const SuspendJobsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SuspendJobsOutcomeCallable suspendJobsCallable(const Model::SuspendJobsRequest& request) const; + TaskPreparingOutcome taskPreparing(const Model::TaskPreparingRequest &request)const; + void taskPreparingAsync(const Model::TaskPreparingRequest& request, const TaskPreparingAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + TaskPreparingOutcomeCallable taskPreparingCallable(const Model::TaskPreparingRequest& request) const; WithdrawScriptReviewOutcome withdrawScriptReview(const Model::WithdrawScriptReviewRequest &request)const; void withdrawScriptReviewAsync(const Model::WithdrawScriptReviewRequest& request, const WithdrawScriptReviewAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; WithdrawScriptReviewOutcomeCallable withdrawScriptReviewCallable(const Model::WithdrawScriptReviewRequest& request) const; diff --git a/outboundbot/include/alibabacloud/outboundbot/model/InflightTaskTimeoutRequest.h b/outboundbot/include/alibabacloud/outboundbot/model/InflightTaskTimeoutRequest.h new file mode 100644 index 000000000..12b6ec9c5 --- /dev/null +++ b/outboundbot/include/alibabacloud/outboundbot/model/InflightTaskTimeoutRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_OUTBOUNDBOT_MODEL_INFLIGHTTASKTIMEOUTREQUEST_H_ +#define ALIBABACLOUD_OUTBOUNDBOT_MODEL_INFLIGHTTASKTIMEOUTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OutboundBot + { + namespace Model + { + class ALIBABACLOUD_OUTBOUNDBOT_EXPORT InflightTaskTimeoutRequest : public RpcServiceRequest + { + + public: + InflightTaskTimeoutRequest(); + ~InflightTaskTimeoutRequest(); + + std::string getInstanceId()const; + void setInstanceId(const std::string& instanceId); + long getInstanceOwnerId()const; + void setInstanceOwnerId(long instanceOwnerId); + std::string getTaskId()const; + void setTaskId(const std::string& taskId); + + private: + std::string instanceId_; + long instanceOwnerId_; + std::string taskId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OUTBOUNDBOT_MODEL_INFLIGHTTASKTIMEOUTREQUEST_H_ \ No newline at end of file diff --git a/outboundbot/include/alibabacloud/outboundbot/model/InflightTaskTimeoutResult.h b/outboundbot/include/alibabacloud/outboundbot/model/InflightTaskTimeoutResult.h new file mode 100644 index 000000000..fbfcb98e4 --- /dev/null +++ b/outboundbot/include/alibabacloud/outboundbot/model/InflightTaskTimeoutResult.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_OUTBOUNDBOT_MODEL_INFLIGHTTASKTIMEOUTRESULT_H_ +#define ALIBABACLOUD_OUTBOUNDBOT_MODEL_INFLIGHTTASKTIMEOUTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OutboundBot + { + namespace Model + { + class ALIBABACLOUD_OUTBOUNDBOT_EXPORT InflightTaskTimeoutResult : public ServiceResult + { + public: + + + InflightTaskTimeoutResult(); + explicit InflightTaskTimeoutResult(const std::string &payload); + ~InflightTaskTimeoutResult(); + std::string getMessage()const; + int getHttpStatusCode()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + int httpStatusCode_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OUTBOUNDBOT_MODEL_INFLIGHTTASKTIMEOUTRESULT_H_ \ No newline at end of file diff --git a/outboundbot/include/alibabacloud/outboundbot/model/ListSchedulerInstancesRequest.h b/outboundbot/include/alibabacloud/outboundbot/model/ListSchedulerInstancesRequest.h new file mode 100644 index 000000000..1473263ca --- /dev/null +++ b/outboundbot/include/alibabacloud/outboundbot/model/ListSchedulerInstancesRequest.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_OUTBOUNDBOT_MODEL_LISTSCHEDULERINSTANCESREQUEST_H_ +#define ALIBABACLOUD_OUTBOUNDBOT_MODEL_LISTSCHEDULERINSTANCESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OutboundBot + { + namespace Model + { + class ALIBABACLOUD_OUTBOUNDBOT_EXPORT ListSchedulerInstancesRequest : public RpcServiceRequest + { + + public: + ListSchedulerInstancesRequest(); + ~ListSchedulerInstancesRequest(); + + long getInstanceOwnerId()const; + void setInstanceOwnerId(long instanceOwnerId); + + private: + long instanceOwnerId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OUTBOUNDBOT_MODEL_LISTSCHEDULERINSTANCESREQUEST_H_ \ No newline at end of file diff --git a/outboundbot/include/alibabacloud/outboundbot/model/ListSchedulerInstancesResult.h b/outboundbot/include/alibabacloud/outboundbot/model/ListSchedulerInstancesResult.h new file mode 100644 index 000000000..b7c37cb64 --- /dev/null +++ b/outboundbot/include/alibabacloud/outboundbot/model/ListSchedulerInstancesResult.h @@ -0,0 +1,66 @@ +/* + * 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_OUTBOUNDBOT_MODEL_LISTSCHEDULERINSTANCESRESULT_H_ +#define ALIBABACLOUD_OUTBOUNDBOT_MODEL_LISTSCHEDULERINSTANCESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OutboundBot + { + namespace Model + { + class ALIBABACLOUD_OUTBOUNDBOT_EXPORT ListSchedulerInstancesResult : public ServiceResult + { + public: + struct SchedulerInstance + { + std::string ownerId; + std::string instanceId; + int maxConcurrency; + std::string business; + }; + + + ListSchedulerInstancesResult(); + explicit ListSchedulerInstancesResult(const std::string &payload); + ~ListSchedulerInstancesResult(); + std::vector getSchedulerInstances()const; + std::string getMessage()const; + int getHttpStatusCode()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::vector schedulerInstances_; + std::string message_; + int httpStatusCode_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OUTBOUNDBOT_MODEL_LISTSCHEDULERINSTANCESRESULT_H_ \ No newline at end of file diff --git a/outboundbot/include/alibabacloud/outboundbot/model/TaskPreparingRequest.h b/outboundbot/include/alibabacloud/outboundbot/model/TaskPreparingRequest.h new file mode 100644 index 000000000..28328ead8 --- /dev/null +++ b/outboundbot/include/alibabacloud/outboundbot/model/TaskPreparingRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_OUTBOUNDBOT_MODEL_TASKPREPARINGREQUEST_H_ +#define ALIBABACLOUD_OUTBOUNDBOT_MODEL_TASKPREPARINGREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OutboundBot + { + namespace Model + { + class ALIBABACLOUD_OUTBOUNDBOT_EXPORT TaskPreparingRequest : public RpcServiceRequest + { + + public: + TaskPreparingRequest(); + ~TaskPreparingRequest(); + + std::string getJobId()const; + void setJobId(const std::string& jobId); + std::string getInstanceId()const; + void setInstanceId(const std::string& instanceId); + long getInstanceOwnerId()const; + void setInstanceOwnerId(long instanceOwnerId); + + private: + std::string jobId_; + std::string instanceId_; + long instanceOwnerId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OUTBOUNDBOT_MODEL_TASKPREPARINGREQUEST_H_ \ No newline at end of file diff --git a/outboundbot/include/alibabacloud/outboundbot/model/TaskPreparingResult.h b/outboundbot/include/alibabacloud/outboundbot/model/TaskPreparingResult.h new file mode 100644 index 000000000..ec25cea7a --- /dev/null +++ b/outboundbot/include/alibabacloud/outboundbot/model/TaskPreparingResult.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_OUTBOUNDBOT_MODEL_TASKPREPARINGRESULT_H_ +#define ALIBABACLOUD_OUTBOUNDBOT_MODEL_TASKPREPARINGRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OutboundBot + { + namespace Model + { + class ALIBABACLOUD_OUTBOUNDBOT_EXPORT TaskPreparingResult : public ServiceResult + { + public: + + + TaskPreparingResult(); + explicit TaskPreparingResult(const std::string &payload); + ~TaskPreparingResult(); + std::string getTaskId()const; + std::string getMessage()const; + int getHttpStatusCode()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string taskId_; + std::string message_; + int httpStatusCode_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OUTBOUNDBOT_MODEL_TASKPREPARINGRESULT_H_ \ No newline at end of file diff --git a/outboundbot/src/OutboundBotClient.cc b/outboundbot/src/OutboundBotClient.cc index d9cf2f580..97654e164 100644 --- a/outboundbot/src/OutboundBotClient.cc +++ b/outboundbot/src/OutboundBotClient.cc @@ -1311,6 +1311,42 @@ OutboundBotClient::ImportScriptOutcomeCallable OutboundBotClient::importScriptCa return task->get_future(); } +OutboundBotClient::InflightTaskTimeoutOutcome OutboundBotClient::inflightTaskTimeout(const InflightTaskTimeoutRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return InflightTaskTimeoutOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return InflightTaskTimeoutOutcome(InflightTaskTimeoutResult(outcome.result())); + else + return InflightTaskTimeoutOutcome(outcome.error()); +} + +void OutboundBotClient::inflightTaskTimeoutAsync(const InflightTaskTimeoutRequest& request, const InflightTaskTimeoutAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, inflightTaskTimeout(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OutboundBotClient::InflightTaskTimeoutOutcomeCallable OutboundBotClient::inflightTaskTimeoutCallable(const InflightTaskTimeoutRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->inflightTaskTimeout(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + OutboundBotClient::ListDialogueFlowsOutcome OutboundBotClient::listDialogueFlows(const ListDialogueFlowsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1635,6 +1671,42 @@ OutboundBotClient::ListOutboundCallNumbersOutcomeCallable OutboundBotClient::lis return task->get_future(); } +OutboundBotClient::ListSchedulerInstancesOutcome OutboundBotClient::listSchedulerInstances(const ListSchedulerInstancesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListSchedulerInstancesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListSchedulerInstancesOutcome(ListSchedulerInstancesResult(outcome.result())); + else + return ListSchedulerInstancesOutcome(outcome.error()); +} + +void OutboundBotClient::listSchedulerInstancesAsync(const ListSchedulerInstancesRequest& request, const ListSchedulerInstancesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listSchedulerInstances(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OutboundBotClient::ListSchedulerInstancesOutcomeCallable OutboundBotClient::listSchedulerInstancesCallable(const ListSchedulerInstancesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listSchedulerInstances(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + OutboundBotClient::ListScriptPublishHistoriesOutcome OutboundBotClient::listScriptPublishHistories(const ListScriptPublishHistoriesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2643,6 +2715,42 @@ OutboundBotClient::SuspendJobsOutcomeCallable OutboundBotClient::suspendJobsCall return task->get_future(); } +OutboundBotClient::TaskPreparingOutcome OutboundBotClient::taskPreparing(const TaskPreparingRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return TaskPreparingOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return TaskPreparingOutcome(TaskPreparingResult(outcome.result())); + else + return TaskPreparingOutcome(outcome.error()); +} + +void OutboundBotClient::taskPreparingAsync(const TaskPreparingRequest& request, const TaskPreparingAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, taskPreparing(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OutboundBotClient::TaskPreparingOutcomeCallable OutboundBotClient::taskPreparingCallable(const TaskPreparingRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->taskPreparing(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + OutboundBotClient::WithdrawScriptReviewOutcome OutboundBotClient::withdrawScriptReview(const WithdrawScriptReviewRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/outboundbot/src/model/InflightTaskTimeoutRequest.cc b/outboundbot/src/model/InflightTaskTimeoutRequest.cc new file mode 100644 index 000000000..1e9c2203a --- /dev/null +++ b/outboundbot/src/model/InflightTaskTimeoutRequest.cc @@ -0,0 +1,62 @@ +/* + * 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::OutboundBot::Model::InflightTaskTimeoutRequest; + +InflightTaskTimeoutRequest::InflightTaskTimeoutRequest() : + RpcServiceRequest("outboundbot", "2019-12-26", "InflightTaskTimeout") +{ + setMethod(HttpRequest::Method::Post); +} + +InflightTaskTimeoutRequest::~InflightTaskTimeoutRequest() +{} + +std::string InflightTaskTimeoutRequest::getInstanceId()const +{ + return instanceId_; +} + +void InflightTaskTimeoutRequest::setInstanceId(const std::string& instanceId) +{ + instanceId_ = instanceId; + setParameter("InstanceId", instanceId); +} + +long InflightTaskTimeoutRequest::getInstanceOwnerId()const +{ + return instanceOwnerId_; +} + +void InflightTaskTimeoutRequest::setInstanceOwnerId(long instanceOwnerId) +{ + instanceOwnerId_ = instanceOwnerId; + setParameter("InstanceOwnerId", std::to_string(instanceOwnerId)); +} + +std::string InflightTaskTimeoutRequest::getTaskId()const +{ + return taskId_; +} + +void InflightTaskTimeoutRequest::setTaskId(const std::string& taskId) +{ + taskId_ = taskId; + setParameter("TaskId", taskId); +} + diff --git a/outboundbot/src/model/InflightTaskTimeoutResult.cc b/outboundbot/src/model/InflightTaskTimeoutResult.cc new file mode 100644 index 000000000..6f578d8ad --- /dev/null +++ b/outboundbot/src/model/InflightTaskTimeoutResult.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::OutboundBot; +using namespace AlibabaCloud::OutboundBot::Model; + +InflightTaskTimeoutResult::InflightTaskTimeoutResult() : + ServiceResult() +{} + +InflightTaskTimeoutResult::InflightTaskTimeoutResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +InflightTaskTimeoutResult::~InflightTaskTimeoutResult() +{} + +void InflightTaskTimeoutResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["HttpStatusCode"].isNull()) + httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString()); + +} + +std::string InflightTaskTimeoutResult::getMessage()const +{ + return message_; +} + +int InflightTaskTimeoutResult::getHttpStatusCode()const +{ + return httpStatusCode_; +} + +std::string InflightTaskTimeoutResult::getCode()const +{ + return code_; +} + +bool InflightTaskTimeoutResult::getSuccess()const +{ + return success_; +} + diff --git a/outboundbot/src/model/ListSchedulerInstancesRequest.cc b/outboundbot/src/model/ListSchedulerInstancesRequest.cc new file mode 100644 index 000000000..9e9b7a393 --- /dev/null +++ b/outboundbot/src/model/ListSchedulerInstancesRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::OutboundBot::Model::ListSchedulerInstancesRequest; + +ListSchedulerInstancesRequest::ListSchedulerInstancesRequest() : + RpcServiceRequest("outboundbot", "2019-12-26", "ListSchedulerInstances") +{ + setMethod(HttpRequest::Method::Post); +} + +ListSchedulerInstancesRequest::~ListSchedulerInstancesRequest() +{} + +long ListSchedulerInstancesRequest::getInstanceOwnerId()const +{ + return instanceOwnerId_; +} + +void ListSchedulerInstancesRequest::setInstanceOwnerId(long instanceOwnerId) +{ + instanceOwnerId_ = instanceOwnerId; + setParameter("InstanceOwnerId", std::to_string(instanceOwnerId)); +} + diff --git a/outboundbot/src/model/ListSchedulerInstancesResult.cc b/outboundbot/src/model/ListSchedulerInstancesResult.cc new file mode 100644 index 000000000..acbc7d633 --- /dev/null +++ b/outboundbot/src/model/ListSchedulerInstancesResult.cc @@ -0,0 +1,91 @@ +/* + * 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::OutboundBot; +using namespace AlibabaCloud::OutboundBot::Model; + +ListSchedulerInstancesResult::ListSchedulerInstancesResult() : + ServiceResult() +{} + +ListSchedulerInstancesResult::ListSchedulerInstancesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListSchedulerInstancesResult::~ListSchedulerInstancesResult() +{} + +void ListSchedulerInstancesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allSchedulerInstancesNode = value["SchedulerInstances"]["SchedulerInstance"]; + for (auto valueSchedulerInstancesSchedulerInstance : allSchedulerInstancesNode) + { + SchedulerInstance schedulerInstancesObject; + if(!valueSchedulerInstancesSchedulerInstance["OwnerId"].isNull()) + schedulerInstancesObject.ownerId = valueSchedulerInstancesSchedulerInstance["OwnerId"].asString(); + if(!valueSchedulerInstancesSchedulerInstance["InstanceId"].isNull()) + schedulerInstancesObject.instanceId = valueSchedulerInstancesSchedulerInstance["InstanceId"].asString(); + if(!valueSchedulerInstancesSchedulerInstance["Business"].isNull()) + schedulerInstancesObject.business = valueSchedulerInstancesSchedulerInstance["Business"].asString(); + if(!valueSchedulerInstancesSchedulerInstance["MaxConcurrency"].isNull()) + schedulerInstancesObject.maxConcurrency = std::stoi(valueSchedulerInstancesSchedulerInstance["MaxConcurrency"].asString()); + schedulerInstances_.push_back(schedulerInstancesObject); + } + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["HttpStatusCode"].isNull()) + httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString()); + +} + +std::vector ListSchedulerInstancesResult::getSchedulerInstances()const +{ + return schedulerInstances_; +} + +std::string ListSchedulerInstancesResult::getMessage()const +{ + return message_; +} + +int ListSchedulerInstancesResult::getHttpStatusCode()const +{ + return httpStatusCode_; +} + +std::string ListSchedulerInstancesResult::getCode()const +{ + return code_; +} + +bool ListSchedulerInstancesResult::getSuccess()const +{ + return success_; +} + diff --git a/outboundbot/src/model/TaskPreparingRequest.cc b/outboundbot/src/model/TaskPreparingRequest.cc new file mode 100644 index 000000000..d2ed4f705 --- /dev/null +++ b/outboundbot/src/model/TaskPreparingRequest.cc @@ -0,0 +1,62 @@ +/* + * 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::OutboundBot::Model::TaskPreparingRequest; + +TaskPreparingRequest::TaskPreparingRequest() : + RpcServiceRequest("outboundbot", "2019-12-26", "TaskPreparing") +{ + setMethod(HttpRequest::Method::Post); +} + +TaskPreparingRequest::~TaskPreparingRequest() +{} + +std::string TaskPreparingRequest::getJobId()const +{ + return jobId_; +} + +void TaskPreparingRequest::setJobId(const std::string& jobId) +{ + jobId_ = jobId; + setParameter("JobId", jobId); +} + +std::string TaskPreparingRequest::getInstanceId()const +{ + return instanceId_; +} + +void TaskPreparingRequest::setInstanceId(const std::string& instanceId) +{ + instanceId_ = instanceId; + setParameter("InstanceId", instanceId); +} + +long TaskPreparingRequest::getInstanceOwnerId()const +{ + return instanceOwnerId_; +} + +void TaskPreparingRequest::setInstanceOwnerId(long instanceOwnerId) +{ + instanceOwnerId_ = instanceOwnerId; + setParameter("InstanceOwnerId", std::to_string(instanceOwnerId)); +} + diff --git a/outboundbot/src/model/TaskPreparingResult.cc b/outboundbot/src/model/TaskPreparingResult.cc new file mode 100644 index 000000000..4a68c08b8 --- /dev/null +++ b/outboundbot/src/model/TaskPreparingResult.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::OutboundBot; +using namespace AlibabaCloud::OutboundBot::Model; + +TaskPreparingResult::TaskPreparingResult() : + ServiceResult() +{} + +TaskPreparingResult::TaskPreparingResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +TaskPreparingResult::~TaskPreparingResult() +{} + +void TaskPreparingResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["HttpStatusCode"].isNull()) + httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString()); + if(!value["TaskId"].isNull()) + taskId_ = value["TaskId"].asString(); + +} + +std::string TaskPreparingResult::getTaskId()const +{ + return taskId_; +} + +std::string TaskPreparingResult::getMessage()const +{ + return message_; +} + +int TaskPreparingResult::getHttpStatusCode()const +{ + return httpStatusCode_; +} + +std::string TaskPreparingResult::getCode()const +{ + return code_; +} + +bool TaskPreparingResult::getSuccess()const +{ + return success_; +} +