Add GetGraphQueryTemplates.

This commit is contained in:
sdk-team
2023-07-24 01:51:58 +00:00
parent 140a213eec
commit 00e697671e
21 changed files with 1520 additions and 1 deletions

View File

@@ -1 +1 @@
1.36.1678
1.36.1679

98
sasti/CMakeLists.txt Normal file
View File

@@ -0,0 +1,98 @@
#
# 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(sasti_public_header
include/alibabacloud/sasti/SastiClient.h
include/alibabacloud/sasti/SastiExport.h )
set(sasti_public_header_model
include/alibabacloud/sasti/model/DescribeDomainReportRequest.h
include/alibabacloud/sasti/model/DescribeDomainReportResult.h
include/alibabacloud/sasti/model/DescribeFileReportRequest.h
include/alibabacloud/sasti/model/DescribeFileReportResult.h
include/alibabacloud/sasti/model/DescribeIpReportRequest.h
include/alibabacloud/sasti/model/DescribeIpReportResult.h
include/alibabacloud/sasti/model/GetGraphQueryTemplatesRequest.h
include/alibabacloud/sasti/model/GetGraphQueryTemplatesResult.h )
set(sasti_src
src/SastiClient.cc
src/model/DescribeDomainReportRequest.cc
src/model/DescribeDomainReportResult.cc
src/model/DescribeFileReportRequest.cc
src/model/DescribeFileReportResult.cc
src/model/DescribeIpReportRequest.cc
src/model/DescribeIpReportResult.cc
src/model/GetGraphQueryTemplatesRequest.cc
src/model/GetGraphQueryTemplatesResult.cc )
add_library(sasti ${LIB_TYPE}
${sasti_public_header}
${sasti_public_header_model}
${sasti_src})
set_target_properties(sasti
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}sasti
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(sasti
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_SASTI_LIBRARY)
endif()
target_include_directories(sasti
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(sasti
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(sasti
jsoncpp)
target_include_directories(sasti
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(sasti
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(sasti
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(sasti
PRIVATE /usr/include/jsoncpp)
target_link_libraries(sasti
jsoncpp)
endif()
install(FILES ${sasti_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/sasti)
install(FILES ${sasti_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/sasti/model)
install(TARGETS sasti
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -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_SASTI_SASTICLIENT_H_
#define ALIBABACLOUD_SASTI_SASTICLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "SastiExport.h"
#include "model/DescribeDomainReportRequest.h"
#include "model/DescribeDomainReportResult.h"
#include "model/DescribeFileReportRequest.h"
#include "model/DescribeFileReportResult.h"
#include "model/DescribeIpReportRequest.h"
#include "model/DescribeIpReportResult.h"
#include "model/GetGraphQueryTemplatesRequest.h"
#include "model/GetGraphQueryTemplatesResult.h"
namespace AlibabaCloud
{
namespace Sasti
{
class ALIBABACLOUD_SASTI_EXPORT SastiClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::DescribeDomainReportResult> DescribeDomainReportOutcome;
typedef std::future<DescribeDomainReportOutcome> DescribeDomainReportOutcomeCallable;
typedef std::function<void(const SastiClient*, const Model::DescribeDomainReportRequest&, const DescribeDomainReportOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeDomainReportAsyncHandler;
typedef Outcome<Error, Model::DescribeFileReportResult> DescribeFileReportOutcome;
typedef std::future<DescribeFileReportOutcome> DescribeFileReportOutcomeCallable;
typedef std::function<void(const SastiClient*, const Model::DescribeFileReportRequest&, const DescribeFileReportOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeFileReportAsyncHandler;
typedef Outcome<Error, Model::DescribeIpReportResult> DescribeIpReportOutcome;
typedef std::future<DescribeIpReportOutcome> DescribeIpReportOutcomeCallable;
typedef std::function<void(const SastiClient*, const Model::DescribeIpReportRequest&, const DescribeIpReportOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeIpReportAsyncHandler;
typedef Outcome<Error, Model::GetGraphQueryTemplatesResult> GetGraphQueryTemplatesOutcome;
typedef std::future<GetGraphQueryTemplatesOutcome> GetGraphQueryTemplatesOutcomeCallable;
typedef std::function<void(const SastiClient*, const Model::GetGraphQueryTemplatesRequest&, const GetGraphQueryTemplatesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetGraphQueryTemplatesAsyncHandler;
SastiClient(const Credentials &credentials, const ClientConfiguration &configuration);
SastiClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
SastiClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~SastiClient();
DescribeDomainReportOutcome describeDomainReport(const Model::DescribeDomainReportRequest &request)const;
void describeDomainReportAsync(const Model::DescribeDomainReportRequest& request, const DescribeDomainReportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeDomainReportOutcomeCallable describeDomainReportCallable(const Model::DescribeDomainReportRequest& request) const;
DescribeFileReportOutcome describeFileReport(const Model::DescribeFileReportRequest &request)const;
void describeFileReportAsync(const Model::DescribeFileReportRequest& request, const DescribeFileReportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeFileReportOutcomeCallable describeFileReportCallable(const Model::DescribeFileReportRequest& request) const;
DescribeIpReportOutcome describeIpReport(const Model::DescribeIpReportRequest &request)const;
void describeIpReportAsync(const Model::DescribeIpReportRequest& request, const DescribeIpReportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeIpReportOutcomeCallable describeIpReportCallable(const Model::DescribeIpReportRequest& request) const;
GetGraphQueryTemplatesOutcome getGraphQueryTemplates(const Model::GetGraphQueryTemplatesRequest &request)const;
void getGraphQueryTemplatesAsync(const Model::GetGraphQueryTemplatesRequest& request, const GetGraphQueryTemplatesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetGraphQueryTemplatesOutcomeCallable getGraphQueryTemplatesCallable(const Model::GetGraphQueryTemplatesRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_SASTI_SASTICLIENT_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_SASTI_SASTIEXPORT_H_
#define ALIBABACLOUD_SASTI_SASTIEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_SASTI_LIBRARY)
# define ALIBABACLOUD_SASTI_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_SASTI_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_SASTI_EXPORT
#endif
#endif // !ALIBABACLOUD_SASTI_SASTIEXPORT_H_

View File

@@ -0,0 +1,51 @@
/*
* 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_SASTI_MODEL_DESCRIBEDOMAINREPORTREQUEST_H_
#define ALIBABACLOUD_SASTI_MODEL_DESCRIBEDOMAINREPORTREQUEST_H_
#include <alibabacloud/sasti/SastiExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Sasti {
namespace Model {
class ALIBABACLOUD_SASTI_EXPORT DescribeDomainReportRequest : public RpcServiceRequest {
public:
DescribeDomainReportRequest();
~DescribeDomainReportRequest();
std::string getSourceIp() const;
void setSourceIp(const std::string &sourceIp);
std::string getField() const;
void setField(const std::string &field);
std::string getDomain() const;
void setDomain(const std::string &domain);
std::string getServiceLang() const;
void setServiceLang(const std::string &serviceLang);
private:
std::string sourceIp_;
std::string field_;
std::string domain_;
std::string serviceLang_;
};
} // namespace Model
} // namespace Sasti
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_SASTI_MODEL_DESCRIBEDOMAINREPORTREQUEST_H_

View File

@@ -0,0 +1,75 @@
/*
* 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_SASTI_MODEL_DESCRIBEDOMAINREPORTRESULT_H_
#define ALIBABACLOUD_SASTI_MODEL_DESCRIBEDOMAINREPORTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/sasti/SastiExport.h>
namespace AlibabaCloud
{
namespace Sasti
{
namespace Model
{
class ALIBABACLOUD_SASTI_EXPORT DescribeDomainReportResult : public ServiceResult
{
public:
DescribeDomainReportResult();
explicit DescribeDomainReportResult(const std::string &payload);
~DescribeDomainReportResult();
std::string getContext()const;
std::string getBasic()const;
std::string getGroup()const;
std::string getSslCert()const;
std::string getThreatTypes()const;
std::string getIntelligences()const;
std::string getScenario()const;
std::string getAttackCntByThreatType()const;
std::string getWhois()const;
std::string getThreatLevel()const;
std::string getConfidence()const;
std::string getDomain()const;
std::string getAttackPreferenceTop5()const;
protected:
void parse(const std::string &payload);
private:
std::string context_;
std::string basic_;
std::string group_;
std::string sslCert_;
std::string threatTypes_;
std::string intelligences_;
std::string scenario_;
std::string attackCntByThreatType_;
std::string whois_;
std::string threatLevel_;
std::string confidence_;
std::string domain_;
std::string attackPreferenceTop5_;
};
}
}
}
#endif // !ALIBABACLOUD_SASTI_MODEL_DESCRIBEDOMAINREPORTRESULT_H_

View File

@@ -0,0 +1,51 @@
/*
* 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_SASTI_MODEL_DESCRIBEFILEREPORTREQUEST_H_
#define ALIBABACLOUD_SASTI_MODEL_DESCRIBEFILEREPORTREQUEST_H_
#include <alibabacloud/sasti/SastiExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Sasti {
namespace Model {
class ALIBABACLOUD_SASTI_EXPORT DescribeFileReportRequest : public RpcServiceRequest {
public:
DescribeFileReportRequest();
~DescribeFileReportRequest();
std::string getSourceIp() const;
void setSourceIp(const std::string &sourceIp);
std::string getField() const;
void setField(const std::string &field);
std::string getServiceLang() const;
void setServiceLang(const std::string &serviceLang);
std::string getFileHash() const;
void setFileHash(const std::string &fileHash);
private:
std::string sourceIp_;
std::string field_;
std::string serviceLang_;
std::string fileHash_;
};
} // namespace Model
} // namespace Sasti
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_SASTI_MODEL_DESCRIBEFILEREPORTREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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_SASTI_MODEL_DESCRIBEFILEREPORTRESULT_H_
#define ALIBABACLOUD_SASTI_MODEL_DESCRIBEFILEREPORTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/sasti/SastiExport.h>
namespace AlibabaCloud
{
namespace Sasti
{
namespace Model
{
class ALIBABACLOUD_SASTI_EXPORT DescribeFileReportResult : public ServiceResult
{
public:
DescribeFileReportResult();
explicit DescribeFileReportResult(const std::string &payload);
~DescribeFileReportResult();
std::string getBasic()const;
std::string getThreatLevel()const;
std::string getFileHash()const;
std::string getThreatTypes()const;
std::string getIntelligences()const;
std::string getSandbox()const;
protected:
void parse(const std::string &payload);
private:
std::string basic_;
std::string threatLevel_;
std::string fileHash_;
std::string threatTypes_;
std::string intelligences_;
std::string sandbox_;
};
}
}
}
#endif // !ALIBABACLOUD_SASTI_MODEL_DESCRIBEFILEREPORTRESULT_H_

View File

@@ -0,0 +1,51 @@
/*
* 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_SASTI_MODEL_DESCRIBEIPREPORTREQUEST_H_
#define ALIBABACLOUD_SASTI_MODEL_DESCRIBEIPREPORTREQUEST_H_
#include <alibabacloud/sasti/SastiExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Sasti {
namespace Model {
class ALIBABACLOUD_SASTI_EXPORT DescribeIpReportRequest : public RpcServiceRequest {
public:
DescribeIpReportRequest();
~DescribeIpReportRequest();
std::string getSourceIp() const;
void setSourceIp(const std::string &sourceIp);
std::string getIp() const;
void setIp(const std::string &ip);
std::string getField() const;
void setField(const std::string &field);
std::string getServiceLang() const;
void setServiceLang(const std::string &serviceLang);
private:
std::string sourceIp_;
std::string ip_;
std::string field_;
std::string serviceLang_;
};
} // namespace Model
} // namespace Sasti
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_SASTI_MODEL_DESCRIBEIPREPORTREQUEST_H_

View File

@@ -0,0 +1,71 @@
/*
* 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_SASTI_MODEL_DESCRIBEIPREPORTRESULT_H_
#define ALIBABACLOUD_SASTI_MODEL_DESCRIBEIPREPORTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/sasti/SastiExport.h>
namespace AlibabaCloud
{
namespace Sasti
{
namespace Model
{
class ALIBABACLOUD_SASTI_EXPORT DescribeIpReportResult : public ServiceResult
{
public:
DescribeIpReportResult();
explicit DescribeIpReportResult(const std::string &payload);
~DescribeIpReportResult();
std::string getContext()const;
std::string getGroup()const;
std::string getWhois()const;
std::string getAttackCntByThreatType()const;
std::string getThreatLevel()const;
std::string getConfidence()const;
std::string getIp()const;
std::string getThreatTypes()const;
std::string getIntelligences()const;
std::string getAttackPreferenceTop5()const;
std::string getScenario()const;
protected:
void parse(const std::string &payload);
private:
std::string context_;
std::string group_;
std::string whois_;
std::string attackCntByThreatType_;
std::string threatLevel_;
std::string confidence_;
std::string ip_;
std::string threatTypes_;
std::string intelligences_;
std::string attackPreferenceTop5_;
std::string scenario_;
};
}
}
}
#endif // !ALIBABACLOUD_SASTI_MODEL_DESCRIBEIPREPORTRESULT_H_

View File

@@ -0,0 +1,45 @@
/*
* 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_SASTI_MODEL_GETGRAPHQUERYTEMPLATESREQUEST_H_
#define ALIBABACLOUD_SASTI_MODEL_GETGRAPHQUERYTEMPLATESREQUEST_H_
#include <alibabacloud/sasti/SastiExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Sasti {
namespace Model {
class ALIBABACLOUD_SASTI_EXPORT GetGraphQueryTemplatesRequest : public RpcServiceRequest {
public:
GetGraphQueryTemplatesRequest();
~GetGraphQueryTemplatesRequest();
std::string getServiceUnit() const;
void setServiceUnit(const std::string &serviceUnit);
std::string getEnv() const;
void setEnv(const std::string &env);
private:
std::string serviceUnit_;
std::string env_;
};
} // namespace Model
} // namespace Sasti
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_SASTI_MODEL_GETGRAPHQUERYTEMPLATESREQUEST_H_

View 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_SASTI_MODEL_GETGRAPHQUERYTEMPLATESRESULT_H_
#define ALIBABACLOUD_SASTI_MODEL_GETGRAPHQUERYTEMPLATESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/sasti/SastiExport.h>
namespace AlibabaCloud
{
namespace Sasti
{
namespace Model
{
class ALIBABACLOUD_SASTI_EXPORT GetGraphQueryTemplatesResult : public ServiceResult
{
public:
struct DataItem
{
int status;
std::string gmtCreate;
std::string gremlinTemplate;
std::string lastModifier;
std::string gmtModified;
long id;
std::string scenarioDesc;
std::string scenario;
};
GetGraphQueryTemplatesResult();
explicit GetGraphQueryTemplatesResult(const std::string &payload);
~GetGraphQueryTemplatesResult();
std::vector<DataItem> getData()const;
protected:
void parse(const std::string &payload);
private:
std::vector<DataItem> data_;
};
}
}
}
#endif // !ALIBABACLOUD_SASTI_MODEL_GETGRAPHQUERYTEMPLATESRESULT_H_

197
sasti/src/SastiClient.cc Normal file
View File

@@ -0,0 +1,197 @@
/*
* 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/sasti/SastiClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Sasti;
using namespace AlibabaCloud::Sasti::Model;
namespace
{
const std::string SERVICE_NAME = "Sasti";
}
SastiClient::SastiClient(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, "");
}
SastiClient::SastiClient(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, "");
}
SastiClient::SastiClient(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, "");
}
SastiClient::~SastiClient()
{}
SastiClient::DescribeDomainReportOutcome SastiClient::describeDomainReport(const DescribeDomainReportRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeDomainReportOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeDomainReportOutcome(DescribeDomainReportResult(outcome.result()));
else
return DescribeDomainReportOutcome(outcome.error());
}
void SastiClient::describeDomainReportAsync(const DescribeDomainReportRequest& request, const DescribeDomainReportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeDomainReport(request), context);
};
asyncExecute(new Runnable(fn));
}
SastiClient::DescribeDomainReportOutcomeCallable SastiClient::describeDomainReportCallable(const DescribeDomainReportRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeDomainReportOutcome()>>(
[this, request]()
{
return this->describeDomainReport(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SastiClient::DescribeFileReportOutcome SastiClient::describeFileReport(const DescribeFileReportRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeFileReportOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeFileReportOutcome(DescribeFileReportResult(outcome.result()));
else
return DescribeFileReportOutcome(outcome.error());
}
void SastiClient::describeFileReportAsync(const DescribeFileReportRequest& request, const DescribeFileReportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeFileReport(request), context);
};
asyncExecute(new Runnable(fn));
}
SastiClient::DescribeFileReportOutcomeCallable SastiClient::describeFileReportCallable(const DescribeFileReportRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeFileReportOutcome()>>(
[this, request]()
{
return this->describeFileReport(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SastiClient::DescribeIpReportOutcome SastiClient::describeIpReport(const DescribeIpReportRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeIpReportOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeIpReportOutcome(DescribeIpReportResult(outcome.result()));
else
return DescribeIpReportOutcome(outcome.error());
}
void SastiClient::describeIpReportAsync(const DescribeIpReportRequest& request, const DescribeIpReportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeIpReport(request), context);
};
asyncExecute(new Runnable(fn));
}
SastiClient::DescribeIpReportOutcomeCallable SastiClient::describeIpReportCallable(const DescribeIpReportRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeIpReportOutcome()>>(
[this, request]()
{
return this->describeIpReport(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SastiClient::GetGraphQueryTemplatesOutcome SastiClient::getGraphQueryTemplates(const GetGraphQueryTemplatesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetGraphQueryTemplatesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetGraphQueryTemplatesOutcome(GetGraphQueryTemplatesResult(outcome.result()));
else
return GetGraphQueryTemplatesOutcome(outcome.error());
}
void SastiClient::getGraphQueryTemplatesAsync(const GetGraphQueryTemplatesRequest& request, const GetGraphQueryTemplatesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getGraphQueryTemplates(request), context);
};
asyncExecute(new Runnable(fn));
}
SastiClient::GetGraphQueryTemplatesOutcomeCallable SastiClient::getGraphQueryTemplatesCallable(const GetGraphQueryTemplatesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetGraphQueryTemplatesOutcome()>>(
[this, request]()
{
return this->getGraphQueryTemplates(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

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.
*/
#include <alibabacloud/sasti/model/DescribeDomainReportRequest.h>
using AlibabaCloud::Sasti::Model::DescribeDomainReportRequest;
DescribeDomainReportRequest::DescribeDomainReportRequest()
: RpcServiceRequest("sasti", "2020-05-12", "DescribeDomainReport") {
setMethod(HttpRequest::Method::Post);
}
DescribeDomainReportRequest::~DescribeDomainReportRequest() {}
std::string DescribeDomainReportRequest::getSourceIp() const {
return sourceIp_;
}
void DescribeDomainReportRequest::setSourceIp(const std::string &sourceIp) {
sourceIp_ = sourceIp;
setParameter(std::string("SourceIp"), sourceIp);
}
std::string DescribeDomainReportRequest::getField() const {
return field_;
}
void DescribeDomainReportRequest::setField(const std::string &field) {
field_ = field;
setParameter(std::string("Field"), field);
}
std::string DescribeDomainReportRequest::getDomain() const {
return domain_;
}
void DescribeDomainReportRequest::setDomain(const std::string &domain) {
domain_ = domain;
setParameter(std::string("Domain"), domain);
}
std::string DescribeDomainReportRequest::getServiceLang() const {
return serviceLang_;
}
void DescribeDomainReportRequest::setServiceLang(const std::string &serviceLang) {
serviceLang_ = serviceLang;
setParameter(std::string("ServiceLang"), serviceLang);
}

View File

@@ -0,0 +1,135 @@
/*
* 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/sasti/model/DescribeDomainReportResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Sasti;
using namespace AlibabaCloud::Sasti::Model;
DescribeDomainReportResult::DescribeDomainReportResult() :
ServiceResult()
{}
DescribeDomainReportResult::DescribeDomainReportResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeDomainReportResult::~DescribeDomainReportResult()
{}
void DescribeDomainReportResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Intelligences"].isNull())
intelligences_ = value["Intelligences"].asString();
if(!value["Domain"].isNull())
domain_ = value["Domain"].asString();
if(!value["SslCert"].isNull())
sslCert_ = value["SslCert"].asString();
if(!value["AttackPreferenceTop5"].isNull())
attackPreferenceTop5_ = value["AttackPreferenceTop5"].asString();
if(!value["ThreatTypes"].isNull())
threatTypes_ = value["ThreatTypes"].asString();
if(!value["Confidence"].isNull())
confidence_ = value["Confidence"].asString();
if(!value["ThreatLevel"].isNull())
threatLevel_ = value["ThreatLevel"].asString();
if(!value["AttackCntByThreatType"].isNull())
attackCntByThreatType_ = value["AttackCntByThreatType"].asString();
if(!value["Context"].isNull())
context_ = value["Context"].asString();
if(!value["Whois"].isNull())
whois_ = value["Whois"].asString();
if(!value["Scenario"].isNull())
scenario_ = value["Scenario"].asString();
if(!value["Basic"].isNull())
basic_ = value["Basic"].asString();
if(!value["Group"].isNull())
group_ = value["Group"].asString();
}
std::string DescribeDomainReportResult::getContext()const
{
return context_;
}
std::string DescribeDomainReportResult::getBasic()const
{
return basic_;
}
std::string DescribeDomainReportResult::getGroup()const
{
return group_;
}
std::string DescribeDomainReportResult::getSslCert()const
{
return sslCert_;
}
std::string DescribeDomainReportResult::getThreatTypes()const
{
return threatTypes_;
}
std::string DescribeDomainReportResult::getIntelligences()const
{
return intelligences_;
}
std::string DescribeDomainReportResult::getScenario()const
{
return scenario_;
}
std::string DescribeDomainReportResult::getAttackCntByThreatType()const
{
return attackCntByThreatType_;
}
std::string DescribeDomainReportResult::getWhois()const
{
return whois_;
}
std::string DescribeDomainReportResult::getThreatLevel()const
{
return threatLevel_;
}
std::string DescribeDomainReportResult::getConfidence()const
{
return confidence_;
}
std::string DescribeDomainReportResult::getDomain()const
{
return domain_;
}
std::string DescribeDomainReportResult::getAttackPreferenceTop5()const
{
return attackPreferenceTop5_;
}

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.
*/
#include <alibabacloud/sasti/model/DescribeFileReportRequest.h>
using AlibabaCloud::Sasti::Model::DescribeFileReportRequest;
DescribeFileReportRequest::DescribeFileReportRequest()
: RpcServiceRequest("sasti", "2020-05-12", "DescribeFileReport") {
setMethod(HttpRequest::Method::Post);
}
DescribeFileReportRequest::~DescribeFileReportRequest() {}
std::string DescribeFileReportRequest::getSourceIp() const {
return sourceIp_;
}
void DescribeFileReportRequest::setSourceIp(const std::string &sourceIp) {
sourceIp_ = sourceIp;
setParameter(std::string("SourceIp"), sourceIp);
}
std::string DescribeFileReportRequest::getField() const {
return field_;
}
void DescribeFileReportRequest::setField(const std::string &field) {
field_ = field;
setParameter(std::string("Field"), field);
}
std::string DescribeFileReportRequest::getServiceLang() const {
return serviceLang_;
}
void DescribeFileReportRequest::setServiceLang(const std::string &serviceLang) {
serviceLang_ = serviceLang;
setParameter(std::string("ServiceLang"), serviceLang);
}
std::string DescribeFileReportRequest::getFileHash() const {
return fileHash_;
}
void DescribeFileReportRequest::setFileHash(const std::string &fileHash) {
fileHash_ = fileHash;
setParameter(std::string("FileHash"), fileHash);
}

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.
*/
#include <alibabacloud/sasti/model/DescribeFileReportResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Sasti;
using namespace AlibabaCloud::Sasti::Model;
DescribeFileReportResult::DescribeFileReportResult() :
ServiceResult()
{}
DescribeFileReportResult::DescribeFileReportResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeFileReportResult::~DescribeFileReportResult()
{}
void DescribeFileReportResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Intelligences"].isNull())
intelligences_ = value["Intelligences"].asString();
if(!value["FileHash"].isNull())
fileHash_ = value["FileHash"].asString();
if(!value["ThreatTypes"].isNull())
threatTypes_ = value["ThreatTypes"].asString();
if(!value["Basic"].isNull())
basic_ = value["Basic"].asString();
if(!value["ThreatLevel"].isNull())
threatLevel_ = value["ThreatLevel"].asString();
if(!value["Sandbox"].isNull())
sandbox_ = value["Sandbox"].asString();
}
std::string DescribeFileReportResult::getBasic()const
{
return basic_;
}
std::string DescribeFileReportResult::getThreatLevel()const
{
return threatLevel_;
}
std::string DescribeFileReportResult::getFileHash()const
{
return fileHash_;
}
std::string DescribeFileReportResult::getThreatTypes()const
{
return threatTypes_;
}
std::string DescribeFileReportResult::getIntelligences()const
{
return intelligences_;
}
std::string DescribeFileReportResult::getSandbox()const
{
return sandbox_;
}

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.
*/
#include <alibabacloud/sasti/model/DescribeIpReportRequest.h>
using AlibabaCloud::Sasti::Model::DescribeIpReportRequest;
DescribeIpReportRequest::DescribeIpReportRequest()
: RpcServiceRequest("sasti", "2020-05-12", "DescribeIpReport") {
setMethod(HttpRequest::Method::Post);
}
DescribeIpReportRequest::~DescribeIpReportRequest() {}
std::string DescribeIpReportRequest::getSourceIp() const {
return sourceIp_;
}
void DescribeIpReportRequest::setSourceIp(const std::string &sourceIp) {
sourceIp_ = sourceIp;
setParameter(std::string("SourceIp"), sourceIp);
}
std::string DescribeIpReportRequest::getIp() const {
return ip_;
}
void DescribeIpReportRequest::setIp(const std::string &ip) {
ip_ = ip;
setParameter(std::string("Ip"), ip);
}
std::string DescribeIpReportRequest::getField() const {
return field_;
}
void DescribeIpReportRequest::setField(const std::string &field) {
field_ = field;
setParameter(std::string("Field"), field);
}
std::string DescribeIpReportRequest::getServiceLang() const {
return serviceLang_;
}
void DescribeIpReportRequest::setServiceLang(const std::string &serviceLang) {
serviceLang_ = serviceLang;
setParameter(std::string("ServiceLang"), serviceLang);
}

View File

@@ -0,0 +1,121 @@
/*
* 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/sasti/model/DescribeIpReportResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Sasti;
using namespace AlibabaCloud::Sasti::Model;
DescribeIpReportResult::DescribeIpReportResult() :
ServiceResult()
{}
DescribeIpReportResult::DescribeIpReportResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeIpReportResult::~DescribeIpReportResult()
{}
void DescribeIpReportResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Context"].isNull())
context_ = value["Context"].asString();
if(!value["Intelligences"].isNull())
intelligences_ = value["Intelligences"].asString();
if(!value["Whois"].isNull())
whois_ = value["Whois"].asString();
if(!value["AttackPreferenceTop5"].isNull())
attackPreferenceTop5_ = value["AttackPreferenceTop5"].asString();
if(!value["Confidence"].isNull())
confidence_ = value["Confidence"].asString();
if(!value["ThreatTypes"].isNull())
threatTypes_ = value["ThreatTypes"].asString();
if(!value["Scenario"].isNull())
scenario_ = value["Scenario"].asString();
if(!value["Ip"].isNull())
ip_ = value["Ip"].asString();
if(!value["ThreatLevel"].isNull())
threatLevel_ = value["ThreatLevel"].asString();
if(!value["AttackCntByThreatType"].isNull())
attackCntByThreatType_ = value["AttackCntByThreatType"].asString();
if(!value["Group"].isNull())
group_ = value["Group"].asString();
}
std::string DescribeIpReportResult::getContext()const
{
return context_;
}
std::string DescribeIpReportResult::getGroup()const
{
return group_;
}
std::string DescribeIpReportResult::getWhois()const
{
return whois_;
}
std::string DescribeIpReportResult::getAttackCntByThreatType()const
{
return attackCntByThreatType_;
}
std::string DescribeIpReportResult::getThreatLevel()const
{
return threatLevel_;
}
std::string DescribeIpReportResult::getConfidence()const
{
return confidence_;
}
std::string DescribeIpReportResult::getIp()const
{
return ip_;
}
std::string DescribeIpReportResult::getThreatTypes()const
{
return threatTypes_;
}
std::string DescribeIpReportResult::getIntelligences()const
{
return intelligences_;
}
std::string DescribeIpReportResult::getAttackPreferenceTop5()const
{
return attackPreferenceTop5_;
}
std::string DescribeIpReportResult::getScenario()const
{
return scenario_;
}

View File

@@ -0,0 +1,45 @@
/*
* 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/sasti/model/GetGraphQueryTemplatesRequest.h>
using AlibabaCloud::Sasti::Model::GetGraphQueryTemplatesRequest;
GetGraphQueryTemplatesRequest::GetGraphQueryTemplatesRequest()
: RpcServiceRequest("sasti", "2020-05-12", "GetGraphQueryTemplates") {
setMethod(HttpRequest::Method::Post);
}
GetGraphQueryTemplatesRequest::~GetGraphQueryTemplatesRequest() {}
std::string GetGraphQueryTemplatesRequest::getServiceUnit() const {
return serviceUnit_;
}
void GetGraphQueryTemplatesRequest::setServiceUnit(const std::string &serviceUnit) {
serviceUnit_ = serviceUnit;
setBodyParameter(std::string("ServiceUnit"), serviceUnit);
}
std::string GetGraphQueryTemplatesRequest::getEnv() const {
return env_;
}
void GetGraphQueryTemplatesRequest::setEnv(const std::string &env) {
env_ = env;
setBodyParameter(std::string("Env"), env);
}

View File

@@ -0,0 +1,71 @@
/*
* 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/sasti/model/GetGraphQueryTemplatesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Sasti;
using namespace AlibabaCloud::Sasti::Model;
GetGraphQueryTemplatesResult::GetGraphQueryTemplatesResult() :
ServiceResult()
{}
GetGraphQueryTemplatesResult::GetGraphQueryTemplatesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetGraphQueryTemplatesResult::~GetGraphQueryTemplatesResult()
{}
void GetGraphQueryTemplatesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allDataNode = value["Data"]["DataItem"];
for (auto valueDataDataItem : allDataNode)
{
DataItem dataObject;
if(!valueDataDataItem["Id"].isNull())
dataObject.id = std::stol(valueDataDataItem["Id"].asString());
if(!valueDataDataItem["GmtCreate"].isNull())
dataObject.gmtCreate = valueDataDataItem["GmtCreate"].asString();
if(!valueDataDataItem["GmtModified"].isNull())
dataObject.gmtModified = valueDataDataItem["GmtModified"].asString();
if(!valueDataDataItem["Scenario"].isNull())
dataObject.scenario = valueDataDataItem["Scenario"].asString();
if(!valueDataDataItem["GremlinTemplate"].isNull())
dataObject.gremlinTemplate = valueDataDataItem["GremlinTemplate"].asString();
if(!valueDataDataItem["LastModifier"].isNull())
dataObject.lastModifier = valueDataDataItem["LastModifier"].asString();
if(!valueDataDataItem["Status"].isNull())
dataObject.status = std::stoi(valueDataDataItem["Status"].asString());
if(!valueDataDataItem["ScenarioDesc"].isNull())
dataObject.scenarioDesc = valueDataDataItem["ScenarioDesc"].asString();
data_.push_back(dataObject);
}
}
std::vector<GetGraphQueryTemplatesResult::DataItem> GetGraphQueryTemplatesResult::getData()const
{
return data_;
}