XSPACE SDK Auto Released By xiaoyan.yan,Version:1.34.9
Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2019-03-12 Version: 1.34.9
|
||||
1, add agency infomation
|
||||
2, update sdk core resources
|
||||
|
||||
2018-12-20 Version: 1.34.8
|
||||
1, Sync CDN API.
|
||||
|
||||
|
||||
@@ -91,3 +91,5 @@ add_subdirectory(saf)
|
||||
add_subdirectory(arms)
|
||||
add_subdirectory(lubancloud)
|
||||
add_subdirectory(alimt)
|
||||
|
||||
add_subdirectory(xspace)
|
||||
90
xspace/CMakeLists.txt
Normal file
90
xspace/CMakeLists.txt
Normal file
@@ -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(xspace_public_header
|
||||
include/alibabacloud/xspace/XspaceClient.h
|
||||
include/alibabacloud/xspace/XspaceExport.h )
|
||||
|
||||
set(xspace_public_header_model
|
||||
include/alibabacloud/xspace/model/QueryCustomerByIdRequest.h
|
||||
include/alibabacloud/xspace/model/QueryCustomerByIdResult.h
|
||||
include/alibabacloud/xspace/model/QueryCustomerByPhoneRequest.h
|
||||
include/alibabacloud/xspace/model/QueryCustomerByPhoneResult.h )
|
||||
|
||||
set(xspace_src
|
||||
src/XspaceClient.cc
|
||||
src/model/QueryCustomerByIdRequest.cc
|
||||
src/model/QueryCustomerByIdResult.cc
|
||||
src/model/QueryCustomerByPhoneRequest.cc
|
||||
src/model/QueryCustomerByPhoneResult.cc )
|
||||
|
||||
add_library(xspace ${LIB_TYPE}
|
||||
${xspace_public_header}
|
||||
${xspace_public_header_model}
|
||||
${xspace_src})
|
||||
|
||||
set_target_properties(xspace
|
||||
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}xspace
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(xspace
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_XSPACE_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(xspace
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(xspace
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(xspace
|
||||
jsoncpp)
|
||||
target_include_directories(xspace
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(xspace
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(xspace
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(xspace
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(xspace
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${xspace_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/xspace)
|
||||
install(FILES ${xspace_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/xspace/model)
|
||||
install(TARGETS xspace
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
62
xspace/include/alibabacloud/xspace/XspaceClient.h
Normal file
62
xspace/include/alibabacloud/xspace/XspaceClient.h
Normal file
@@ -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_XSPACE_XSPACECLIENT_H_
|
||||
#define ALIBABACLOUD_XSPACE_XSPACECLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RoaServiceClient.h>
|
||||
#include "XspaceExport.h"
|
||||
#include "model/QueryCustomerByIdRequest.h"
|
||||
#include "model/QueryCustomerByIdResult.h"
|
||||
#include "model/QueryCustomerByPhoneRequest.h"
|
||||
#include "model/QueryCustomerByPhoneResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Xspace
|
||||
{
|
||||
class ALIBABACLOUD_XSPACE_EXPORT XspaceClient : public RoaServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::QueryCustomerByIdResult> QueryCustomerByIdOutcome;
|
||||
typedef std::future<QueryCustomerByIdOutcome> QueryCustomerByIdOutcomeCallable;
|
||||
typedef std::function<void(const XspaceClient*, const Model::QueryCustomerByIdRequest&, const QueryCustomerByIdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryCustomerByIdAsyncHandler;
|
||||
typedef Outcome<Error, Model::QueryCustomerByPhoneResult> QueryCustomerByPhoneOutcome;
|
||||
typedef std::future<QueryCustomerByPhoneOutcome> QueryCustomerByPhoneOutcomeCallable;
|
||||
typedef std::function<void(const XspaceClient*, const Model::QueryCustomerByPhoneRequest&, const QueryCustomerByPhoneOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryCustomerByPhoneAsyncHandler;
|
||||
|
||||
XspaceClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
XspaceClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
XspaceClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~XspaceClient();
|
||||
QueryCustomerByIdOutcome queryCustomerById(const Model::QueryCustomerByIdRequest &request)const;
|
||||
void queryCustomerByIdAsync(const Model::QueryCustomerByIdRequest& request, const QueryCustomerByIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryCustomerByIdOutcomeCallable queryCustomerByIdCallable(const Model::QueryCustomerByIdRequest& request) const;
|
||||
QueryCustomerByPhoneOutcome queryCustomerByPhone(const Model::QueryCustomerByPhoneRequest &request)const;
|
||||
void queryCustomerByPhoneAsync(const Model::QueryCustomerByPhoneRequest& request, const QueryCustomerByPhoneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryCustomerByPhoneOutcomeCallable queryCustomerByPhoneCallable(const Model::QueryCustomerByPhoneRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_XSPACE_XSPACECLIENT_H_
|
||||
32
xspace/include/alibabacloud/xspace/XspaceExport.h
Normal file
32
xspace/include/alibabacloud/xspace/XspaceExport.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_XSPACE_XSPACEEXPORT_H_
|
||||
#define ALIBABACLOUD_XSPACE_XSPACEEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_XSPACE_LIBRARY)
|
||||
# define ALIBABACLOUD_XSPACE_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_XSPACE_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_XSPACE_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_XSPACE_XSPACEEXPORT_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_XSPACE_MODEL_QUERYCUSTOMERBYIDREQUEST_H_
|
||||
#define ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYIDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <alibabacloud/xspace/XspaceExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Xspace
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_XSPACE_EXPORT QueryCustomerByIdRequest : public RoaServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
QueryCustomerByIdRequest();
|
||||
~QueryCustomerByIdRequest();
|
||||
|
||||
std::string getId()const;
|
||||
void setId(const std::string& id);
|
||||
|
||||
private:
|
||||
std::string id_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYIDREQUEST_H_
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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_XSPACE_MODEL_QUERYCUSTOMERBYIDRESULT_H_
|
||||
#define ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYIDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/xspace/XspaceExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Xspace
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_XSPACE_EXPORT QueryCustomerByIdResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct CustomizeFields
|
||||
{
|
||||
std::string abcUrl;
|
||||
std::vector<std::string> associatePersonList;
|
||||
std::string cid;
|
||||
};
|
||||
std::string email;
|
||||
std::string nick;
|
||||
std::string phone;
|
||||
CustomizeFields customizeFields;
|
||||
std::string photo;
|
||||
std::string id;
|
||||
std::string realName;
|
||||
std::string gender;
|
||||
std::string detail;
|
||||
std::vector<std::string> tags;
|
||||
};
|
||||
|
||||
|
||||
QueryCustomerByIdResult();
|
||||
explicit QueryCustomerByIdResult(const std::string &payload);
|
||||
~QueryCustomerByIdResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYIDRESULT_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_XSPACE_MODEL_QUERYCUSTOMERBYPHONEREQUEST_H_
|
||||
#define ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYPHONEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <alibabacloud/xspace/XspaceExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Xspace
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_XSPACE_EXPORT QueryCustomerByPhoneRequest : public RoaServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
QueryCustomerByPhoneRequest();
|
||||
~QueryCustomerByPhoneRequest();
|
||||
|
||||
std::string getPhone()const;
|
||||
void setPhone(const std::string& phone);
|
||||
|
||||
private:
|
||||
std::string phone_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYPHONEREQUEST_H_
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* 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_XSPACE_MODEL_QUERYCUSTOMERBYPHONERESULT_H_
|
||||
#define ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYPHONERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/xspace/XspaceExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Xspace
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_XSPACE_EXPORT QueryCustomerByPhoneResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataItem
|
||||
{
|
||||
struct CustomizeFields
|
||||
{
|
||||
std::string mainAccountUid;
|
||||
std::string abcUrl;
|
||||
std::vector<std::string> associatePersonList;
|
||||
std::string distributionLevel;
|
||||
std::string cid;
|
||||
};
|
||||
std::string email;
|
||||
std::string phone;
|
||||
std::string nick;
|
||||
CustomizeFields customizeFields;
|
||||
std::string photo;
|
||||
std::string id;
|
||||
std::string gender;
|
||||
std::string realName;
|
||||
std::string detail;
|
||||
std::vector<std::string> tags;
|
||||
};
|
||||
|
||||
|
||||
QueryCustomerByPhoneResult();
|
||||
explicit QueryCustomerByPhoneResult(const std::string &payload);
|
||||
~QueryCustomerByPhoneResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<DataItem> getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<DataItem> data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_XSPACE_MODEL_QUERYCUSTOMERBYPHONERESULT_H_
|
||||
125
xspace/src/XspaceClient.cc
Normal file
125
xspace/src/XspaceClient.cc
Normal file
@@ -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 <alibabacloud/xspace/XspaceClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Xspace;
|
||||
using namespace AlibabaCloud::Xspace::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "xspace";
|
||||
}
|
||||
|
||||
XspaceClient::XspaceClient(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, "");
|
||||
}
|
||||
|
||||
XspaceClient::XspaceClient(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, "");
|
||||
}
|
||||
|
||||
XspaceClient::XspaceClient(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, "");
|
||||
}
|
||||
|
||||
XspaceClient::~XspaceClient()
|
||||
{}
|
||||
|
||||
XspaceClient::QueryCustomerByIdOutcome XspaceClient::queryCustomerById(const QueryCustomerByIdRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryCustomerByIdOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryCustomerByIdOutcome(QueryCustomerByIdResult(outcome.result()));
|
||||
else
|
||||
return QueryCustomerByIdOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void XspaceClient::queryCustomerByIdAsync(const QueryCustomerByIdRequest& request, const QueryCustomerByIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryCustomerById(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
XspaceClient::QueryCustomerByIdOutcomeCallable XspaceClient::queryCustomerByIdCallable(const QueryCustomerByIdRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryCustomerByIdOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryCustomerById(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
XspaceClient::QueryCustomerByPhoneOutcome XspaceClient::queryCustomerByPhone(const QueryCustomerByPhoneRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryCustomerByPhoneOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryCustomerByPhoneOutcome(QueryCustomerByPhoneResult(outcome.result()));
|
||||
else
|
||||
return QueryCustomerByPhoneOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void XspaceClient::queryCustomerByPhoneAsync(const QueryCustomerByPhoneRequest& request, const QueryCustomerByPhoneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryCustomerByPhone(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
XspaceClient::QueryCustomerByPhoneOutcomeCallable XspaceClient::queryCustomerByPhoneCallable(const QueryCustomerByPhoneRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryCustomerByPhoneOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryCustomerByPhone(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
38
xspace/src/model/QueryCustomerByIdRequest.cc
Normal file
38
xspace/src/model/QueryCustomerByIdRequest.cc
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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/xspace/model/QueryCustomerByIdRequest.h>
|
||||
|
||||
using AlibabaCloud::Xspace::Model::QueryCustomerByIdRequest;
|
||||
|
||||
QueryCustomerByIdRequest::QueryCustomerByIdRequest() :
|
||||
RoaServiceRequest("xspace", "2017-07-20")
|
||||
{}
|
||||
|
||||
QueryCustomerByIdRequest::~QueryCustomerByIdRequest()
|
||||
{}
|
||||
|
||||
std::string QueryCustomerByIdRequest::getId()const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
void QueryCustomerByIdRequest::setId(const std::string& id)
|
||||
{
|
||||
id_ = id;
|
||||
setParameter("Id", id);
|
||||
}
|
||||
|
||||
99
xspace/src/model/QueryCustomerByIdResult.cc
Normal file
99
xspace/src/model/QueryCustomerByIdResult.cc
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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/xspace/model/QueryCustomerByIdResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Xspace;
|
||||
using namespace AlibabaCloud::Xspace::Model;
|
||||
|
||||
QueryCustomerByIdResult::QueryCustomerByIdResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryCustomerByIdResult::QueryCustomerByIdResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryCustomerByIdResult::~QueryCustomerByIdResult()
|
||||
{}
|
||||
|
||||
void QueryCustomerByIdResult::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["Id"].isNull())
|
||||
data_.id = dataNode["Id"].asString();
|
||||
if(!dataNode["Nick"].isNull())
|
||||
data_.nick = dataNode["Nick"].asString();
|
||||
if(!dataNode["RealName"].isNull())
|
||||
data_.realName = dataNode["RealName"].asString();
|
||||
if(!dataNode["Email"].isNull())
|
||||
data_.email = dataNode["Email"].asString();
|
||||
if(!dataNode["Phone"].isNull())
|
||||
data_.phone = dataNode["Phone"].asString();
|
||||
if(!dataNode["Gender"].isNull())
|
||||
data_.gender = dataNode["Gender"].asString();
|
||||
if(!dataNode["Photo"].isNull())
|
||||
data_.photo = dataNode["Photo"].asString();
|
||||
if(!dataNode["Detail"].isNull())
|
||||
data_.detail = dataNode["Detail"].asString();
|
||||
auto customizeFieldsNode = dataNode["CustomizeFields"];
|
||||
if(!customizeFieldsNode["Cid"].isNull())
|
||||
data_.customizeFields.cid = customizeFieldsNode["Cid"].asString();
|
||||
if(!customizeFieldsNode["AbcUrl"].isNull())
|
||||
data_.customizeFields.abcUrl = customizeFieldsNode["AbcUrl"].asString();
|
||||
auto allAssociatePersonList = customizeFieldsNode["AssociatePersonList"]["AssociatePersonList"];
|
||||
for (auto value : allAssociatePersonList)
|
||||
data_.customizeFields.associatePersonList.push_back(value.asString());
|
||||
auto allTags = dataNode["Tags"]["Tags"];
|
||||
for (auto value : allTags)
|
||||
data_.tags.push_back(value.asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string QueryCustomerByIdResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
QueryCustomerByIdResult::Data QueryCustomerByIdResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string QueryCustomerByIdResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool QueryCustomerByIdResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
38
xspace/src/model/QueryCustomerByPhoneRequest.cc
Normal file
38
xspace/src/model/QueryCustomerByPhoneRequest.cc
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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/xspace/model/QueryCustomerByPhoneRequest.h>
|
||||
|
||||
using AlibabaCloud::Xspace::Model::QueryCustomerByPhoneRequest;
|
||||
|
||||
QueryCustomerByPhoneRequest::QueryCustomerByPhoneRequest() :
|
||||
RoaServiceRequest("xspace", "2017-07-20")
|
||||
{}
|
||||
|
||||
QueryCustomerByPhoneRequest::~QueryCustomerByPhoneRequest()
|
||||
{}
|
||||
|
||||
std::string QueryCustomerByPhoneRequest::getPhone()const
|
||||
{
|
||||
return phone_;
|
||||
}
|
||||
|
||||
void QueryCustomerByPhoneRequest::setPhone(const std::string& phone)
|
||||
{
|
||||
phone_ = phone;
|
||||
setParameter("Phone", phone);
|
||||
}
|
||||
|
||||
108
xspace/src/model/QueryCustomerByPhoneResult.cc
Normal file
108
xspace/src/model/QueryCustomerByPhoneResult.cc
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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/xspace/model/QueryCustomerByPhoneResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Xspace;
|
||||
using namespace AlibabaCloud::Xspace::Model;
|
||||
|
||||
QueryCustomerByPhoneResult::QueryCustomerByPhoneResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryCustomerByPhoneResult::QueryCustomerByPhoneResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryCustomerByPhoneResult::~QueryCustomerByPhoneResult()
|
||||
{}
|
||||
|
||||
void QueryCustomerByPhoneResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"]["DataItem"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!value["Detail"].isNull())
|
||||
dataObject.detail = value["Detail"].asString();
|
||||
if(!value["Photo"].isNull())
|
||||
dataObject.photo = value["Photo"].asString();
|
||||
if(!value["Id"].isNull())
|
||||
dataObject.id = value["Id"].asString();
|
||||
if(!value["Phone"].isNull())
|
||||
dataObject.phone = value["Phone"].asString();
|
||||
if(!value["Gender"].isNull())
|
||||
dataObject.gender = value["Gender"].asString();
|
||||
if(!value["Email"].isNull())
|
||||
dataObject.email = value["Email"].asString();
|
||||
if(!value["Nick"].isNull())
|
||||
dataObject.nick = value["Nick"].asString();
|
||||
if(!value["RealName"].isNull())
|
||||
dataObject.realName = value["RealName"].asString();
|
||||
auto customizeFieldsNode = value["CustomizeFields"];
|
||||
if(!customizeFieldsNode["Cid"].isNull())
|
||||
dataObject.customizeFields.cid = customizeFieldsNode["Cid"].asString();
|
||||
if(!customizeFieldsNode["AbcUrl"].isNull())
|
||||
dataObject.customizeFields.abcUrl = customizeFieldsNode["AbcUrl"].asString();
|
||||
if(!customizeFieldsNode["DistributionLevel"].isNull())
|
||||
dataObject.customizeFields.distributionLevel = customizeFieldsNode["DistributionLevel"].asString();
|
||||
if(!customizeFieldsNode["MainAccountUid"].isNull())
|
||||
dataObject.customizeFields.mainAccountUid = customizeFieldsNode["MainAccountUid"].asString();
|
||||
auto allAssociatePersonList = customizeFieldsNode["AssociatePersonList"]["AssociatePersonList"];
|
||||
for (auto value : allAssociatePersonList)
|
||||
dataObject.customizeFields.associatePersonList.push_back(value.asString());
|
||||
auto allTags = value["Tags"]["Tags"];
|
||||
for (auto value : allTags)
|
||||
dataObject.tags.push_back(value.asString());
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string QueryCustomerByPhoneResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<QueryCustomerByPhoneResult::DataItem> QueryCustomerByPhoneResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string QueryCustomerByPhoneResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool QueryCustomerByPhoneResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user