diff --git a/VERSION b/VERSION index cded702e7..899b2ba3d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.2055 \ No newline at end of file +1.36.2056 \ No newline at end of file diff --git a/aipodcast/CMakeLists.txt b/aipodcast/CMakeLists.txt new file mode 100644 index 000000000..1681036c1 --- /dev/null +++ b/aipodcast/CMakeLists.txt @@ -0,0 +1,90 @@ +# +# 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. +# + +set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +set(aipodcast_public_header + include/alibabacloud/aipodcast/AIPodcastClient.h + include/alibabacloud/aipodcast/AIPodcastExport.h ) + +set(aipodcast_public_header_model + include/alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.h + include/alibabacloud/aipodcast/model/PodcastTaskResultQueryResult.h + include/alibabacloud/aipodcast/model/PodcastTaskSubmitRequest.h + include/alibabacloud/aipodcast/model/PodcastTaskSubmitResult.h ) + +set(aipodcast_src + src/AIPodcastClient.cc + src/model/PodcastTaskResultQueryRequest.cc + src/model/PodcastTaskResultQueryResult.cc + src/model/PodcastTaskSubmitRequest.cc + src/model/PodcastTaskSubmitResult.cc ) + +add_library(aipodcast ${LIB_TYPE} + ${aipodcast_public_header} + ${aipodcast_public_header_model} + ${aipodcast_src}) + +set_target_properties(aipodcast + PROPERTIES + LINKER_LANGUAGE CXX + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}aipodcast + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(aipodcast + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_AIPODCAST_LIBRARY) +endif() + +target_include_directories(aipodcast + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(aipodcast + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(aipodcast + jsoncpp) + target_include_directories(aipodcast + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(aipodcast + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(aipodcast + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(aipodcast + PRIVATE /usr/include/jsoncpp) + target_link_libraries(aipodcast + jsoncpp) +endif() + +install(FILES ${aipodcast_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aipodcast) +install(FILES ${aipodcast_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aipodcast/model) +install(TARGETS aipodcast + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/aipodcast/include/alibabacloud/aipodcast/AIPodcastClient.h b/aipodcast/include/alibabacloud/aipodcast/AIPodcastClient.h new file mode 100644 index 000000000..c3c62f9a3 --- /dev/null +++ b/aipodcast/include/alibabacloud/aipodcast/AIPodcastClient.h @@ -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. + */ + +#ifndef ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_ +#define ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_ + +#include +#include +#include +#include +#include "AIPodcastExport.h" +#include "model/PodcastTaskResultQueryRequest.h" +#include "model/PodcastTaskResultQueryResult.h" +#include "model/PodcastTaskSubmitRequest.h" +#include "model/PodcastTaskSubmitResult.h" + + +namespace AlibabaCloud +{ + namespace AIPodcast + { + class ALIBABACLOUD_AIPODCAST_EXPORT AIPodcastClient : public RoaServiceClient + { + public: + typedef Outcome PodcastTaskResultQueryOutcome; + typedef std::future PodcastTaskResultQueryOutcomeCallable; + typedef std::function&)> PodcastTaskResultQueryAsyncHandler; + typedef Outcome PodcastTaskSubmitOutcome; + typedef std::future PodcastTaskSubmitOutcomeCallable; + typedef std::function&)> PodcastTaskSubmitAsyncHandler; + + AIPodcastClient(const Credentials &credentials, const ClientConfiguration &configuration); + AIPodcastClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + AIPodcastClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~AIPodcastClient(); + PodcastTaskResultQueryOutcome podcastTaskResultQuery(const Model::PodcastTaskResultQueryRequest &request)const; + void podcastTaskResultQueryAsync(const Model::PodcastTaskResultQueryRequest& request, const PodcastTaskResultQueryAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + PodcastTaskResultQueryOutcomeCallable podcastTaskResultQueryCallable(const Model::PodcastTaskResultQueryRequest& request) const; + PodcastTaskSubmitOutcome podcastTaskSubmit(const Model::PodcastTaskSubmitRequest &request)const; + void podcastTaskSubmitAsync(const Model::PodcastTaskSubmitRequest& request, const PodcastTaskSubmitAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + PodcastTaskSubmitOutcomeCallable podcastTaskSubmitCallable(const Model::PodcastTaskSubmitRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_ diff --git a/aipodcast/include/alibabacloud/aipodcast/AIPodcastExport.h b/aipodcast/include/alibabacloud/aipodcast/AIPodcastExport.h new file mode 100644 index 000000000..326e54a07 --- /dev/null +++ b/aipodcast/include/alibabacloud/aipodcast/AIPodcastExport.h @@ -0,0 +1,32 @@ +/* + * 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_AIPODCAST_AIPODCASTEXPORT_H_ +#define ALIBABACLOUD_AIPODCAST_AIPODCASTEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_AIPODCAST_LIBRARY) +# define ALIBABACLOUD_AIPODCAST_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_AIPODCAST_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_AIPODCAST_EXPORT +#endif + +#endif // !ALIBABACLOUD_AIPODCAST_AIPODCASTEXPORT_H_ \ No newline at end of file diff --git a/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.h b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.h new file mode 100644 index 000000000..bf13d4fb4 --- /dev/null +++ b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.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_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_ +#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace AIPodcast { +namespace Model { +class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskResultQueryRequest : public RoaServiceRequest { +public: + PodcastTaskResultQueryRequest(); + ~PodcastTaskResultQueryRequest(); + std::string getAppId() const; + void setAppId(const std::string &appId); + std::string getTaskId() const; + void setTaskId(const std::string &taskId); + std::string getWorkspaceId() const; + void setWorkspaceId(const std::string &workspaceId); + +private: + std::string appId_; + std::string taskId_; + std::string workspaceId_; +}; +} // namespace Model +} // namespace AIPodcast +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_ diff --git a/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskResultQueryResult.h b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskResultQueryResult.h new file mode 100644 index 000000000..4b73a0df4 --- /dev/null +++ b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskResultQueryResult.h @@ -0,0 +1,49 @@ +/* + * 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_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_ +#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace AIPodcast + { + namespace Model + { + class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskResultQueryResult : public ServiceResult + { + public: + + + PodcastTaskResultQueryResult(); + explicit PodcastTaskResultQueryResult(const std::string &payload); + ~PodcastTaskResultQueryResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_ \ No newline at end of file diff --git a/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskSubmitRequest.h b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskSubmitRequest.h new file mode 100644 index 000000000..084c381f9 --- /dev/null +++ b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskSubmitRequest.h @@ -0,0 +1,69 @@ +/* + * 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_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_ +#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace AIPodcast { +namespace Model { +class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskSubmitRequest : public RoaServiceRequest { +public: + PodcastTaskSubmitRequest(); + ~PodcastTaskSubmitRequest(); + std::string getAtmosphere() const; + void setAtmosphere(const std::string &atmosphere); + std::string getSourceLang() const; + void setSourceLang(const std::string &sourceLang); + int getCounts() const; + void setCounts(int counts); + std::vector getFileUrls() const; + void setFileUrls(const std::vector &fileUrls); + std::string getText() const; + void setText(const std::string &text); + std::vector getVoices() const; + void setVoices(const std::vector &voices); + std::string getAppId() const; + void setAppId(const std::string &appId); + std::string getTopic() const; + void setTopic(const std::string &topic); + std::string getStyle() const; + void setStyle(const std::string &style); + std::string getWorkspaceId() const; + void setWorkspaceId(const std::string &workspaceId); + +private: + std::string atmosphere_; + std::string sourceLang_; + int counts_; + std::vector fileUrls_; + std::string text_; + std::vector voices_; + std::string appId_; + std::string topic_; + std::string style_; + std::string workspaceId_; +}; +} // namespace Model +} // namespace AIPodcast +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_ diff --git a/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskSubmitResult.h b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskSubmitResult.h new file mode 100644 index 000000000..4b152263d --- /dev/null +++ b/aipodcast/include/alibabacloud/aipodcast/model/PodcastTaskSubmitResult.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_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_ +#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace AIPodcast + { + namespace Model + { + class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskSubmitResult : public ServiceResult + { + public: + struct Data + { + std::string taskId; + std::string taskStatus; + }; + + + PodcastTaskSubmitResult(); + explicit PodcastTaskSubmitResult(const std::string &payload); + ~PodcastTaskSubmitResult(); + std::string getMessage()const; + std::string getRequestId()const; + std::string getHttpStatusCode()const; + Data getData()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::string requestId_; + std::string httpStatusCode_; + Data data_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_ \ No newline at end of file diff --git a/aipodcast/src/AIPodcastClient.cc b/aipodcast/src/AIPodcastClient.cc new file mode 100644 index 000000000..170471d43 --- /dev/null +++ b/aipodcast/src/AIPodcastClient.cc @@ -0,0 +1,125 @@ +/* + * 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; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::AIPodcast; +using namespace AlibabaCloud::AIPodcast::Model; + +namespace +{ + const std::string SERVICE_NAME = "AIPodcast"; +} + +AIPodcastClient::AIPodcastClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RoaServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +AIPodcastClient::AIPodcastClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +AIPodcastClient::AIPodcastClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RoaServiceClient(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, ""); +} + +AIPodcastClient::~AIPodcastClient() +{} + +AIPodcastClient::PodcastTaskResultQueryOutcome AIPodcastClient::podcastTaskResultQuery(const PodcastTaskResultQueryRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return PodcastTaskResultQueryOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return PodcastTaskResultQueryOutcome(PodcastTaskResultQueryResult(outcome.result())); + else + return PodcastTaskResultQueryOutcome(outcome.error()); +} + +void AIPodcastClient::podcastTaskResultQueryAsync(const PodcastTaskResultQueryRequest& request, const PodcastTaskResultQueryAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, podcastTaskResultQuery(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AIPodcastClient::PodcastTaskResultQueryOutcomeCallable AIPodcastClient::podcastTaskResultQueryCallable(const PodcastTaskResultQueryRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->podcastTaskResultQuery(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AIPodcastClient::PodcastTaskSubmitOutcome AIPodcastClient::podcastTaskSubmit(const PodcastTaskSubmitRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return PodcastTaskSubmitOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return PodcastTaskSubmitOutcome(PodcastTaskSubmitResult(outcome.result())); + else + return PodcastTaskSubmitOutcome(outcome.error()); +} + +void AIPodcastClient::podcastTaskSubmitAsync(const PodcastTaskSubmitRequest& request, const PodcastTaskSubmitAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, podcastTaskSubmit(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AIPodcastClient::PodcastTaskSubmitOutcomeCallable AIPodcastClient::podcastTaskSubmitCallable(const PodcastTaskSubmitRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->podcastTaskSubmit(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/aipodcast/src/model/PodcastTaskResultQueryRequest.cc b/aipodcast/src/model/PodcastTaskResultQueryRequest.cc new file mode 100644 index 000000000..e588eefa3 --- /dev/null +++ b/aipodcast/src/model/PodcastTaskResultQueryRequest.cc @@ -0,0 +1,55 @@ +/* + * 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::AIPodcast::Model::PodcastTaskResultQueryRequest; + +PodcastTaskResultQueryRequest::PodcastTaskResultQueryRequest() + : RoaServiceRequest("aipodcast", "2025-02-28") { + setResourcePath("/podcast/task"}; + setMethod(HttpRequest::Method::Post); +} + +PodcastTaskResultQueryRequest::~PodcastTaskResultQueryRequest() {} + +std::string PodcastTaskResultQueryRequest::getAppId() const { + return appId_; +} + +void PodcastTaskResultQueryRequest::setAppId(const std::string &appId) { + appId_ = appId; + setBodyParameter(std::string("appId"), appId); +} + +std::string PodcastTaskResultQueryRequest::getTaskId() const { + return taskId_; +} + +void PodcastTaskResultQueryRequest::setTaskId(const std::string &taskId) { + taskId_ = taskId; + setBodyParameter(std::string("taskId"), taskId); +} + +std::string PodcastTaskResultQueryRequest::getWorkspaceId() const { + return workspaceId_; +} + +void PodcastTaskResultQueryRequest::setWorkspaceId(const std::string &workspaceId) { + workspaceId_ = workspaceId; + setBodyParameter(std::string("workspaceId"), workspaceId); +} + diff --git a/aipodcast/src/model/PodcastTaskResultQueryResult.cc b/aipodcast/src/model/PodcastTaskResultQueryResult.cc new file mode 100644 index 000000000..450d5e3c0 --- /dev/null +++ b/aipodcast/src/model/PodcastTaskResultQueryResult.cc @@ -0,0 +1,44 @@ +/* + * 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::AIPodcast; +using namespace AlibabaCloud::AIPodcast::Model; + +PodcastTaskResultQueryResult::PodcastTaskResultQueryResult() : + ServiceResult() +{} + +PodcastTaskResultQueryResult::PodcastTaskResultQueryResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +PodcastTaskResultQueryResult::~PodcastTaskResultQueryResult() +{} + +void PodcastTaskResultQueryResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/aipodcast/src/model/PodcastTaskSubmitRequest.cc b/aipodcast/src/model/PodcastTaskSubmitRequest.cc new file mode 100644 index 000000000..ad50f1d5d --- /dev/null +++ b/aipodcast/src/model/PodcastTaskSubmitRequest.cc @@ -0,0 +1,122 @@ +/* + * 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::AIPodcast::Model::PodcastTaskSubmitRequest; + +PodcastTaskSubmitRequest::PodcastTaskSubmitRequest() + : RoaServiceRequest("aipodcast", "2025-02-28") { + setResourcePath("/podcast/task/submit"}; + setMethod(HttpRequest::Method::Post); +} + +PodcastTaskSubmitRequest::~PodcastTaskSubmitRequest() {} + +std::string PodcastTaskSubmitRequest::getAtmosphere() const { + return atmosphere_; +} + +void PodcastTaskSubmitRequest::setAtmosphere(const std::string &atmosphere) { + atmosphere_ = atmosphere; + setBodyParameter(std::string("atmosphere"), atmosphere); +} + +std::string PodcastTaskSubmitRequest::getSourceLang() const { + return sourceLang_; +} + +void PodcastTaskSubmitRequest::setSourceLang(const std::string &sourceLang) { + sourceLang_ = sourceLang; + setBodyParameter(std::string("sourceLang"), sourceLang); +} + +int PodcastTaskSubmitRequest::getCounts() const { + return counts_; +} + +void PodcastTaskSubmitRequest::setCounts(int counts) { + counts_ = counts; + setBodyParameter(std::string("counts"), std::to_string(counts)); +} + +std::vector PodcastTaskSubmitRequest::getFileUrls() const { + return fileUrls_; +} + +void PodcastTaskSubmitRequest::setFileUrls(const std::vector &fileUrls) { + fileUrls_ = fileUrls; + for(int dep1 = 0; dep1 != fileUrls.size(); dep1++) { + setBodyParameter(std::string("fileUrls") + "." + std::to_string(dep1 + 1), fileUrls[dep1]); + } +} + +std::string PodcastTaskSubmitRequest::getText() const { + return text_; +} + +void PodcastTaskSubmitRequest::setText(const std::string &text) { + text_ = text; + setBodyParameter(std::string("text"), text); +} + +std::vector PodcastTaskSubmitRequest::getVoices() const { + return voices_; +} + +void PodcastTaskSubmitRequest::setVoices(const std::vector &voices) { + voices_ = voices; + for(int dep1 = 0; dep1 != voices.size(); dep1++) { + setBodyParameter(std::string("voices") + "." + std::to_string(dep1 + 1), voices[dep1]); + } +} + +std::string PodcastTaskSubmitRequest::getAppId() const { + return appId_; +} + +void PodcastTaskSubmitRequest::setAppId(const std::string &appId) { + appId_ = appId; + setBodyParameter(std::string("appId"), appId); +} + +std::string PodcastTaskSubmitRequest::getTopic() const { + return topic_; +} + +void PodcastTaskSubmitRequest::setTopic(const std::string &topic) { + topic_ = topic; + setBodyParameter(std::string("topic"), topic); +} + +std::string PodcastTaskSubmitRequest::getStyle() const { + return style_; +} + +void PodcastTaskSubmitRequest::setStyle(const std::string &style) { + style_ = style; + setBodyParameter(std::string("style"), style); +} + +std::string PodcastTaskSubmitRequest::getWorkspaceId() const { + return workspaceId_; +} + +void PodcastTaskSubmitRequest::setWorkspaceId(const std::string &workspaceId) { + workspaceId_ = workspaceId; + setBodyParameter(std::string("workspaceId"), workspaceId); +} + diff --git a/aipodcast/src/model/PodcastTaskSubmitResult.cc b/aipodcast/src/model/PodcastTaskSubmitResult.cc new file mode 100644 index 000000000..ef570a2ca --- /dev/null +++ b/aipodcast/src/model/PodcastTaskSubmitResult.cc @@ -0,0 +1,89 @@ +/* + * 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::AIPodcast; +using namespace AlibabaCloud::AIPodcast::Model; + +PodcastTaskSubmitResult::PodcastTaskSubmitResult() : + ServiceResult() +{} + +PodcastTaskSubmitResult::PodcastTaskSubmitResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +PodcastTaskSubmitResult::~PodcastTaskSubmitResult() +{} + +void PodcastTaskSubmitResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["data"]; + if(!dataNode["taskId"].isNull()) + data_.taskId = dataNode["taskId"].asString(); + if(!dataNode["taskStatus"].isNull()) + data_.taskStatus = dataNode["taskStatus"].asString(); + if(!value["code"].isNull()) + code_ = value["code"].asString(); + if(!value["message"].isNull()) + message_ = value["message"].asString(); + if(!value["requestId"].isNull()) + requestId_ = value["requestId"].asString(); + if(!value["success"].isNull()) + success_ = value["success"].asString() == "true"; + if(!value["httpStatusCode"].isNull()) + httpStatusCode_ = value["httpStatusCode"].asString(); + +} + +std::string PodcastTaskSubmitResult::getMessage()const +{ + return message_; +} + +std::string PodcastTaskSubmitResult::getRequestId()const +{ + return requestId_; +} + +std::string PodcastTaskSubmitResult::getHttpStatusCode()const +{ + return httpStatusCode_; +} + +PodcastTaskSubmitResult::Data PodcastTaskSubmitResult::getData()const +{ + return data_; +} + +std::string PodcastTaskSubmitResult::getCode()const +{ + return code_; +} + +bool PodcastTaskSubmitResult::getSuccess()const +{ + return success_; +} +