ARMS4FINANCE SDK Auto Released By shenshi,Version:1.34.39

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
haowei.yao
2019-03-18 14:13:09 +08:00
parent feae502d3a
commit da8c6b2c70
15 changed files with 942 additions and 2 deletions

View 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/arms4finance/ARMS4FINANCEClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::ARMS4FINANCE;
using namespace AlibabaCloud::ARMS4FINANCE::Model;
namespace
{
const std::string SERVICE_NAME = "ARMS4FINANCE";
}
ARMS4FINANCEClient::ARMS4FINANCEClient(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, "arms4finance");
}
ARMS4FINANCEClient::ARMS4FINANCEClient(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, "arms4finance");
}
ARMS4FINANCEClient::ARMS4FINANCEClient(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, "arms4finance");
}
ARMS4FINANCEClient::~ARMS4FINANCEClient()
{}
ARMS4FINANCEClient::WhereInDimQueryOutcome ARMS4FINANCEClient::whereInDimQuery(const WhereInDimQueryRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return WhereInDimQueryOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return WhereInDimQueryOutcome(WhereInDimQueryResult(outcome.result()));
else
return WhereInDimQueryOutcome(outcome.error());
}
void ARMS4FINANCEClient::whereInDimQueryAsync(const WhereInDimQueryRequest& request, const WhereInDimQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, whereInDimQuery(request), context);
};
asyncExecute(new Runnable(fn));
}
ARMS4FINANCEClient::WhereInDimQueryOutcomeCallable ARMS4FINANCEClient::whereInDimQueryCallable(const WhereInDimQueryRequest &request) const
{
auto task = std::make_shared<std::packaged_task<WhereInDimQueryOutcome()>>(
[this, request]()
{
return this->whereInDimQuery(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ARMS4FINANCEClient::ARMSQueryDataSetOutcome ARMS4FINANCEClient::aRMSQueryDataSet(const ARMSQueryDataSetRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ARMSQueryDataSetOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ARMSQueryDataSetOutcome(ARMSQueryDataSetResult(outcome.result()));
else
return ARMSQueryDataSetOutcome(outcome.error());
}
void ARMS4FINANCEClient::aRMSQueryDataSetAsync(const ARMSQueryDataSetRequest& request, const ARMSQueryDataSetAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, aRMSQueryDataSet(request), context);
};
asyncExecute(new Runnable(fn));
}
ARMS4FINANCEClient::ARMSQueryDataSetOutcomeCallable ARMS4FINANCEClient::aRMSQueryDataSetCallable(const ARMSQueryDataSetRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ARMSQueryDataSetOutcome()>>(
[this, request]()
{
return this->aRMSQueryDataSet(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,122 @@
/*
* 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/arms4finance/model/ARMSQueryDataSetRequest.h>
using AlibabaCloud::ARMS4FINANCE::Model::ARMSQueryDataSetRequest;
ARMSQueryDataSetRequest::ARMSQueryDataSetRequest() :
RpcServiceRequest("arms4finance", "2017-11-30", "ARMSQueryDataSet")
{}
ARMSQueryDataSetRequest::~ARMSQueryDataSetRequest()
{}
std::vector<std::string> ARMSQueryDataSetRequest::getMeasures()const
{
return measures_;
}
void ARMSQueryDataSetRequest::setMeasures(const std::vector<std::string>& measures)
{
measures_ = measures;
for(int i = 0; i!= measures.size(); i++)
setParameter("Measures."+ std::to_string(i), measures.at(i));
}
int ARMSQueryDataSetRequest::getIntervalInSec()const
{
return intervalInSec_;
}
void ARMSQueryDataSetRequest::setIntervalInSec(int intervalInSec)
{
intervalInSec_ = intervalInSec;
setParameter("IntervalInSec", std::to_string(intervalInSec));
}
std::string ARMSQueryDataSetRequest::getDateStr()const
{
return dateStr_;
}
void ARMSQueryDataSetRequest::setDateStr(const std::string& dateStr)
{
dateStr_ = dateStr;
setParameter("DateStr", dateStr);
}
bool ARMSQueryDataSetRequest::getIsDrillDown()const
{
return isDrillDown_;
}
void ARMSQueryDataSetRequest::setIsDrillDown(bool isDrillDown)
{
isDrillDown_ = isDrillDown;
setParameter("IsDrillDown", std::to_string(isDrillDown));
}
long ARMSQueryDataSetRequest::getMinTime()const
{
return minTime_;
}
void ARMSQueryDataSetRequest::setMinTime(long minTime)
{
minTime_ = minTime;
setParameter("MinTime", std::to_string(minTime));
}
long ARMSQueryDataSetRequest::getDatasetId()const
{
return datasetId_;
}
void ARMSQueryDataSetRequest::setDatasetId(long datasetId)
{
datasetId_ = datasetId;
setParameter("DatasetId", std::to_string(datasetId));
}
long ARMSQueryDataSetRequest::getMaxTime()const
{
return maxTime_;
}
void ARMSQueryDataSetRequest::setMaxTime(long maxTime)
{
maxTime_ = maxTime;
setParameter("MaxTime", std::to_string(maxTime));
}
std::vector<ARMSQueryDataSetRequest::Dimensions> ARMSQueryDataSetRequest::getDimensions()const
{
return dimensions_;
}
void ARMSQueryDataSetRequest::setDimensions(const std::vector<Dimensions>& dimensions)
{
dimensions_ = dimensions;
int i = 0;
for(int i = 0; i!= dimensions.size(); i++) {
auto obj = dimensions.at(i);
std::string str ="Dimensions."+ std::to_string(i);
setParameter(str + ".Value", obj.value);
setParameter(str + ".Key", obj.key);
}
}

View File

@@ -0,0 +1,52 @@
/*
* 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/arms4finance/model/ARMSQueryDataSetResult.h>
#include <json/json.h>
using namespace AlibabaCloud::ARMS4FINANCE;
using namespace AlibabaCloud::ARMS4FINANCE::Model;
ARMSQueryDataSetResult::ARMSQueryDataSetResult() :
ServiceResult()
{}
ARMSQueryDataSetResult::ARMSQueryDataSetResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ARMSQueryDataSetResult::~ARMSQueryDataSetResult()
{}
void ARMSQueryDataSetResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Data"].isNull())
data_ = value["Data"].asString();
}
std::string ARMSQueryDataSetResult::getData()const
{
return data_;
}

View File

@@ -0,0 +1,145 @@
/*
* 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/arms4finance/model/WhereInDimQueryRequest.h>
using AlibabaCloud::ARMS4FINANCE::Model::WhereInDimQueryRequest;
WhereInDimQueryRequest::WhereInDimQueryRequest() :
RpcServiceRequest("arms4finance", "2017-11-30", "WhereInDimQuery")
{}
WhereInDimQueryRequest::~WhereInDimQueryRequest()
{}
std::string WhereInDimQueryRequest::getWhereInKey()const
{
return whereInKey_;
}
void WhereInDimQueryRequest::setWhereInKey(const std::string& whereInKey)
{
whereInKey_ = whereInKey;
setParameter("WhereInKey", whereInKey);
}
std::vector<std::string> WhereInDimQueryRequest::getMeasures()const
{
return measures_;
}
void WhereInDimQueryRequest::setMeasures(const std::vector<std::string>& measures)
{
measures_ = measures;
for(int i = 0; i!= measures.size(); i++)
setParameter("Measures."+ std::to_string(i), measures.at(i));
}
int WhereInDimQueryRequest::getIntervalInSec()const
{
return intervalInSec_;
}
void WhereInDimQueryRequest::setIntervalInSec(int intervalInSec)
{
intervalInSec_ = intervalInSec;
setParameter("IntervalInSec", std::to_string(intervalInSec));
}
std::string WhereInDimQueryRequest::getDateStr()const
{
return dateStr_;
}
void WhereInDimQueryRequest::setDateStr(const std::string& dateStr)
{
dateStr_ = dateStr;
setParameter("DateStr", dateStr);
}
bool WhereInDimQueryRequest::getIsDrillDown()const
{
return isDrillDown_;
}
void WhereInDimQueryRequest::setIsDrillDown(bool isDrillDown)
{
isDrillDown_ = isDrillDown;
setParameter("IsDrillDown", std::to_string(isDrillDown));
}
long WhereInDimQueryRequest::getMinTime()const
{
return minTime_;
}
void WhereInDimQueryRequest::setMinTime(long minTime)
{
minTime_ = minTime;
setParameter("MinTime", std::to_string(minTime));
}
long WhereInDimQueryRequest::getDatasetId()const
{
return datasetId_;
}
void WhereInDimQueryRequest::setDatasetId(long datasetId)
{
datasetId_ = datasetId;
setParameter("DatasetId", std::to_string(datasetId));
}
std::vector<std::string> WhereInDimQueryRequest::getWhereInValues()const
{
return whereInValues_;
}
void WhereInDimQueryRequest::setWhereInValues(const std::vector<std::string>& whereInValues)
{
whereInValues_ = whereInValues;
for(int i = 0; i!= whereInValues.size(); i++)
setParameter("WhereInValues."+ std::to_string(i), whereInValues.at(i));
}
long WhereInDimQueryRequest::getMaxTime()const
{
return maxTime_;
}
void WhereInDimQueryRequest::setMaxTime(long maxTime)
{
maxTime_ = maxTime;
setParameter("MaxTime", std::to_string(maxTime));
}
std::vector<WhereInDimQueryRequest::Dimensions> WhereInDimQueryRequest::getDimensions()const
{
return dimensions_;
}
void WhereInDimQueryRequest::setDimensions(const std::vector<Dimensions>& dimensions)
{
dimensions_ = dimensions;
int i = 0;
for(int i = 0; i!= dimensions.size(); i++) {
auto obj = dimensions.at(i);
std::string str ="Dimensions."+ std::to_string(i);
setParameter(str + ".Value", obj.value);
setParameter(str + ".Key", obj.key);
}
}

View File

@@ -0,0 +1,52 @@
/*
* 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/arms4finance/model/WhereInDimQueryResult.h>
#include <json/json.h>
using namespace AlibabaCloud::ARMS4FINANCE;
using namespace AlibabaCloud::ARMS4FINANCE::Model;
WhereInDimQueryResult::WhereInDimQueryResult() :
ServiceResult()
{}
WhereInDimQueryResult::WhereInDimQueryResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
WhereInDimQueryResult::~WhereInDimQueryResult()
{}
void WhereInDimQueryResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Data"].isNull())
data_ = value["Data"].asString();
}
std::string WhereInDimQueryResult::getData()const
{
return data_;
}