Skip to content

Commit 7f21cf8

Browse files
committedApr 2, 2025·
Generated 2025-02-28 for AIPodcast.
1 parent cf5863b commit 7f21cf8

13 files changed

+852
-1
lines changed
 

Diff for: ‎VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.36.2055
1+
1.36.2056

Diff for: ‎aipodcast/CMakeLists.txt

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#
2+
# Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
18+
19+
set(aipodcast_public_header
20+
include/alibabacloud/aipodcast/AIPodcastClient.h
21+
include/alibabacloud/aipodcast/AIPodcastExport.h )
22+
23+
set(aipodcast_public_header_model
24+
include/alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.h
25+
include/alibabacloud/aipodcast/model/PodcastTaskResultQueryResult.h
26+
include/alibabacloud/aipodcast/model/PodcastTaskSubmitRequest.h
27+
include/alibabacloud/aipodcast/model/PodcastTaskSubmitResult.h )
28+
29+
set(aipodcast_src
30+
src/AIPodcastClient.cc
31+
src/model/PodcastTaskResultQueryRequest.cc
32+
src/model/PodcastTaskResultQueryResult.cc
33+
src/model/PodcastTaskSubmitRequest.cc
34+
src/model/PodcastTaskSubmitResult.cc )
35+
36+
add_library(aipodcast ${LIB_TYPE}
37+
${aipodcast_public_header}
38+
${aipodcast_public_header_model}
39+
${aipodcast_src})
40+
41+
set_target_properties(aipodcast
42+
PROPERTIES
43+
LINKER_LANGUAGE CXX
44+
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
45+
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
46+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
47+
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}aipodcast
48+
)
49+
50+
if(${LIB_TYPE} STREQUAL "SHARED")
51+
set_target_properties(aipodcast
52+
PROPERTIES
53+
DEFINE_SYMBOL ALIBABACLOUD_AIPODCAST_LIBRARY)
54+
endif()
55+
56+
target_include_directories(aipodcast
57+
PRIVATE include
58+
${CMAKE_SOURCE_DIR}/core/include
59+
)
60+
target_link_libraries(aipodcast
61+
core)
62+
63+
if(CMAKE_HOST_WIN32)
64+
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
65+
set(jsoncpp_install_dir ${INSTALL_DIR})
66+
add_dependencies(aipodcast
67+
jsoncpp)
68+
target_include_directories(aipodcast
69+
PRIVATE ${jsoncpp_install_dir}/include)
70+
target_link_libraries(aipodcast
71+
${jsoncpp_install_dir}/lib/jsoncpp.lib)
72+
set_target_properties(aipodcast
73+
PROPERTIES
74+
COMPILE_OPTIONS "/bigobj")
75+
else()
76+
target_include_directories(aipodcast
77+
PRIVATE /usr/include/jsoncpp)
78+
target_link_libraries(aipodcast
79+
jsoncpp)
80+
endif()
81+
82+
install(FILES ${aipodcast_public_header}
83+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aipodcast)
84+
install(FILES ${aipodcast_public_header_model}
85+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aipodcast/model)
86+
install(TARGETS aipodcast
87+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
88+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
89+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
90+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_
18+
#define ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_
19+
20+
#include <future>
21+
#include <alibabacloud/core/AsyncCallerContext.h>
22+
#include <alibabacloud/core/EndpointProvider.h>
23+
#include <alibabacloud/core/RoaServiceClient.h>
24+
#include "AIPodcastExport.h"
25+
#include "model/PodcastTaskResultQueryRequest.h"
26+
#include "model/PodcastTaskResultQueryResult.h"
27+
#include "model/PodcastTaskSubmitRequest.h"
28+
#include "model/PodcastTaskSubmitResult.h"
29+
30+
31+
namespace AlibabaCloud
32+
{
33+
namespace AIPodcast
34+
{
35+
class ALIBABACLOUD_AIPODCAST_EXPORT AIPodcastClient : public RoaServiceClient
36+
{
37+
public:
38+
typedef Outcome<Error, Model::PodcastTaskResultQueryResult> PodcastTaskResultQueryOutcome;
39+
typedef std::future<PodcastTaskResultQueryOutcome> PodcastTaskResultQueryOutcomeCallable;
40+
typedef std::function<void(const AIPodcastClient*, const Model::PodcastTaskResultQueryRequest&, const PodcastTaskResultQueryOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PodcastTaskResultQueryAsyncHandler;
41+
typedef Outcome<Error, Model::PodcastTaskSubmitResult> PodcastTaskSubmitOutcome;
42+
typedef std::future<PodcastTaskSubmitOutcome> PodcastTaskSubmitOutcomeCallable;
43+
typedef std::function<void(const AIPodcastClient*, const Model::PodcastTaskSubmitRequest&, const PodcastTaskSubmitOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PodcastTaskSubmitAsyncHandler;
44+
45+
AIPodcastClient(const Credentials &credentials, const ClientConfiguration &configuration);
46+
AIPodcastClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
47+
AIPodcastClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
48+
~AIPodcastClient();
49+
PodcastTaskResultQueryOutcome podcastTaskResultQuery(const Model::PodcastTaskResultQueryRequest &request)const;
50+
void podcastTaskResultQueryAsync(const Model::PodcastTaskResultQueryRequest& request, const PodcastTaskResultQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
51+
PodcastTaskResultQueryOutcomeCallable podcastTaskResultQueryCallable(const Model::PodcastTaskResultQueryRequest& request) const;
52+
PodcastTaskSubmitOutcome podcastTaskSubmit(const Model::PodcastTaskSubmitRequest &request)const;
53+
void podcastTaskSubmitAsync(const Model::PodcastTaskSubmitRequest& request, const PodcastTaskSubmitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
54+
PodcastTaskSubmitOutcomeCallable podcastTaskSubmitCallable(const Model::PodcastTaskSubmitRequest& request) const;
55+
56+
private:
57+
std::shared_ptr<EndpointProvider> endpointProvider_;
58+
};
59+
}
60+
}
61+
62+
#endif // !ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_AIPODCAST_AIPODCASTEXPORT_H_
18+
#define ALIBABACLOUD_AIPODCAST_AIPODCASTEXPORT_H_
19+
20+
#include <alibabacloud/core/Global.h>
21+
22+
#if defined(ALIBABACLOUD_SHARED)
23+
# if defined(ALIBABACLOUD_AIPODCAST_LIBRARY)
24+
# define ALIBABACLOUD_AIPODCAST_EXPORT ALIBABACLOUD_DECL_EXPORT
25+
# else
26+
# define ALIBABACLOUD_AIPODCAST_EXPORT ALIBABACLOUD_DECL_IMPORT
27+
# endif
28+
#else
29+
# define ALIBABACLOUD_AIPODCAST_EXPORT
30+
#endif
31+
32+
#endif // !ALIBABACLOUD_AIPODCAST_AIPODCASTEXPORT_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_
18+
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_
19+
20+
#include <alibabacloud/aipodcast/AIPodcastExport.h>
21+
#include <alibabacloud/core/RoaServiceRequest.h>
22+
#include <string>
23+
#include <vector>
24+
#include <map>
25+
26+
namespace AlibabaCloud {
27+
namespace AIPodcast {
28+
namespace Model {
29+
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskResultQueryRequest : public RoaServiceRequest {
30+
public:
31+
PodcastTaskResultQueryRequest();
32+
~PodcastTaskResultQueryRequest();
33+
std::string getAppId() const;
34+
void setAppId(const std::string &appId);
35+
std::string getTaskId() const;
36+
void setTaskId(const std::string &taskId);
37+
std::string getWorkspaceId() const;
38+
void setWorkspaceId(const std::string &workspaceId);
39+
40+
private:
41+
std::string appId_;
42+
std::string taskId_;
43+
std::string workspaceId_;
44+
};
45+
} // namespace Model
46+
} // namespace AIPodcast
47+
} // namespace AlibabaCloud
48+
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_
18+
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_
19+
20+
#include <string>
21+
#include <vector>
22+
#include <utility>
23+
#include <alibabacloud/core/ServiceResult.h>
24+
#include <alibabacloud/aipodcast/AIPodcastExport.h>
25+
26+
namespace AlibabaCloud
27+
{
28+
namespace AIPodcast
29+
{
30+
namespace Model
31+
{
32+
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskResultQueryResult : public ServiceResult
33+
{
34+
public:
35+
36+
37+
PodcastTaskResultQueryResult();
38+
explicit PodcastTaskResultQueryResult(const std::string &payload);
39+
~PodcastTaskResultQueryResult();
40+
41+
protected:
42+
void parse(const std::string &payload);
43+
private:
44+
45+
};
46+
}
47+
}
48+
}
49+
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_
18+
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_
19+
20+
#include <alibabacloud/aipodcast/AIPodcastExport.h>
21+
#include <alibabacloud/core/RoaServiceRequest.h>
22+
#include <string>
23+
#include <vector>
24+
#include <map>
25+
26+
namespace AlibabaCloud {
27+
namespace AIPodcast {
28+
namespace Model {
29+
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskSubmitRequest : public RoaServiceRequest {
30+
public:
31+
PodcastTaskSubmitRequest();
32+
~PodcastTaskSubmitRequest();
33+
std::string getAtmosphere() const;
34+
void setAtmosphere(const std::string &atmosphere);
35+
std::string getSourceLang() const;
36+
void setSourceLang(const std::string &sourceLang);
37+
int getCounts() const;
38+
void setCounts(int counts);
39+
std::vector<std::string> getFileUrls() const;
40+
void setFileUrls(const std::vector<std::string> &fileUrls);
41+
std::string getText() const;
42+
void setText(const std::string &text);
43+
std::vector<std::string> getVoices() const;
44+
void setVoices(const std::vector<std::string> &voices);
45+
std::string getAppId() const;
46+
void setAppId(const std::string &appId);
47+
std::string getTopic() const;
48+
void setTopic(const std::string &topic);
49+
std::string getStyle() const;
50+
void setStyle(const std::string &style);
51+
std::string getWorkspaceId() const;
52+
void setWorkspaceId(const std::string &workspaceId);
53+
54+
private:
55+
std::string atmosphere_;
56+
std::string sourceLang_;
57+
int counts_;
58+
std::vector<std::string> fileUrls_;
59+
std::string text_;
60+
std::vector<std::string> voices_;
61+
std::string appId_;
62+
std::string topic_;
63+
std::string style_;
64+
std::string workspaceId_;
65+
};
66+
} // namespace Model
67+
} // namespace AIPodcast
68+
} // namespace AlibabaCloud
69+
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_
18+
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_
19+
20+
#include <string>
21+
#include <vector>
22+
#include <utility>
23+
#include <alibabacloud/core/ServiceResult.h>
24+
#include <alibabacloud/aipodcast/AIPodcastExport.h>
25+
26+
namespace AlibabaCloud
27+
{
28+
namespace AIPodcast
29+
{
30+
namespace Model
31+
{
32+
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskSubmitResult : public ServiceResult
33+
{
34+
public:
35+
struct Data
36+
{
37+
std::string taskId;
38+
std::string taskStatus;
39+
};
40+
41+
42+
PodcastTaskSubmitResult();
43+
explicit PodcastTaskSubmitResult(const std::string &payload);
44+
~PodcastTaskSubmitResult();
45+
std::string getMessage()const;
46+
std::string getRequestId()const;
47+
std::string getHttpStatusCode()const;
48+
Data getData()const;
49+
std::string getCode()const;
50+
bool getSuccess()const;
51+
52+
protected:
53+
void parse(const std::string &payload);
54+
private:
55+
std::string message_;
56+
std::string requestId_;
57+
std::string httpStatusCode_;
58+
Data data_;
59+
std::string code_;
60+
bool success_;
61+
62+
};
63+
}
64+
}
65+
}
66+
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_

Diff for: ‎aipodcast/src/AIPodcastClient.cc

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include <alibabacloud/aipodcast/AIPodcastClient.h>
18+
#include <alibabacloud/core/SimpleCredentialsProvider.h>
19+
20+
using namespace AlibabaCloud;
21+
using namespace AlibabaCloud::Location;
22+
using namespace AlibabaCloud::AIPodcast;
23+
using namespace AlibabaCloud::AIPodcast::Model;
24+
25+
namespace
26+
{
27+
const std::string SERVICE_NAME = "AIPodcast";
28+
}
29+
30+
AIPodcastClient::AIPodcastClient(const Credentials &credentials, const ClientConfiguration &configuration) :
31+
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
32+
{
33+
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
34+
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
35+
}
36+
37+
AIPodcastClient::AIPodcastClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
38+
RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
39+
{
40+
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
41+
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
42+
}
43+
44+
AIPodcastClient::AIPodcastClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
45+
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
46+
{
47+
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
48+
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
49+
}
50+
51+
AIPodcastClient::~AIPodcastClient()
52+
{}
53+
54+
AIPodcastClient::PodcastTaskResultQueryOutcome AIPodcastClient::podcastTaskResultQuery(const PodcastTaskResultQueryRequest &request) const
55+
{
56+
auto endpointOutcome = endpointProvider_->getEndpoint();
57+
if (!endpointOutcome.isSuccess())
58+
return PodcastTaskResultQueryOutcome(endpointOutcome.error());
59+
60+
auto outcome = makeRequest(endpointOutcome.result(), request);
61+
62+
if (outcome.isSuccess())
63+
return PodcastTaskResultQueryOutcome(PodcastTaskResultQueryResult(outcome.result()));
64+
else
65+
return PodcastTaskResultQueryOutcome(outcome.error());
66+
}
67+
68+
void AIPodcastClient::podcastTaskResultQueryAsync(const PodcastTaskResultQueryRequest& request, const PodcastTaskResultQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
69+
{
70+
auto fn = [this, request, handler, context]()
71+
{
72+
handler(this, request, podcastTaskResultQuery(request), context);
73+
};
74+
75+
asyncExecute(new Runnable(fn));
76+
}
77+
78+
AIPodcastClient::PodcastTaskResultQueryOutcomeCallable AIPodcastClient::podcastTaskResultQueryCallable(const PodcastTaskResultQueryRequest &request) const
79+
{
80+
auto task = std::make_shared<std::packaged_task<PodcastTaskResultQueryOutcome()>>(
81+
[this, request]()
82+
{
83+
return this->podcastTaskResultQuery(request);
84+
});
85+
86+
asyncExecute(new Runnable([task]() { (*task)(); }));
87+
return task->get_future();
88+
}
89+
90+
AIPodcastClient::PodcastTaskSubmitOutcome AIPodcastClient::podcastTaskSubmit(const PodcastTaskSubmitRequest &request) const
91+
{
92+
auto endpointOutcome = endpointProvider_->getEndpoint();
93+
if (!endpointOutcome.isSuccess())
94+
return PodcastTaskSubmitOutcome(endpointOutcome.error());
95+
96+
auto outcome = makeRequest(endpointOutcome.result(), request);
97+
98+
if (outcome.isSuccess())
99+
return PodcastTaskSubmitOutcome(PodcastTaskSubmitResult(outcome.result()));
100+
else
101+
return PodcastTaskSubmitOutcome(outcome.error());
102+
}
103+
104+
void AIPodcastClient::podcastTaskSubmitAsync(const PodcastTaskSubmitRequest& request, const PodcastTaskSubmitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
105+
{
106+
auto fn = [this, request, handler, context]()
107+
{
108+
handler(this, request, podcastTaskSubmit(request), context);
109+
};
110+
111+
asyncExecute(new Runnable(fn));
112+
}
113+
114+
AIPodcastClient::PodcastTaskSubmitOutcomeCallable AIPodcastClient::podcastTaskSubmitCallable(const PodcastTaskSubmitRequest &request) const
115+
{
116+
auto task = std::make_shared<std::packaged_task<PodcastTaskSubmitOutcome()>>(
117+
[this, request]()
118+
{
119+
return this->podcastTaskSubmit(request);
120+
});
121+
122+
asyncExecute(new Runnable([task]() { (*task)(); }));
123+
return task->get_future();
124+
}
125+

Diff for: ‎aipodcast/src/model/PodcastTaskResultQueryRequest.cc

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include <alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.h>
18+
19+
using AlibabaCloud::AIPodcast::Model::PodcastTaskResultQueryRequest;
20+
21+
PodcastTaskResultQueryRequest::PodcastTaskResultQueryRequest()
22+
: RoaServiceRequest("aipodcast", "2025-02-28") {
23+
setResourcePath("/podcast/task"};
24+
setMethod(HttpRequest::Method::Post);
25+
}
26+
27+
PodcastTaskResultQueryRequest::~PodcastTaskResultQueryRequest() {}
28+
29+
std::string PodcastTaskResultQueryRequest::getAppId() const {
30+
return appId_;
31+
}
32+
33+
void PodcastTaskResultQueryRequest::setAppId(const std::string &appId) {
34+
appId_ = appId;
35+
setBodyParameter(std::string("appId"), appId);
36+
}
37+
38+
std::string PodcastTaskResultQueryRequest::getTaskId() const {
39+
return taskId_;
40+
}
41+
42+
void PodcastTaskResultQueryRequest::setTaskId(const std::string &taskId) {
43+
taskId_ = taskId;
44+
setBodyParameter(std::string("taskId"), taskId);
45+
}
46+
47+
std::string PodcastTaskResultQueryRequest::getWorkspaceId() const {
48+
return workspaceId_;
49+
}
50+
51+
void PodcastTaskResultQueryRequest::setWorkspaceId(const std::string &workspaceId) {
52+
workspaceId_ = workspaceId;
53+
setBodyParameter(std::string("workspaceId"), workspaceId);
54+
}
55+

Diff for: ‎aipodcast/src/model/PodcastTaskResultQueryResult.cc

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include <alibabacloud/aipodcast/model/PodcastTaskResultQueryResult.h>
18+
#include <json/json.h>
19+
20+
using namespace AlibabaCloud::AIPodcast;
21+
using namespace AlibabaCloud::AIPodcast::Model;
22+
23+
PodcastTaskResultQueryResult::PodcastTaskResultQueryResult() :
24+
ServiceResult()
25+
{}
26+
27+
PodcastTaskResultQueryResult::PodcastTaskResultQueryResult(const std::string &payload) :
28+
ServiceResult()
29+
{
30+
parse(payload);
31+
}
32+
33+
PodcastTaskResultQueryResult::~PodcastTaskResultQueryResult()
34+
{}
35+
36+
void PodcastTaskResultQueryResult::parse(const std::string &payload)
37+
{
38+
Json::Reader reader;
39+
Json::Value value;
40+
reader.parse(payload, value);
41+
setRequestId(value["RequestId"].asString());
42+
43+
}
44+

Diff for: ‎aipodcast/src/model/PodcastTaskSubmitRequest.cc

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include <alibabacloud/aipodcast/model/PodcastTaskSubmitRequest.h>
18+
19+
using AlibabaCloud::AIPodcast::Model::PodcastTaskSubmitRequest;
20+
21+
PodcastTaskSubmitRequest::PodcastTaskSubmitRequest()
22+
: RoaServiceRequest("aipodcast", "2025-02-28") {
23+
setResourcePath("/podcast/task/submit"};
24+
setMethod(HttpRequest::Method::Post);
25+
}
26+
27+
PodcastTaskSubmitRequest::~PodcastTaskSubmitRequest() {}
28+
29+
std::string PodcastTaskSubmitRequest::getAtmosphere() const {
30+
return atmosphere_;
31+
}
32+
33+
void PodcastTaskSubmitRequest::setAtmosphere(const std::string &atmosphere) {
34+
atmosphere_ = atmosphere;
35+
setBodyParameter(std::string("atmosphere"), atmosphere);
36+
}
37+
38+
std::string PodcastTaskSubmitRequest::getSourceLang() const {
39+
return sourceLang_;
40+
}
41+
42+
void PodcastTaskSubmitRequest::setSourceLang(const std::string &sourceLang) {
43+
sourceLang_ = sourceLang;
44+
setBodyParameter(std::string("sourceLang"), sourceLang);
45+
}
46+
47+
int PodcastTaskSubmitRequest::getCounts() const {
48+
return counts_;
49+
}
50+
51+
void PodcastTaskSubmitRequest::setCounts(int counts) {
52+
counts_ = counts;
53+
setBodyParameter(std::string("counts"), std::to_string(counts));
54+
}
55+
56+
std::vector<PodcastTaskSubmitRequest::std::string> PodcastTaskSubmitRequest::getFileUrls() const {
57+
return fileUrls_;
58+
}
59+
60+
void PodcastTaskSubmitRequest::setFileUrls(const std::vector<PodcastTaskSubmitRequest::std::string> &fileUrls) {
61+
fileUrls_ = fileUrls;
62+
for(int dep1 = 0; dep1 != fileUrls.size(); dep1++) {
63+
setBodyParameter(std::string("fileUrls") + "." + std::to_string(dep1 + 1), fileUrls[dep1]);
64+
}
65+
}
66+
67+
std::string PodcastTaskSubmitRequest::getText() const {
68+
return text_;
69+
}
70+
71+
void PodcastTaskSubmitRequest::setText(const std::string &text) {
72+
text_ = text;
73+
setBodyParameter(std::string("text"), text);
74+
}
75+
76+
std::vector<PodcastTaskSubmitRequest::std::string> PodcastTaskSubmitRequest::getVoices() const {
77+
return voices_;
78+
}
79+
80+
void PodcastTaskSubmitRequest::setVoices(const std::vector<PodcastTaskSubmitRequest::std::string> &voices) {
81+
voices_ = voices;
82+
for(int dep1 = 0; dep1 != voices.size(); dep1++) {
83+
setBodyParameter(std::string("voices") + "." + std::to_string(dep1 + 1), voices[dep1]);
84+
}
85+
}
86+
87+
std::string PodcastTaskSubmitRequest::getAppId() const {
88+
return appId_;
89+
}
90+
91+
void PodcastTaskSubmitRequest::setAppId(const std::string &appId) {
92+
appId_ = appId;
93+
setBodyParameter(std::string("appId"), appId);
94+
}
95+
96+
std::string PodcastTaskSubmitRequest::getTopic() const {
97+
return topic_;
98+
}
99+
100+
void PodcastTaskSubmitRequest::setTopic(const std::string &topic) {
101+
topic_ = topic;
102+
setBodyParameter(std::string("topic"), topic);
103+
}
104+
105+
std::string PodcastTaskSubmitRequest::getStyle() const {
106+
return style_;
107+
}
108+
109+
void PodcastTaskSubmitRequest::setStyle(const std::string &style) {
110+
style_ = style;
111+
setBodyParameter(std::string("style"), style);
112+
}
113+
114+
std::string PodcastTaskSubmitRequest::getWorkspaceId() const {
115+
return workspaceId_;
116+
}
117+
118+
void PodcastTaskSubmitRequest::setWorkspaceId(const std::string &workspaceId) {
119+
workspaceId_ = workspaceId;
120+
setBodyParameter(std::string("workspaceId"), workspaceId);
121+
}
122+

Diff for: ‎aipodcast/src/model/PodcastTaskSubmitResult.cc

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include <alibabacloud/aipodcast/model/PodcastTaskSubmitResult.h>
18+
#include <json/json.h>
19+
20+
using namespace AlibabaCloud::AIPodcast;
21+
using namespace AlibabaCloud::AIPodcast::Model;
22+
23+
PodcastTaskSubmitResult::PodcastTaskSubmitResult() :
24+
ServiceResult()
25+
{}
26+
27+
PodcastTaskSubmitResult::PodcastTaskSubmitResult(const std::string &payload) :
28+
ServiceResult()
29+
{
30+
parse(payload);
31+
}
32+
33+
PodcastTaskSubmitResult::~PodcastTaskSubmitResult()
34+
{}
35+
36+
void PodcastTaskSubmitResult::parse(const std::string &payload)
37+
{
38+
Json::Reader reader;
39+
Json::Value value;
40+
reader.parse(payload, value);
41+
setRequestId(value["RequestId"].asString());
42+
auto dataNode = value["data"];
43+
if(!dataNode["taskId"].isNull())
44+
data_.taskId = dataNode["taskId"].asString();
45+
if(!dataNode["taskStatus"].isNull())
46+
data_.taskStatus = dataNode["taskStatus"].asString();
47+
if(!value["code"].isNull())
48+
code_ = value["code"].asString();
49+
if(!value["message"].isNull())
50+
message_ = value["message"].asString();
51+
if(!value["requestId"].isNull())
52+
requestId_ = value["requestId"].asString();
53+
if(!value["success"].isNull())
54+
success_ = value["success"].asString() == "true";
55+
if(!value["httpStatusCode"].isNull())
56+
httpStatusCode_ = value["httpStatusCode"].asString();
57+
58+
}
59+
60+
std::string PodcastTaskSubmitResult::getMessage()const
61+
{
62+
return message_;
63+
}
64+
65+
std::string PodcastTaskSubmitResult::getRequestId()const
66+
{
67+
return requestId_;
68+
}
69+
70+
std::string PodcastTaskSubmitResult::getHttpStatusCode()const
71+
{
72+
return httpStatusCode_;
73+
}
74+
75+
PodcastTaskSubmitResult::Data PodcastTaskSubmitResult::getData()const
76+
{
77+
return data_;
78+
}
79+
80+
std::string PodcastTaskSubmitResult::getCode()const
81+
{
82+
return code_;
83+
}
84+
85+
bool PodcastTaskSubmitResult::getSuccess()const
86+
{
87+
return success_;
88+
}
89+

0 commit comments

Comments
 (0)
Please sign in to comment.