Automatically generate sdk tasks.
This commit is contained in:
86
wfts/CMakeLists.txt
Normal file
86
wfts/CMakeLists.txt
Normal file
@@ -0,0 +1,86 @@
|
||||
#
|
||||
# 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(wfts_public_header
|
||||
include/alibabacloud/wfts/WftsClient.h
|
||||
include/alibabacloud/wfts/WftsExport.h )
|
||||
|
||||
set(wfts_public_header_model
|
||||
include/alibabacloud/wfts/model/GetLjxAccountInfoRequest.h
|
||||
include/alibabacloud/wfts/model/GetLjxAccountInfoResult.h )
|
||||
|
||||
set(wfts_src
|
||||
src/WftsClient.cc
|
||||
src/model/GetLjxAccountInfoRequest.cc
|
||||
src/model/GetLjxAccountInfoResult.cc )
|
||||
|
||||
add_library(wfts ${LIB_TYPE}
|
||||
${wfts_public_header}
|
||||
${wfts_public_header_model}
|
||||
${wfts_src})
|
||||
|
||||
set_target_properties(wfts
|
||||
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}wfts
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(wfts
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_WFTS_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(wfts
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(wfts
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(wfts
|
||||
jsoncpp)
|
||||
target_include_directories(wfts
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(wfts
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(wfts
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(wfts
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(wfts
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${wfts_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/wfts)
|
||||
install(FILES ${wfts_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/wfts/model)
|
||||
install(TARGETS wfts
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
54
wfts/include/alibabacloud/wfts/WftsClient.h
Normal file
54
wfts/include/alibabacloud/wfts/WftsClient.h
Normal file
@@ -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_WFTS_WFTSCLIENT_H_
|
||||
#define ALIBABACLOUD_WFTS_WFTSCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RoaServiceClient.h>
|
||||
#include "WftsExport.h"
|
||||
#include "model/GetLjxAccountInfoRequest.h"
|
||||
#include "model/GetLjxAccountInfoResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Wfts
|
||||
{
|
||||
class ALIBABACLOUD_WFTS_EXPORT WftsClient : public RoaServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::GetLjxAccountInfoResult> GetLjxAccountInfoOutcome;
|
||||
typedef std::future<GetLjxAccountInfoOutcome> GetLjxAccountInfoOutcomeCallable;
|
||||
typedef std::function<void(const WftsClient*, const Model::GetLjxAccountInfoRequest&, const GetLjxAccountInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetLjxAccountInfoAsyncHandler;
|
||||
|
||||
WftsClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
WftsClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
WftsClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~WftsClient();
|
||||
GetLjxAccountInfoOutcome getLjxAccountInfo(const Model::GetLjxAccountInfoRequest &request)const;
|
||||
void getLjxAccountInfoAsync(const Model::GetLjxAccountInfoRequest& request, const GetLjxAccountInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetLjxAccountInfoOutcomeCallable getLjxAccountInfoCallable(const Model::GetLjxAccountInfoRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_WFTS_WFTSCLIENT_H_
|
||||
32
wfts/include/alibabacloud/wfts/WftsExport.h
Normal file
32
wfts/include/alibabacloud/wfts/WftsExport.h
Normal file
@@ -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_WFTS_WFTSEXPORT_H_
|
||||
#define ALIBABACLOUD_WFTS_WFTSEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_WFTS_LIBRARY)
|
||||
# define ALIBABACLOUD_WFTS_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_WFTS_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_WFTS_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_WFTS_WFTSEXPORT_H_
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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_WFTS_MODEL_GETLJXACCOUNTINFOREQUEST_H_
|
||||
#define ALIBABACLOUD_WFTS_MODEL_GETLJXACCOUNTINFOREQUEST_H_
|
||||
|
||||
#include <alibabacloud/wfts/WftsExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Wfts {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_WFTS_EXPORT GetLjxAccountInfoRequest : public RoaServiceRequest {
|
||||
public:
|
||||
GetLjxAccountInfoRequest();
|
||||
~GetLjxAccountInfoRequest();
|
||||
string getLjxAccountInfoId() const;
|
||||
void setLjxAccountInfoId(string ljxAccountInfoId);
|
||||
|
||||
private:
|
||||
string ljxAccountInfoId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Wfts
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_WFTS_MODEL_GETLJXACCOUNTINFOREQUEST_H_
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_WFTS_MODEL_GETLJXACCOUNTINFORESULT_H_
|
||||
#define ALIBABACLOUD_WFTS_MODEL_GETLJXACCOUNTINFORESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/wfts/WftsExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Wfts
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_WFTS_EXPORT GetLjxAccountInfoResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
GetLjxAccountInfoResult();
|
||||
explicit GetLjxAccountInfoResult(const std::string &payload);
|
||||
~GetLjxAccountInfoResult();
|
||||
std::string getRequestId()const;
|
||||
std::string getLjxAccountInfoId()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string requestId_;
|
||||
std::string ljxAccountInfoId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_WFTS_MODEL_GETLJXACCOUNTINFORESULT_H_
|
||||
89
wfts/src/WftsClient.cc
Normal file
89
wfts/src/WftsClient.cc
Normal file
@@ -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 <alibabacloud/wfts/WftsClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Wfts;
|
||||
using namespace AlibabaCloud::Wfts::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "Wfts";
|
||||
}
|
||||
|
||||
WftsClient::WftsClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
WftsClient::WftsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
WftsClient::WftsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
WftsClient::~WftsClient()
|
||||
{}
|
||||
|
||||
WftsClient::GetLjxAccountInfoOutcome WftsClient::getLjxAccountInfo(const GetLjxAccountInfoRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetLjxAccountInfoOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetLjxAccountInfoOutcome(GetLjxAccountInfoResult(outcome.result()));
|
||||
else
|
||||
return GetLjxAccountInfoOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WftsClient::getLjxAccountInfoAsync(const GetLjxAccountInfoRequest& request, const GetLjxAccountInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getLjxAccountInfo(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WftsClient::GetLjxAccountInfoOutcomeCallable WftsClient::getLjxAccountInfoCallable(const GetLjxAccountInfoRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetLjxAccountInfoOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getLjxAccountInfo(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
37
wfts/src/model/GetLjxAccountInfoRequest.cc
Normal file
37
wfts/src/model/GetLjxAccountInfoRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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 <alibabacloud/wfts/model/GetLjxAccountInfoRequest.h>
|
||||
|
||||
using AlibabaCloud::Wfts::Model::GetLjxAccountInfoRequest;
|
||||
|
||||
GetLjxAccountInfoRequest::GetLjxAccountInfoRequest()
|
||||
: RoaServiceRequest("wfts", "2022-02-12") {
|
||||
setResourcePath("/get/ljx/acc"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
GetLjxAccountInfoRequest::~GetLjxAccountInfoRequest() {}
|
||||
|
||||
string GetLjxAccountInfoRequest::getLjxAccountInfoId() const {
|
||||
return ljxAccountInfoId_;
|
||||
}
|
||||
|
||||
void GetLjxAccountInfoRequest::setLjxAccountInfoId(string ljxAccountInfoId) {
|
||||
ljxAccountInfoId_ = ljxAccountInfoId;
|
||||
setParameter(std::string("LjxAccountInfoId"), std::to_string(ljxAccountInfoId));
|
||||
}
|
||||
|
||||
58
wfts/src/model/GetLjxAccountInfoResult.cc
Normal file
58
wfts/src/model/GetLjxAccountInfoResult.cc
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/wfts/model/GetLjxAccountInfoResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Wfts;
|
||||
using namespace AlibabaCloud::Wfts::Model;
|
||||
|
||||
GetLjxAccountInfoResult::GetLjxAccountInfoResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetLjxAccountInfoResult::GetLjxAccountInfoResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetLjxAccountInfoResult::~GetLjxAccountInfoResult()
|
||||
{}
|
||||
|
||||
void GetLjxAccountInfoResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["LjxAccountInfoId"].isNull())
|
||||
ljxAccountInfoId_ = value["LjxAccountInfoId"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetLjxAccountInfoResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string GetLjxAccountInfoResult::getLjxAccountInfoId()const
|
||||
{
|
||||
return ljxAccountInfoId_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user