Supported C#.

This commit is contained in:
sdk-team
2024-07-26 10:24:10 +00:00
parent e762c1d057
commit 1b9c5d6a42
9 changed files with 537 additions and 1 deletions

View File

@@ -1 +1 @@
1.36.1959
1.36.1960

86
dybaseapi/CMakeLists.txt Normal file
View 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(dybaseapi_public_header
include/alibabacloud/dybaseapi/DybaseapiClient.h
include/alibabacloud/dybaseapi/DybaseapiExport.h )
set(dybaseapi_public_header_model
include/alibabacloud/dybaseapi/model/QueryTokenForMnsQueueRequest.h
include/alibabacloud/dybaseapi/model/QueryTokenForMnsQueueResult.h )
set(dybaseapi_src
src/DybaseapiClient.cc
src/model/QueryTokenForMnsQueueRequest.cc
src/model/QueryTokenForMnsQueueResult.cc )
add_library(dybaseapi ${LIB_TYPE}
${dybaseapi_public_header}
${dybaseapi_public_header_model}
${dybaseapi_src})
set_target_properties(dybaseapi
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}dybaseapi
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(dybaseapi
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_DYBASEAPI_LIBRARY)
endif()
target_include_directories(dybaseapi
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(dybaseapi
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(dybaseapi
jsoncpp)
target_include_directories(dybaseapi
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(dybaseapi
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(dybaseapi
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(dybaseapi
PRIVATE /usr/include/jsoncpp)
target_link_libraries(dybaseapi
jsoncpp)
endif()
install(FILES ${dybaseapi_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/dybaseapi)
install(FILES ${dybaseapi_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/dybaseapi/model)
install(TARGETS dybaseapi
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View 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_DYBASEAPI_DYBASEAPICLIENT_H_
#define ALIBABACLOUD_DYBASEAPI_DYBASEAPICLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "DybaseapiExport.h"
#include "model/QueryTokenForMnsQueueRequest.h"
#include "model/QueryTokenForMnsQueueResult.h"
namespace AlibabaCloud
{
namespace Dybaseapi
{
class ALIBABACLOUD_DYBASEAPI_EXPORT DybaseapiClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::QueryTokenForMnsQueueResult> QueryTokenForMnsQueueOutcome;
typedef std::future<QueryTokenForMnsQueueOutcome> QueryTokenForMnsQueueOutcomeCallable;
typedef std::function<void(const DybaseapiClient*, const Model::QueryTokenForMnsQueueRequest&, const QueryTokenForMnsQueueOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryTokenForMnsQueueAsyncHandler;
DybaseapiClient(const Credentials &credentials, const ClientConfiguration &configuration);
DybaseapiClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
DybaseapiClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~DybaseapiClient();
QueryTokenForMnsQueueOutcome queryTokenForMnsQueue(const Model::QueryTokenForMnsQueueRequest &request)const;
void queryTokenForMnsQueueAsync(const Model::QueryTokenForMnsQueueRequest& request, const QueryTokenForMnsQueueAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryTokenForMnsQueueOutcomeCallable queryTokenForMnsQueueCallable(const Model::QueryTokenForMnsQueueRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_DYBASEAPI_DYBASEAPICLIENT_H_

View 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_DYBASEAPI_DYBASEAPIEXPORT_H_
#define ALIBABACLOUD_DYBASEAPI_DYBASEAPIEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_DYBASEAPI_LIBRARY)
# define ALIBABACLOUD_DYBASEAPI_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_DYBASEAPI_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_DYBASEAPI_EXPORT
#endif
#endif // !ALIBABACLOUD_DYBASEAPI_DYBASEAPIEXPORT_H_

View File

@@ -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_DYBASEAPI_MODEL_QUERYTOKENFORMNSQUEUEREQUEST_H_
#define ALIBABACLOUD_DYBASEAPI_MODEL_QUERYTOKENFORMNSQUEUEREQUEST_H_
#include <alibabacloud/dybaseapi/DybaseapiExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Dybaseapi {
namespace Model {
class ALIBABACLOUD_DYBASEAPI_EXPORT QueryTokenForMnsQueueRequest : public RpcServiceRequest {
public:
QueryTokenForMnsQueueRequest();
~QueryTokenForMnsQueueRequest();
std::string getQueueName() const;
void setQueueName(const std::string &queueName);
long getResourceOwnerId() const;
void setResourceOwnerId(long resourceOwnerId);
std::string getResourceOwnerAccount() const;
void setResourceOwnerAccount(const std::string &resourceOwnerAccount);
std::string getMessageType() const;
void setMessageType(const std::string &messageType);
long getOwnerId() const;
void setOwnerId(long ownerId);
std::string getAccessKeyId() const;
void setAccessKeyId(const std::string &accessKeyId);
private:
std::string queueName_;
long resourceOwnerId_;
std::string resourceOwnerAccount_;
std::string messageType_;
long ownerId_;
std::string accessKeyId_;
};
} // namespace Model
} // namespace Dybaseapi
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_DYBASEAPI_MODEL_QUERYTOKENFORMNSQUEUEREQUEST_H_

View File

@@ -0,0 +1,63 @@
/*
* 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_DYBASEAPI_MODEL_QUERYTOKENFORMNSQUEUERESULT_H_
#define ALIBABACLOUD_DYBASEAPI_MODEL_QUERYTOKENFORMNSQUEUERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dybaseapi/DybaseapiExport.h>
namespace AlibabaCloud
{
namespace Dybaseapi
{
namespace Model
{
class ALIBABACLOUD_DYBASEAPI_EXPORT QueryTokenForMnsQueueResult : public ServiceResult
{
public:
struct MessageTokenDTO
{
std::string securityToken;
std::string accessKeyId;
std::string accessKeySecret;
std::string createTime;
std::string expireTime;
};
QueryTokenForMnsQueueResult();
explicit QueryTokenForMnsQueueResult(const std::string &payload);
~QueryTokenForMnsQueueResult();
MessageTokenDTO getMessageTokenDTO()const;
std::string getMessage()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
MessageTokenDTO messageTokenDTO_;
std::string message_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_DYBASEAPI_MODEL_QUERYTOKENFORMNSQUEUERESULT_H_

View 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/dybaseapi/DybaseapiClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Dybaseapi;
using namespace AlibabaCloud::Dybaseapi::Model;
namespace
{
const std::string SERVICE_NAME = "Dybaseapi";
}
DybaseapiClient::DybaseapiClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(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, "");
}
DybaseapiClient::DybaseapiClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
DybaseapiClient::DybaseapiClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(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, "");
}
DybaseapiClient::~DybaseapiClient()
{}
DybaseapiClient::QueryTokenForMnsQueueOutcome DybaseapiClient::queryTokenForMnsQueue(const QueryTokenForMnsQueueRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return QueryTokenForMnsQueueOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return QueryTokenForMnsQueueOutcome(QueryTokenForMnsQueueResult(outcome.result()));
else
return QueryTokenForMnsQueueOutcome(outcome.error());
}
void DybaseapiClient::queryTokenForMnsQueueAsync(const QueryTokenForMnsQueueRequest& request, const QueryTokenForMnsQueueAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, queryTokenForMnsQueue(request), context);
};
asyncExecute(new Runnable(fn));
}
DybaseapiClient::QueryTokenForMnsQueueOutcomeCallable DybaseapiClient::queryTokenForMnsQueueCallable(const QueryTokenForMnsQueueRequest &request) const
{
auto task = std::make_shared<std::packaged_task<QueryTokenForMnsQueueOutcome()>>(
[this, request]()
{
return this->queryTokenForMnsQueue(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,81 @@
/*
* 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/dybaseapi/model/QueryTokenForMnsQueueRequest.h>
using AlibabaCloud::Dybaseapi::Model::QueryTokenForMnsQueueRequest;
QueryTokenForMnsQueueRequest::QueryTokenForMnsQueueRequest()
: RpcServiceRequest("dybaseapi", "2017-05-25", "QueryTokenForMnsQueue") {
setMethod(HttpRequest::Method::Post);
}
QueryTokenForMnsQueueRequest::~QueryTokenForMnsQueueRequest() {}
std::string QueryTokenForMnsQueueRequest::getQueueName() const {
return queueName_;
}
void QueryTokenForMnsQueueRequest::setQueueName(const std::string &queueName) {
queueName_ = queueName;
setParameter(std::string("QueueName"), queueName);
}
long QueryTokenForMnsQueueRequest::getResourceOwnerId() const {
return resourceOwnerId_;
}
void QueryTokenForMnsQueueRequest::setResourceOwnerId(long resourceOwnerId) {
resourceOwnerId_ = resourceOwnerId;
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
}
std::string QueryTokenForMnsQueueRequest::getResourceOwnerAccount() const {
return resourceOwnerAccount_;
}
void QueryTokenForMnsQueueRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
}
std::string QueryTokenForMnsQueueRequest::getMessageType() const {
return messageType_;
}
void QueryTokenForMnsQueueRequest::setMessageType(const std::string &messageType) {
messageType_ = messageType;
setParameter(std::string("MessageType"), messageType);
}
long QueryTokenForMnsQueueRequest::getOwnerId() const {
return ownerId_;
}
void QueryTokenForMnsQueueRequest::setOwnerId(long ownerId) {
ownerId_ = ownerId;
setParameter(std::string("OwnerId"), std::to_string(ownerId));
}
std::string QueryTokenForMnsQueueRequest::getAccessKeyId() const {
return accessKeyId_;
}
void QueryTokenForMnsQueueRequest::setAccessKeyId(const std::string &accessKeyId) {
accessKeyId_ = accessKeyId;
setParameter(std::string("AccessKeyId"), accessKeyId);
}

View File

@@ -0,0 +1,74 @@
/*
* 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/dybaseapi/model/QueryTokenForMnsQueueResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dybaseapi;
using namespace AlibabaCloud::Dybaseapi::Model;
QueryTokenForMnsQueueResult::QueryTokenForMnsQueueResult() :
ServiceResult()
{}
QueryTokenForMnsQueueResult::QueryTokenForMnsQueueResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
QueryTokenForMnsQueueResult::~QueryTokenForMnsQueueResult()
{}
void QueryTokenForMnsQueueResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto messageTokenDTONode = value["MessageTokenDTO"];
if(!messageTokenDTONode["AccessKeySecret"].isNull())
messageTokenDTO_.accessKeySecret = messageTokenDTONode["AccessKeySecret"].asString();
if(!messageTokenDTONode["ExpireTime"].isNull())
messageTokenDTO_.expireTime = messageTokenDTONode["ExpireTime"].asString();
if(!messageTokenDTONode["SecurityToken"].isNull())
messageTokenDTO_.securityToken = messageTokenDTONode["SecurityToken"].asString();
if(!messageTokenDTONode["AccessKeyId"].isNull())
messageTokenDTO_.accessKeyId = messageTokenDTONode["AccessKeyId"].asString();
if(!messageTokenDTONode["CreateTime"].isNull())
messageTokenDTO_.createTime = messageTokenDTONode["CreateTime"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
QueryTokenForMnsQueueResult::MessageTokenDTO QueryTokenForMnsQueueResult::getMessageTokenDTO()const
{
return messageTokenDTO_;
}
std::string QueryTokenForMnsQueueResult::getMessage()const
{
return message_;
}
std::string QueryTokenForMnsQueueResult::getCode()const
{
return code_;
}