Support query quota.
This commit is contained in:
629
quotas/src/QuotasClient.cc
Normal file
629
quotas/src/QuotasClient.cc
Normal file
@@ -0,0 +1,629 @@
|
||||
/*
|
||||
* 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/quotas/QuotasClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "quotas";
|
||||
}
|
||||
|
||||
QuotasClient::QuotasClient(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, "quotas");
|
||||
}
|
||||
|
||||
QuotasClient::QuotasClient(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, "quotas");
|
||||
}
|
||||
|
||||
QuotasClient::QuotasClient(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, "quotas");
|
||||
}
|
||||
|
||||
QuotasClient::~QuotasClient()
|
||||
{}
|
||||
|
||||
QuotasClient::CreateQuotaAlarmOutcome QuotasClient::createQuotaAlarm(const CreateQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateQuotaAlarmOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateQuotaAlarmOutcome(CreateQuotaAlarmResult(outcome.result()));
|
||||
else
|
||||
return CreateQuotaAlarmOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::createQuotaAlarmAsync(const CreateQuotaAlarmRequest& request, const CreateQuotaAlarmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createQuotaAlarm(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::CreateQuotaAlarmOutcomeCallable QuotasClient::createQuotaAlarmCallable(const CreateQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateQuotaAlarmOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createQuotaAlarm(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::CreateQuotaApplicationOutcome QuotasClient::createQuotaApplication(const CreateQuotaApplicationRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateQuotaApplicationOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateQuotaApplicationOutcome(CreateQuotaApplicationResult(outcome.result()));
|
||||
else
|
||||
return CreateQuotaApplicationOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::createQuotaApplicationAsync(const CreateQuotaApplicationRequest& request, const CreateQuotaApplicationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createQuotaApplication(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::CreateQuotaApplicationOutcomeCallable QuotasClient::createQuotaApplicationCallable(const CreateQuotaApplicationRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateQuotaApplicationOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createQuotaApplication(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::DeleteQuotaAlarmOutcome QuotasClient::deleteQuotaAlarm(const DeleteQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteQuotaAlarmOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteQuotaAlarmOutcome(DeleteQuotaAlarmResult(outcome.result()));
|
||||
else
|
||||
return DeleteQuotaAlarmOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::deleteQuotaAlarmAsync(const DeleteQuotaAlarmRequest& request, const DeleteQuotaAlarmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteQuotaAlarm(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::DeleteQuotaAlarmOutcomeCallable QuotasClient::deleteQuotaAlarmCallable(const DeleteQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteQuotaAlarmOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteQuotaAlarm(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::GetProductQuotaOutcome QuotasClient::getProductQuota(const GetProductQuotaRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetProductQuotaOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetProductQuotaOutcome(GetProductQuotaResult(outcome.result()));
|
||||
else
|
||||
return GetProductQuotaOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::getProductQuotaAsync(const GetProductQuotaRequest& request, const GetProductQuotaAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getProductQuota(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::GetProductQuotaOutcomeCallable QuotasClient::getProductQuotaCallable(const GetProductQuotaRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetProductQuotaOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getProductQuota(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::GetProductQuotaDimensionOutcome QuotasClient::getProductQuotaDimension(const GetProductQuotaDimensionRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetProductQuotaDimensionOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetProductQuotaDimensionOutcome(GetProductQuotaDimensionResult(outcome.result()));
|
||||
else
|
||||
return GetProductQuotaDimensionOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::getProductQuotaDimensionAsync(const GetProductQuotaDimensionRequest& request, const GetProductQuotaDimensionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getProductQuotaDimension(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::GetProductQuotaDimensionOutcomeCallable QuotasClient::getProductQuotaDimensionCallable(const GetProductQuotaDimensionRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetProductQuotaDimensionOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getProductQuotaDimension(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::GetQuotaAlarmOutcome QuotasClient::getQuotaAlarm(const GetQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetQuotaAlarmOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetQuotaAlarmOutcome(GetQuotaAlarmResult(outcome.result()));
|
||||
else
|
||||
return GetQuotaAlarmOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::getQuotaAlarmAsync(const GetQuotaAlarmRequest& request, const GetQuotaAlarmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getQuotaAlarm(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::GetQuotaAlarmOutcomeCallable QuotasClient::getQuotaAlarmCallable(const GetQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetQuotaAlarmOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getQuotaAlarm(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::GetQuotaApplicationOutcome QuotasClient::getQuotaApplication(const GetQuotaApplicationRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetQuotaApplicationOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetQuotaApplicationOutcome(GetQuotaApplicationResult(outcome.result()));
|
||||
else
|
||||
return GetQuotaApplicationOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::getQuotaApplicationAsync(const GetQuotaApplicationRequest& request, const GetQuotaApplicationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getQuotaApplication(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::GetQuotaApplicationOutcomeCallable QuotasClient::getQuotaApplicationCallable(const GetQuotaApplicationRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetQuotaApplicationOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getQuotaApplication(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListAlarmHistoriesOutcome QuotasClient::listAlarmHistories(const ListAlarmHistoriesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListAlarmHistoriesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListAlarmHistoriesOutcome(ListAlarmHistoriesResult(outcome.result()));
|
||||
else
|
||||
return ListAlarmHistoriesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listAlarmHistoriesAsync(const ListAlarmHistoriesRequest& request, const ListAlarmHistoriesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listAlarmHistories(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListAlarmHistoriesOutcomeCallable QuotasClient::listAlarmHistoriesCallable(const ListAlarmHistoriesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListAlarmHistoriesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listAlarmHistories(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListDependentQuotasOutcome QuotasClient::listDependentQuotas(const ListDependentQuotasRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListDependentQuotasOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListDependentQuotasOutcome(ListDependentQuotasResult(outcome.result()));
|
||||
else
|
||||
return ListDependentQuotasOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listDependentQuotasAsync(const ListDependentQuotasRequest& request, const ListDependentQuotasAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listDependentQuotas(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListDependentQuotasOutcomeCallable QuotasClient::listDependentQuotasCallable(const ListDependentQuotasRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListDependentQuotasOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listDependentQuotas(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListProductDimensionGroupsOutcome QuotasClient::listProductDimensionGroups(const ListProductDimensionGroupsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListProductDimensionGroupsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListProductDimensionGroupsOutcome(ListProductDimensionGroupsResult(outcome.result()));
|
||||
else
|
||||
return ListProductDimensionGroupsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listProductDimensionGroupsAsync(const ListProductDimensionGroupsRequest& request, const ListProductDimensionGroupsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listProductDimensionGroups(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListProductDimensionGroupsOutcomeCallable QuotasClient::listProductDimensionGroupsCallable(const ListProductDimensionGroupsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListProductDimensionGroupsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listProductDimensionGroups(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListProductQuotaDimensionsOutcome QuotasClient::listProductQuotaDimensions(const ListProductQuotaDimensionsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListProductQuotaDimensionsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListProductQuotaDimensionsOutcome(ListProductQuotaDimensionsResult(outcome.result()));
|
||||
else
|
||||
return ListProductQuotaDimensionsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listProductQuotaDimensionsAsync(const ListProductQuotaDimensionsRequest& request, const ListProductQuotaDimensionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listProductQuotaDimensions(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListProductQuotaDimensionsOutcomeCallable QuotasClient::listProductQuotaDimensionsCallable(const ListProductQuotaDimensionsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListProductQuotaDimensionsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listProductQuotaDimensions(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListProductQuotasOutcome QuotasClient::listProductQuotas(const ListProductQuotasRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListProductQuotasOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListProductQuotasOutcome(ListProductQuotasResult(outcome.result()));
|
||||
else
|
||||
return ListProductQuotasOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listProductQuotasAsync(const ListProductQuotasRequest& request, const ListProductQuotasAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listProductQuotas(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListProductQuotasOutcomeCallable QuotasClient::listProductQuotasCallable(const ListProductQuotasRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListProductQuotasOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listProductQuotas(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListProductsOutcome QuotasClient::listProducts(const ListProductsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListProductsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListProductsOutcome(ListProductsResult(outcome.result()));
|
||||
else
|
||||
return ListProductsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listProductsAsync(const ListProductsRequest& request, const ListProductsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listProducts(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListProductsOutcomeCallable QuotasClient::listProductsCallable(const ListProductsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListProductsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listProducts(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListQuotaAlarmsOutcome QuotasClient::listQuotaAlarms(const ListQuotaAlarmsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListQuotaAlarmsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListQuotaAlarmsOutcome(ListQuotaAlarmsResult(outcome.result()));
|
||||
else
|
||||
return ListQuotaAlarmsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listQuotaAlarmsAsync(const ListQuotaAlarmsRequest& request, const ListQuotaAlarmsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listQuotaAlarms(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListQuotaAlarmsOutcomeCallable QuotasClient::listQuotaAlarmsCallable(const ListQuotaAlarmsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListQuotaAlarmsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listQuotaAlarms(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::ListQuotaApplicationsOutcome QuotasClient::listQuotaApplications(const ListQuotaApplicationsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListQuotaApplicationsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListQuotaApplicationsOutcome(ListQuotaApplicationsResult(outcome.result()));
|
||||
else
|
||||
return ListQuotaApplicationsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::listQuotaApplicationsAsync(const ListQuotaApplicationsRequest& request, const ListQuotaApplicationsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listQuotaApplications(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::ListQuotaApplicationsOutcomeCallable QuotasClient::listQuotaApplicationsCallable(const ListQuotaApplicationsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListQuotaApplicationsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listQuotaApplications(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
QuotasClient::UpdateQuotaAlarmOutcome QuotasClient::updateQuotaAlarm(const UpdateQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdateQuotaAlarmOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdateQuotaAlarmOutcome(UpdateQuotaAlarmResult(outcome.result()));
|
||||
else
|
||||
return UpdateQuotaAlarmOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void QuotasClient::updateQuotaAlarmAsync(const UpdateQuotaAlarmRequest& request, const UpdateQuotaAlarmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updateQuotaAlarm(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
QuotasClient::UpdateQuotaAlarmOutcomeCallable QuotasClient::updateQuotaAlarmCallable(const UpdateQuotaAlarmRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdateQuotaAlarmOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updateQuotaAlarm(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
122
quotas/src/model/CreateQuotaAlarmRequest.cc
Normal file
122
quotas/src/model/CreateQuotaAlarmRequest.cc
Normal 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/quotas/model/CreateQuotaAlarmRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::CreateQuotaAlarmRequest;
|
||||
|
||||
CreateQuotaAlarmRequest::CreateQuotaAlarmRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "CreateQuotaAlarm")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateQuotaAlarmRequest::~CreateQuotaAlarmRequest()
|
||||
{}
|
||||
|
||||
std::string CreateQuotaAlarmRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string CreateQuotaAlarmRequest::getWebHook()const
|
||||
{
|
||||
return webHook_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setWebHook(const std::string& webHook)
|
||||
{
|
||||
webHook_ = webHook;
|
||||
setBodyParameter("WebHook", webHook);
|
||||
}
|
||||
|
||||
float CreateQuotaAlarmRequest::getThreshold()const
|
||||
{
|
||||
return threshold_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setThreshold(float threshold)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
setBodyParameter("Threshold", std::to_string(threshold));
|
||||
}
|
||||
|
||||
std::string CreateQuotaAlarmRequest::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setQuotaActionCode(const std::string& quotaActionCode)
|
||||
{
|
||||
quotaActionCode_ = quotaActionCode;
|
||||
setBodyParameter("QuotaActionCode", quotaActionCode);
|
||||
}
|
||||
|
||||
std::string CreateQuotaAlarmRequest::getThresholdType()const
|
||||
{
|
||||
return thresholdType_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setThresholdType(const std::string& thresholdType)
|
||||
{
|
||||
thresholdType_ = thresholdType;
|
||||
setBodyParameter("ThresholdType", thresholdType);
|
||||
}
|
||||
|
||||
std::vector<CreateQuotaAlarmRequest::QuotaDimensions> CreateQuotaAlarmRequest::getQuotaDimensions()const
|
||||
{
|
||||
return quotaDimensions_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setQuotaDimensions(const std::vector<QuotaDimensions>& quotaDimensions)
|
||||
{
|
||||
quotaDimensions_ = quotaDimensions;
|
||||
for(int dep1 = 0; dep1!= quotaDimensions.size(); dep1++) {
|
||||
auto quotaDimensionsObj = quotaDimensions.at(dep1);
|
||||
std::string quotaDimensionsObjStr = "QuotaDimensions." + std::to_string(dep1 + 1);
|
||||
setParameter(quotaDimensionsObjStr + ".Key", quotaDimensionsObj.key);
|
||||
setParameter(quotaDimensionsObjStr + ".Value", quotaDimensionsObj.value);
|
||||
}
|
||||
}
|
||||
|
||||
float CreateQuotaAlarmRequest::getThresholdPercent()const
|
||||
{
|
||||
return thresholdPercent_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setThresholdPercent(float thresholdPercent)
|
||||
{
|
||||
thresholdPercent_ = thresholdPercent;
|
||||
setBodyParameter("ThresholdPercent", std::to_string(thresholdPercent));
|
||||
}
|
||||
|
||||
std::string CreateQuotaAlarmRequest::getAlarmName()const
|
||||
{
|
||||
return alarmName_;
|
||||
}
|
||||
|
||||
void CreateQuotaAlarmRequest::setAlarmName(const std::string& alarmName)
|
||||
{
|
||||
alarmName_ = alarmName;
|
||||
setBodyParameter("AlarmName", alarmName);
|
||||
}
|
||||
|
||||
51
quotas/src/model/CreateQuotaAlarmResult.cc
Normal file
51
quotas/src/model/CreateQuotaAlarmResult.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/quotas/model/CreateQuotaAlarmResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
CreateQuotaAlarmResult::CreateQuotaAlarmResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateQuotaAlarmResult::CreateQuotaAlarmResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateQuotaAlarmResult::~CreateQuotaAlarmResult()
|
||||
{}
|
||||
|
||||
void CreateQuotaAlarmResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["AlarmId"].isNull())
|
||||
alarmId_ = value["AlarmId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateQuotaAlarmResult::getAlarmId()const
|
||||
{
|
||||
return alarmId_;
|
||||
}
|
||||
|
||||
122
quotas/src/model/CreateQuotaApplicationRequest.cc
Normal file
122
quotas/src/model/CreateQuotaApplicationRequest.cc
Normal 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/quotas/model/CreateQuotaApplicationRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::CreateQuotaApplicationRequest;
|
||||
|
||||
CreateQuotaApplicationRequest::CreateQuotaApplicationRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "CreateQuotaApplication")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateQuotaApplicationRequest::~CreateQuotaApplicationRequest()
|
||||
{}
|
||||
|
||||
std::string CreateQuotaApplicationRequest::getReason()const
|
||||
{
|
||||
return reason_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setReason(const std::string& reason)
|
||||
{
|
||||
reason_ = reason;
|
||||
setBodyParameter("Reason", reason);
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationRequest::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setQuotaActionCode(const std::string& quotaActionCode)
|
||||
{
|
||||
quotaActionCode_ = quotaActionCode;
|
||||
setBodyParameter("QuotaActionCode", quotaActionCode);
|
||||
}
|
||||
|
||||
float CreateQuotaApplicationRequest::getDesireValue()const
|
||||
{
|
||||
return desireValue_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setDesireValue(float desireValue)
|
||||
{
|
||||
desireValue_ = desireValue;
|
||||
setBodyParameter("DesireValue", std::to_string(desireValue));
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationRequest::getQuotaCategory()const
|
||||
{
|
||||
return quotaCategory_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setQuotaCategory(const std::string& quotaCategory)
|
||||
{
|
||||
quotaCategory_ = quotaCategory;
|
||||
setBodyParameter("QuotaCategory", quotaCategory);
|
||||
}
|
||||
|
||||
int CreateQuotaApplicationRequest::getNoticeType()const
|
||||
{
|
||||
return noticeType_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setNoticeType(int noticeType)
|
||||
{
|
||||
noticeType_ = noticeType;
|
||||
setBodyParameter("NoticeType", std::to_string(noticeType));
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationRequest::getAuditMode()const
|
||||
{
|
||||
return auditMode_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setAuditMode(const std::string& auditMode)
|
||||
{
|
||||
auditMode_ = auditMode;
|
||||
setBodyParameter("AuditMode", auditMode);
|
||||
}
|
||||
|
||||
std::vector<CreateQuotaApplicationRequest::Dimensions> CreateQuotaApplicationRequest::getDimensions()const
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
void CreateQuotaApplicationRequest::setDimensions(const std::vector<Dimensions>& dimensions)
|
||||
{
|
||||
dimensions_ = dimensions;
|
||||
for(int dep1 = 0; dep1!= dimensions.size(); dep1++) {
|
||||
auto dimensionsObj = dimensions.at(dep1);
|
||||
std::string dimensionsObjStr = "Dimensions." + std::to_string(dep1 + 1);
|
||||
setParameter(dimensionsObjStr + ".Key", dimensionsObj.key);
|
||||
setParameter(dimensionsObjStr + ".Value", dimensionsObj.value);
|
||||
}
|
||||
}
|
||||
|
||||
163
quotas/src/model/CreateQuotaApplicationResult.cc
Normal file
163
quotas/src/model/CreateQuotaApplicationResult.cc
Normal file
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* 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/quotas/model/CreateQuotaApplicationResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
CreateQuotaApplicationResult::CreateQuotaApplicationResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateQuotaApplicationResult::CreateQuotaApplicationResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateQuotaApplicationResult::~CreateQuotaApplicationResult()
|
||||
{}
|
||||
|
||||
void CreateQuotaApplicationResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["ApplyTime"].isNull())
|
||||
applyTime_ = value["ApplyTime"].asString();
|
||||
if(!value["QuotaDescription"].isNull())
|
||||
quotaDescription_ = value["QuotaDescription"].asString();
|
||||
if(!value["EffectiveTime"].isNull())
|
||||
effectiveTime_ = value["EffectiveTime"].asString();
|
||||
if(!value["ProductCode"].isNull())
|
||||
productCode_ = value["ProductCode"].asString();
|
||||
if(!value["QuotaUnit"].isNull())
|
||||
quotaUnit_ = value["QuotaUnit"].asString();
|
||||
if(!value["AuditReason"].isNull())
|
||||
auditReason_ = value["AuditReason"].asString();
|
||||
if(!value["Dimension"].isNull())
|
||||
dimension_ = value["Dimension"].asString();
|
||||
if(!value["ApproveValue"].isNull())
|
||||
approveValue_ = std::stof(value["ApproveValue"].asString());
|
||||
if(!value["Reason"].isNull())
|
||||
reason_ = value["Reason"].asString();
|
||||
if(!value["QuotaActionCode"].isNull())
|
||||
quotaActionCode_ = value["QuotaActionCode"].asString();
|
||||
if(!value["QuotaName"].isNull())
|
||||
quotaName_ = value["QuotaName"].asString();
|
||||
if(!value["QuotaArn"].isNull())
|
||||
quotaArn_ = value["QuotaArn"].asString();
|
||||
if(!value["NoticeType"].isNull())
|
||||
noticeType_ = std::stol(value["NoticeType"].asString());
|
||||
if(!value["ExpireTime"].isNull())
|
||||
expireTime_ = value["ExpireTime"].asString();
|
||||
if(!value["ApplicationId"].isNull())
|
||||
applicationId_ = value["ApplicationId"].asString();
|
||||
if(!value["DesireValue"].isNull())
|
||||
desireValue_ = std::stoi(value["DesireValue"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getApplyTime()const
|
||||
{
|
||||
return applyTime_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getQuotaDescription()const
|
||||
{
|
||||
return quotaDescription_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getEffectiveTime()const
|
||||
{
|
||||
return effectiveTime_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getQuotaUnit()const
|
||||
{
|
||||
return quotaUnit_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getAuditReason()const
|
||||
{
|
||||
return auditReason_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getDimension()const
|
||||
{
|
||||
return dimension_;
|
||||
}
|
||||
|
||||
float CreateQuotaApplicationResult::getApproveValue()const
|
||||
{
|
||||
return approveValue_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getReason()const
|
||||
{
|
||||
return reason_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getQuotaName()const
|
||||
{
|
||||
return quotaName_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getQuotaArn()const
|
||||
{
|
||||
return quotaArn_;
|
||||
}
|
||||
|
||||
long CreateQuotaApplicationResult::getNoticeType()const
|
||||
{
|
||||
return noticeType_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getExpireTime()const
|
||||
{
|
||||
return expireTime_;
|
||||
}
|
||||
|
||||
std::string CreateQuotaApplicationResult::getApplicationId()const
|
||||
{
|
||||
return applicationId_;
|
||||
}
|
||||
|
||||
int CreateQuotaApplicationResult::getDesireValue()const
|
||||
{
|
||||
return desireValue_;
|
||||
}
|
||||
|
||||
40
quotas/src/model/DeleteQuotaAlarmRequest.cc
Normal file
40
quotas/src/model/DeleteQuotaAlarmRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/quotas/model/DeleteQuotaAlarmRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::DeleteQuotaAlarmRequest;
|
||||
|
||||
DeleteQuotaAlarmRequest::DeleteQuotaAlarmRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "DeleteQuotaAlarm")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteQuotaAlarmRequest::~DeleteQuotaAlarmRequest()
|
||||
{}
|
||||
|
||||
std::string DeleteQuotaAlarmRequest::getAlarmId()const
|
||||
{
|
||||
return alarmId_;
|
||||
}
|
||||
|
||||
void DeleteQuotaAlarmRequest::setAlarmId(const std::string& alarmId)
|
||||
{
|
||||
alarmId_ = alarmId;
|
||||
setBodyParameter("AlarmId", alarmId);
|
||||
}
|
||||
|
||||
44
quotas/src/model/DeleteQuotaAlarmResult.cc
Normal file
44
quotas/src/model/DeleteQuotaAlarmResult.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/quotas/model/DeleteQuotaAlarmResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
DeleteQuotaAlarmResult::DeleteQuotaAlarmResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteQuotaAlarmResult::DeleteQuotaAlarmResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteQuotaAlarmResult::~DeleteQuotaAlarmResult()
|
||||
{}
|
||||
|
||||
void DeleteQuotaAlarmResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
}
|
||||
|
||||
67
quotas/src/model/GetProductQuotaDimensionRequest.cc
Normal file
67
quotas/src/model/GetProductQuotaDimensionRequest.cc
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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/quotas/model/GetProductQuotaDimensionRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::GetProductQuotaDimensionRequest;
|
||||
|
||||
GetProductQuotaDimensionRequest::GetProductQuotaDimensionRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "GetProductQuotaDimension")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetProductQuotaDimensionRequest::~GetProductQuotaDimensionRequest()
|
||||
{}
|
||||
|
||||
std::string GetProductQuotaDimensionRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void GetProductQuotaDimensionRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::vector<GetProductQuotaDimensionRequest::DependentDimensions> GetProductQuotaDimensionRequest::getDependentDimensions()const
|
||||
{
|
||||
return dependentDimensions_;
|
||||
}
|
||||
|
||||
void GetProductQuotaDimensionRequest::setDependentDimensions(const std::vector<DependentDimensions>& dependentDimensions)
|
||||
{
|
||||
dependentDimensions_ = dependentDimensions;
|
||||
for(int dep1 = 0; dep1!= dependentDimensions.size(); dep1++) {
|
||||
auto dependentDimensionsObj = dependentDimensions.at(dep1);
|
||||
std::string dependentDimensionsObjStr = "DependentDimensions." + std::to_string(dep1 + 1);
|
||||
setParameter(dependentDimensionsObjStr + ".Key", dependentDimensionsObj.key);
|
||||
setParameter(dependentDimensionsObjStr + ".Value", dependentDimensionsObj.value);
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetProductQuotaDimensionRequest::getDimensionKey()const
|
||||
{
|
||||
return dimensionKey_;
|
||||
}
|
||||
|
||||
void GetProductQuotaDimensionRequest::setDimensionKey(const std::string& dimensionKey)
|
||||
{
|
||||
dimensionKey_ = dimensionKey;
|
||||
setBodyParameter("DimensionKey", dimensionKey);
|
||||
}
|
||||
|
||||
70
quotas/src/model/GetProductQuotaDimensionResult.cc
Normal file
70
quotas/src/model/GetProductQuotaDimensionResult.cc
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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/quotas/model/GetProductQuotaDimensionResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
GetProductQuotaDimensionResult::GetProductQuotaDimensionResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetProductQuotaDimensionResult::GetProductQuotaDimensionResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetProductQuotaDimensionResult::~GetProductQuotaDimensionResult()
|
||||
{}
|
||||
|
||||
void GetProductQuotaDimensionResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto quotaDimensionNode = value["QuotaDimension"];
|
||||
if(!quotaDimensionNode["DimensionKey"].isNull())
|
||||
quotaDimension_.dimensionKey = quotaDimensionNode["DimensionKey"].asString();
|
||||
if(!quotaDimensionNode["Name"].isNull())
|
||||
quotaDimension_.name = quotaDimensionNode["Name"].asString();
|
||||
auto allDimensionValueDetailNode = quotaDimensionNode["DimensionValueDetail"]["DimensionValueDetailItem"];
|
||||
for (auto quotaDimensionNodeDimensionValueDetailDimensionValueDetailItem : allDimensionValueDetailNode)
|
||||
{
|
||||
QuotaDimension::DimensionValueDetailItem dimensionValueDetailItemObject;
|
||||
if(!quotaDimensionNodeDimensionValueDetailDimensionValueDetailItem["Value"].isNull())
|
||||
dimensionValueDetailItemObject.value = quotaDimensionNodeDimensionValueDetailDimensionValueDetailItem["Value"].asString();
|
||||
if(!quotaDimensionNodeDimensionValueDetailDimensionValueDetailItem["Name"].isNull())
|
||||
dimensionValueDetailItemObject.name = quotaDimensionNodeDimensionValueDetailDimensionValueDetailItem["Name"].asString();
|
||||
quotaDimension_.dimensionValueDetail.push_back(dimensionValueDetailItemObject);
|
||||
}
|
||||
auto allDimensionValues = quotaDimensionNode["DimensionValues"]["DimensionValues"];
|
||||
for (auto value : allDimensionValues)
|
||||
quotaDimension_.dimensionValues.push_back(value.asString());
|
||||
auto allDependentDimensions = quotaDimensionNode["DependentDimensions"]["DependentDimensions"];
|
||||
for (auto value : allDependentDimensions)
|
||||
quotaDimension_.dependentDimensions.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
GetProductQuotaDimensionResult::QuotaDimension GetProductQuotaDimensionResult::getQuotaDimension()const
|
||||
{
|
||||
return quotaDimension_;
|
||||
}
|
||||
|
||||
67
quotas/src/model/GetProductQuotaRequest.cc
Normal file
67
quotas/src/model/GetProductQuotaRequest.cc
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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/quotas/model/GetProductQuotaRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::GetProductQuotaRequest;
|
||||
|
||||
GetProductQuotaRequest::GetProductQuotaRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "GetProductQuota")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetProductQuotaRequest::~GetProductQuotaRequest()
|
||||
{}
|
||||
|
||||
std::string GetProductQuotaRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void GetProductQuotaRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string GetProductQuotaRequest::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
void GetProductQuotaRequest::setQuotaActionCode(const std::string& quotaActionCode)
|
||||
{
|
||||
quotaActionCode_ = quotaActionCode;
|
||||
setBodyParameter("QuotaActionCode", quotaActionCode);
|
||||
}
|
||||
|
||||
std::vector<GetProductQuotaRequest::Dimensions> GetProductQuotaRequest::getDimensions()const
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
void GetProductQuotaRequest::setDimensions(const std::vector<Dimensions>& dimensions)
|
||||
{
|
||||
dimensions_ = dimensions;
|
||||
for(int dep1 = 0; dep1!= dimensions.size(); dep1++) {
|
||||
auto dimensionsObj = dimensions.at(dep1);
|
||||
std::string dimensionsObjStr = "Dimensions." + std::to_string(dep1 + 1);
|
||||
setParameter(dimensionsObjStr + ".Key", dimensionsObj.key);
|
||||
setParameter(dimensionsObjStr + ".Value", dimensionsObj.value);
|
||||
}
|
||||
}
|
||||
|
||||
100
quotas/src/model/GetProductQuotaResult.cc
Normal file
100
quotas/src/model/GetProductQuotaResult.cc
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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/quotas/model/GetProductQuotaResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
GetProductQuotaResult::GetProductQuotaResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetProductQuotaResult::GetProductQuotaResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetProductQuotaResult::~GetProductQuotaResult()
|
||||
{}
|
||||
|
||||
void GetProductQuotaResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto quotaNode = value["Quota"];
|
||||
if(!quotaNode["QuotaDescription"].isNull())
|
||||
quota_.quotaDescription = quotaNode["QuotaDescription"].asString();
|
||||
if(!quotaNode["Consumable"].isNull())
|
||||
quota_.consumable = quotaNode["Consumable"].asString() == "true";
|
||||
if(!quotaNode["UnadjustableDetail"].isNull())
|
||||
quota_.unadjustableDetail = quotaNode["UnadjustableDetail"].asString();
|
||||
if(!quotaNode["ProductCode"].isNull())
|
||||
quota_.productCode = quotaNode["ProductCode"].asString();
|
||||
if(!quotaNode["TotalUsage"].isNull())
|
||||
quota_.totalUsage = std::stof(quotaNode["TotalUsage"].asString());
|
||||
if(!quotaNode["QuotaType"].isNull())
|
||||
quota_.quotaType = quotaNode["QuotaType"].asString();
|
||||
if(!quotaNode["Dimensions"].isNull())
|
||||
quota_.dimensions = quotaNode["Dimensions"].asString();
|
||||
if(!quotaNode["QuotaUnit"].isNull())
|
||||
quota_.quotaUnit = quotaNode["QuotaUnit"].asString();
|
||||
if(!quotaNode["Adjustable"].isNull())
|
||||
quota_.adjustable = quotaNode["Adjustable"].asString() == "true";
|
||||
if(!quotaNode["QuotaActionCode"].isNull())
|
||||
quota_.quotaActionCode = quotaNode["QuotaActionCode"].asString();
|
||||
if(!quotaNode["QuotaName"].isNull())
|
||||
quota_.quotaName = quotaNode["QuotaName"].asString();
|
||||
if(!quotaNode["QuotaArn"].isNull())
|
||||
quota_.quotaArn = quotaNode["QuotaArn"].asString();
|
||||
if(!quotaNode["TotalQuota"].isNull())
|
||||
quota_.totalQuota = std::stof(quotaNode["TotalQuota"].asString());
|
||||
if(!quotaNode["ApplicableType"].isNull())
|
||||
quota_.applicableType = quotaNode["ApplicableType"].asString();
|
||||
auto allQuotaItemsNode = quotaNode["QuotaItems"]["QuotaItemsItem"];
|
||||
for (auto quotaNodeQuotaItemsQuotaItemsItem : allQuotaItemsNode)
|
||||
{
|
||||
Quota::QuotaItemsItem quotaItemsItemObject;
|
||||
if(!quotaNodeQuotaItemsQuotaItemsItem["Usage"].isNull())
|
||||
quotaItemsItemObject.usage = quotaNodeQuotaItemsQuotaItemsItem["Usage"].asString();
|
||||
if(!quotaNodeQuotaItemsQuotaItemsItem["Type"].isNull())
|
||||
quotaItemsItemObject.type = quotaNodeQuotaItemsQuotaItemsItem["Type"].asString();
|
||||
if(!quotaNodeQuotaItemsQuotaItemsItem["Quota"].isNull())
|
||||
quotaItemsItemObject.quota = quotaNodeQuotaItemsQuotaItemsItem["Quota"].asString();
|
||||
if(!quotaNodeQuotaItemsQuotaItemsItem["QuotaUnit"].isNull())
|
||||
quotaItemsItemObject.quotaUnit = quotaNodeQuotaItemsQuotaItemsItem["QuotaUnit"].asString();
|
||||
quota_.quotaItems.push_back(quotaItemsItemObject);
|
||||
}
|
||||
auto periodNode = quotaNode["Period"];
|
||||
if(!periodNode["PeriodValue"].isNull())
|
||||
quota_.period.periodValue = std::stoi(periodNode["PeriodValue"].asString());
|
||||
if(!periodNode["PeriodUnit"].isNull())
|
||||
quota_.period.periodUnit = periodNode["PeriodUnit"].asString();
|
||||
auto allApplicableRange = quotaNode["ApplicableRange"]["ApplicableRange"];
|
||||
for (auto value : allApplicableRange)
|
||||
quota_.applicableRange.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
GetProductQuotaResult::Quota GetProductQuotaResult::getQuota()const
|
||||
{
|
||||
return quota_;
|
||||
}
|
||||
|
||||
40
quotas/src/model/GetQuotaAlarmRequest.cc
Normal file
40
quotas/src/model/GetQuotaAlarmRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/quotas/model/GetQuotaAlarmRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::GetQuotaAlarmRequest;
|
||||
|
||||
GetQuotaAlarmRequest::GetQuotaAlarmRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "GetQuotaAlarm")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetQuotaAlarmRequest::~GetQuotaAlarmRequest()
|
||||
{}
|
||||
|
||||
std::string GetQuotaAlarmRequest::getAlarmId()const
|
||||
{
|
||||
return alarmId_;
|
||||
}
|
||||
|
||||
void GetQuotaAlarmRequest::setAlarmId(const std::string& alarmId)
|
||||
{
|
||||
alarmId_ = alarmId;
|
||||
setBodyParameter("AlarmId", alarmId);
|
||||
}
|
||||
|
||||
77
quotas/src/model/GetQuotaAlarmResult.cc
Normal file
77
quotas/src/model/GetQuotaAlarmResult.cc
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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/quotas/model/GetQuotaAlarmResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
GetQuotaAlarmResult::GetQuotaAlarmResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetQuotaAlarmResult::GetQuotaAlarmResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetQuotaAlarmResult::~GetQuotaAlarmResult()
|
||||
{}
|
||||
|
||||
void GetQuotaAlarmResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto quotaAlarmNode = value["QuotaAlarm"];
|
||||
if(!quotaAlarmNode["AlarmId"].isNull())
|
||||
quotaAlarm_.alarmId = quotaAlarmNode["AlarmId"].asString();
|
||||
if(!quotaAlarmNode["QuotaActionCode"].isNull())
|
||||
quotaAlarm_.quotaActionCode = quotaAlarmNode["QuotaActionCode"].asString();
|
||||
if(!quotaAlarmNode["QuotaValue"].isNull())
|
||||
quotaAlarm_.quotaValue = std::stof(quotaAlarmNode["QuotaValue"].asString());
|
||||
if(!quotaAlarmNode["ThresholdPercent"].isNull())
|
||||
quotaAlarm_.thresholdPercent = std::stof(quotaAlarmNode["ThresholdPercent"].asString());
|
||||
if(!quotaAlarmNode["AlarmName"].isNull())
|
||||
quotaAlarm_.alarmName = quotaAlarmNode["AlarmName"].asString();
|
||||
if(!quotaAlarmNode["ProductCode"].isNull())
|
||||
quotaAlarm_.productCode = quotaAlarmNode["ProductCode"].asString();
|
||||
if(!quotaAlarmNode["NotifyTarget"].isNull())
|
||||
quotaAlarm_.notifyTarget = quotaAlarmNode["NotifyTarget"].asString();
|
||||
if(!quotaAlarmNode["CreateTime"].isNull())
|
||||
quotaAlarm_.createTime = quotaAlarmNode["CreateTime"].asString();
|
||||
if(!quotaAlarmNode["QuotaDimension"].isNull())
|
||||
quotaAlarm_.quotaDimension = quotaAlarmNode["QuotaDimension"].asString();
|
||||
if(!quotaAlarmNode["QuotaUsage"].isNull())
|
||||
quotaAlarm_.quotaUsage = std::stof(quotaAlarmNode["QuotaUsage"].asString());
|
||||
if(!quotaAlarmNode["Threshold"].isNull())
|
||||
quotaAlarm_.threshold = std::stof(quotaAlarmNode["Threshold"].asString());
|
||||
if(!quotaAlarmNode["ThresholdType"].isNull())
|
||||
quotaAlarm_.thresholdType = quotaAlarmNode["ThresholdType"].asString();
|
||||
auto allNotifyChannels = quotaAlarmNode["NotifyChannels"]["NotifyChannels"];
|
||||
for (auto value : allNotifyChannels)
|
||||
quotaAlarm_.notifyChannels.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
GetQuotaAlarmResult::QuotaAlarm GetQuotaAlarmResult::getQuotaAlarm()const
|
||||
{
|
||||
return quotaAlarm_;
|
||||
}
|
||||
|
||||
40
quotas/src/model/GetQuotaApplicationRequest.cc
Normal file
40
quotas/src/model/GetQuotaApplicationRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/quotas/model/GetQuotaApplicationRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::GetQuotaApplicationRequest;
|
||||
|
||||
GetQuotaApplicationRequest::GetQuotaApplicationRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "GetQuotaApplication")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetQuotaApplicationRequest::~GetQuotaApplicationRequest()
|
||||
{}
|
||||
|
||||
std::string GetQuotaApplicationRequest::getApplicationId()const
|
||||
{
|
||||
return applicationId_;
|
||||
}
|
||||
|
||||
void GetQuotaApplicationRequest::setApplicationId(const std::string& applicationId)
|
||||
{
|
||||
applicationId_ = applicationId;
|
||||
setBodyParameter("ApplicationId", applicationId);
|
||||
}
|
||||
|
||||
84
quotas/src/model/GetQuotaApplicationResult.cc
Normal file
84
quotas/src/model/GetQuotaApplicationResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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/quotas/model/GetQuotaApplicationResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
GetQuotaApplicationResult::GetQuotaApplicationResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetQuotaApplicationResult::GetQuotaApplicationResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetQuotaApplicationResult::~GetQuotaApplicationResult()
|
||||
{}
|
||||
|
||||
void GetQuotaApplicationResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto quotaApplicationNode = value["QuotaApplication"];
|
||||
if(!quotaApplicationNode["Status"].isNull())
|
||||
quotaApplication_.status = quotaApplicationNode["Status"].asString();
|
||||
if(!quotaApplicationNode["ApplyTime"].isNull())
|
||||
quotaApplication_.applyTime = quotaApplicationNode["ApplyTime"].asString();
|
||||
if(!quotaApplicationNode["QuotaDescription"].isNull())
|
||||
quotaApplication_.quotaDescription = quotaApplicationNode["QuotaDescription"].asString();
|
||||
if(!quotaApplicationNode["EffectiveTime"].isNull())
|
||||
quotaApplication_.effectiveTime = quotaApplicationNode["EffectiveTime"].asString();
|
||||
if(!quotaApplicationNode["ProductCode"].isNull())
|
||||
quotaApplication_.productCode = quotaApplicationNode["ProductCode"].asString();
|
||||
if(!quotaApplicationNode["QuotaUnit"].isNull())
|
||||
quotaApplication_.quotaUnit = quotaApplicationNode["QuotaUnit"].asString();
|
||||
if(!quotaApplicationNode["AuditReason"].isNull())
|
||||
quotaApplication_.auditReason = quotaApplicationNode["AuditReason"].asString();
|
||||
if(!quotaApplicationNode["Dimension"].isNull())
|
||||
quotaApplication_.dimension = quotaApplicationNode["Dimension"].asString();
|
||||
if(!quotaApplicationNode["ApproveValue"].isNull())
|
||||
quotaApplication_.approveValue = std::stof(quotaApplicationNode["ApproveValue"].asString());
|
||||
if(!quotaApplicationNode["Reason"].isNull())
|
||||
quotaApplication_.reason = quotaApplicationNode["Reason"].asString();
|
||||
if(!quotaApplicationNode["QuotaActionCode"].isNull())
|
||||
quotaApplication_.quotaActionCode = quotaApplicationNode["QuotaActionCode"].asString();
|
||||
if(!quotaApplicationNode["QuotaName"].isNull())
|
||||
quotaApplication_.quotaName = quotaApplicationNode["QuotaName"].asString();
|
||||
if(!quotaApplicationNode["QuotaArn"].isNull())
|
||||
quotaApplication_.quotaArn = quotaApplicationNode["QuotaArn"].asString();
|
||||
if(!quotaApplicationNode["NoticeType"].isNull())
|
||||
quotaApplication_.noticeType = std::stol(quotaApplicationNode["NoticeType"].asString());
|
||||
if(!quotaApplicationNode["ExpireTime"].isNull())
|
||||
quotaApplication_.expireTime = quotaApplicationNode["ExpireTime"].asString();
|
||||
if(!quotaApplicationNode["ApplicationId"].isNull())
|
||||
quotaApplication_.applicationId = quotaApplicationNode["ApplicationId"].asString();
|
||||
if(!quotaApplicationNode["DesireValue"].isNull())
|
||||
quotaApplication_.desireValue = std::stoi(quotaApplicationNode["DesireValue"].asString());
|
||||
|
||||
}
|
||||
|
||||
GetQuotaApplicationResult::QuotaApplication GetQuotaApplicationResult::getQuotaApplication()const
|
||||
{
|
||||
return quotaApplication_;
|
||||
}
|
||||
|
||||
95
quotas/src/model/ListAlarmHistoriesRequest.cc
Normal file
95
quotas/src/model/ListAlarmHistoriesRequest.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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/quotas/model/ListAlarmHistoriesRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListAlarmHistoriesRequest;
|
||||
|
||||
ListAlarmHistoriesRequest::ListAlarmHistoriesRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListAlarmHistories")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListAlarmHistoriesRequest::~ListAlarmHistoriesRequest()
|
||||
{}
|
||||
|
||||
std::string ListAlarmHistoriesRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListAlarmHistoriesRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
long ListAlarmHistoriesRequest::getStartTime()const
|
||||
{
|
||||
return startTime_;
|
||||
}
|
||||
|
||||
void ListAlarmHistoriesRequest::setStartTime(long startTime)
|
||||
{
|
||||
startTime_ = startTime;
|
||||
setBodyParameter("StartTime", std::to_string(startTime));
|
||||
}
|
||||
|
||||
std::string ListAlarmHistoriesRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListAlarmHistoriesRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setBodyParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
std::string ListAlarmHistoriesRequest::getKeyword()const
|
||||
{
|
||||
return keyword_;
|
||||
}
|
||||
|
||||
void ListAlarmHistoriesRequest::setKeyword(const std::string& keyword)
|
||||
{
|
||||
keyword_ = keyword;
|
||||
setBodyParameter("Keyword", keyword);
|
||||
}
|
||||
|
||||
long ListAlarmHistoriesRequest::getEndTime()const
|
||||
{
|
||||
return endTime_;
|
||||
}
|
||||
|
||||
void ListAlarmHistoriesRequest::setEndTime(long endTime)
|
||||
{
|
||||
endTime_ = endTime;
|
||||
setBodyParameter("EndTime", std::to_string(endTime));
|
||||
}
|
||||
|
||||
int ListAlarmHistoriesRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListAlarmHistoriesRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setBodyParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
95
quotas/src/model/ListAlarmHistoriesResult.cc
Normal file
95
quotas/src/model/ListAlarmHistoriesResult.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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/quotas/model/ListAlarmHistoriesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListAlarmHistoriesResult::ListAlarmHistoriesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListAlarmHistoriesResult::ListAlarmHistoriesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListAlarmHistoriesResult::~ListAlarmHistoriesResult()
|
||||
{}
|
||||
|
||||
void ListAlarmHistoriesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allAlarmHistoriesNode = value["AlarmHistories"]["AlarmHistory"];
|
||||
for (auto valueAlarmHistoriesAlarmHistory : allAlarmHistoriesNode)
|
||||
{
|
||||
AlarmHistory alarmHistoriesObject;
|
||||
if(!valueAlarmHistoriesAlarmHistory["AlarmName"].isNull())
|
||||
alarmHistoriesObject.alarmName = valueAlarmHistoriesAlarmHistory["AlarmName"].asString();
|
||||
if(!valueAlarmHistoriesAlarmHistory["QuotaUsage"].isNull())
|
||||
alarmHistoriesObject.quotaUsage = std::stof(valueAlarmHistoriesAlarmHistory["QuotaUsage"].asString());
|
||||
if(!valueAlarmHistoriesAlarmHistory["ProductCode"].isNull())
|
||||
alarmHistoriesObject.productCode = valueAlarmHistoriesAlarmHistory["ProductCode"].asString();
|
||||
if(!valueAlarmHistoriesAlarmHistory["CreateTime"].isNull())
|
||||
alarmHistoriesObject.createTime = valueAlarmHistoriesAlarmHistory["CreateTime"].asString();
|
||||
if(!valueAlarmHistoriesAlarmHistory["NotifyTarget"].isNull())
|
||||
alarmHistoriesObject.notifyTarget = valueAlarmHistoriesAlarmHistory["NotifyTarget"].asString();
|
||||
if(!valueAlarmHistoriesAlarmHistory["Threshold"].isNull())
|
||||
alarmHistoriesObject.threshold = std::stof(valueAlarmHistoriesAlarmHistory["Threshold"].asString());
|
||||
if(!valueAlarmHistoriesAlarmHistory["ThresholdPercent"].isNull())
|
||||
alarmHistoriesObject.thresholdPercent = std::stof(valueAlarmHistoriesAlarmHistory["ThresholdPercent"].asString());
|
||||
if(!valueAlarmHistoriesAlarmHistory["QuotaActionCode"].isNull())
|
||||
alarmHistoriesObject.quotaActionCode = valueAlarmHistoriesAlarmHistory["QuotaActionCode"].asString();
|
||||
auto allNotifyChannels = value["NotifyChannels"]["NotifyChannels"];
|
||||
for (auto value : allNotifyChannels)
|
||||
alarmHistoriesObject.notifyChannels.push_back(value.asString());
|
||||
alarmHistories_.push_back(alarmHistoriesObject);
|
||||
}
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
|
||||
}
|
||||
|
||||
int ListAlarmHistoriesResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListAlarmHistoriesResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
int ListAlarmHistoriesResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
std::vector<ListAlarmHistoriesResult::AlarmHistory> ListAlarmHistoriesResult::getAlarmHistories()const
|
||||
{
|
||||
return alarmHistories_;
|
||||
}
|
||||
|
||||
51
quotas/src/model/ListDependentQuotasRequest.cc
Normal file
51
quotas/src/model/ListDependentQuotasRequest.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/quotas/model/ListDependentQuotasRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListDependentQuotasRequest;
|
||||
|
||||
ListDependentQuotasRequest::ListDependentQuotasRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListDependentQuotas")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListDependentQuotasRequest::~ListDependentQuotasRequest()
|
||||
{}
|
||||
|
||||
std::string ListDependentQuotasRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListDependentQuotasRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListDependentQuotasRequest::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
void ListDependentQuotasRequest::setQuotaActionCode(const std::string& quotaActionCode)
|
||||
{
|
||||
quotaActionCode_ = quotaActionCode;
|
||||
setBodyParameter("QuotaActionCode", quotaActionCode);
|
||||
}
|
||||
|
||||
75
quotas/src/model/ListDependentQuotasResult.cc
Normal file
75
quotas/src/model/ListDependentQuotasResult.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/quotas/model/ListDependentQuotasResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListDependentQuotasResult::ListDependentQuotasResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListDependentQuotasResult::ListDependentQuotasResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListDependentQuotasResult::~ListDependentQuotasResult()
|
||||
{}
|
||||
|
||||
void ListDependentQuotasResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allQuotasNode = value["Quotas"]["QuotasItem"];
|
||||
for (auto valueQuotasQuotasItem : allQuotasNode)
|
||||
{
|
||||
QuotasItem quotasObject;
|
||||
if(!valueQuotasQuotasItem["QuotaActionCode"].isNull())
|
||||
quotasObject.quotaActionCode = valueQuotasQuotasItem["QuotaActionCode"].asString();
|
||||
if(!valueQuotasQuotasItem["ProductCode"].isNull())
|
||||
quotasObject.productCode = valueQuotasQuotasItem["ProductCode"].asString();
|
||||
if(!valueQuotasQuotasItem["Scale"].isNull())
|
||||
quotasObject.scale = std::stof(valueQuotasQuotasItem["Scale"].asString());
|
||||
auto allDimensionsNode = valueQuotasQuotasItem["Dimensions"]["DimensionsItem"];
|
||||
for (auto valueQuotasQuotasItemDimensionsDimensionsItem : allDimensionsNode)
|
||||
{
|
||||
QuotasItem::DimensionsItem dimensionsObject;
|
||||
if(!valueQuotasQuotasItemDimensionsDimensionsItem["DimensionKey"].isNull())
|
||||
dimensionsObject.dimensionKey = valueQuotasQuotasItemDimensionsDimensionsItem["DimensionKey"].asString();
|
||||
auto allDimensionValues = value["DimensionValues"]["DimensionValues"];
|
||||
for (auto value : allDimensionValues)
|
||||
dimensionsObject.dimensionValues.push_back(value.asString());
|
||||
auto allDependentDimension = value["DependentDimension"]["DependentDimension"];
|
||||
for (auto value : allDependentDimension)
|
||||
dimensionsObject.dependentDimension.push_back(value.asString());
|
||||
quotasObject.dimensions.push_back(dimensionsObject);
|
||||
}
|
||||
quotas_.push_back(quotasObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListDependentQuotasResult::QuotasItem> ListDependentQuotasResult::getQuotas()const
|
||||
{
|
||||
return quotas_;
|
||||
}
|
||||
|
||||
62
quotas/src/model/ListProductDimensionGroupsRequest.cc
Normal file
62
quotas/src/model/ListProductDimensionGroupsRequest.cc
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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/quotas/model/ListProductDimensionGroupsRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListProductDimensionGroupsRequest;
|
||||
|
||||
ListProductDimensionGroupsRequest::ListProductDimensionGroupsRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListProductDimensionGroups")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
ListProductDimensionGroupsRequest::~ListProductDimensionGroupsRequest()
|
||||
{}
|
||||
|
||||
std::string ListProductDimensionGroupsRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListProductDimensionGroupsRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListProductDimensionGroupsRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListProductDimensionGroupsRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
int ListProductDimensionGroupsRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListProductDimensionGroupsRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
85
quotas/src/model/ListProductDimensionGroupsResult.cc
Normal file
85
quotas/src/model/ListProductDimensionGroupsResult.cc
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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/quotas/model/ListProductDimensionGroupsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListProductDimensionGroupsResult::ListProductDimensionGroupsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListProductDimensionGroupsResult::ListProductDimensionGroupsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListProductDimensionGroupsResult::~ListProductDimensionGroupsResult()
|
||||
{}
|
||||
|
||||
void ListProductDimensionGroupsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allDimensionGroupsNode = value["DimensionGroups"]["DimensionGroupsItem"];
|
||||
for (auto valueDimensionGroupsDimensionGroupsItem : allDimensionGroupsNode)
|
||||
{
|
||||
DimensionGroupsItem dimensionGroupsObject;
|
||||
if(!valueDimensionGroupsDimensionGroupsItem["GroupName"].isNull())
|
||||
dimensionGroupsObject.groupName = valueDimensionGroupsDimensionGroupsItem["GroupName"].asString();
|
||||
if(!valueDimensionGroupsDimensionGroupsItem["ProductCode"].isNull())
|
||||
dimensionGroupsObject.productCode = valueDimensionGroupsDimensionGroupsItem["ProductCode"].asString();
|
||||
if(!valueDimensionGroupsDimensionGroupsItem["GroupCode"].isNull())
|
||||
dimensionGroupsObject.groupCode = valueDimensionGroupsDimensionGroupsItem["GroupCode"].asString();
|
||||
auto allDimensionKeys = value["DimensionKeys"]["DimensionKeys"];
|
||||
for (auto value : allDimensionKeys)
|
||||
dimensionGroupsObject.dimensionKeys.push_back(value.asString());
|
||||
dimensionGroups_.push_back(dimensionGroupsObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
|
||||
}
|
||||
|
||||
int ListProductDimensionGroupsResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListProductDimensionGroupsResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
int ListProductDimensionGroupsResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
std::vector<ListProductDimensionGroupsResult::DimensionGroupsItem> ListProductDimensionGroupsResult::getDimensionGroups()const
|
||||
{
|
||||
return dimensionGroups_;
|
||||
}
|
||||
|
||||
73
quotas/src/model/ListProductQuotaDimensionsRequest.cc
Normal file
73
quotas/src/model/ListProductQuotaDimensionsRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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/quotas/model/ListProductQuotaDimensionsRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListProductQuotaDimensionsRequest;
|
||||
|
||||
ListProductQuotaDimensionsRequest::ListProductQuotaDimensionsRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListProductQuotaDimensions")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListProductQuotaDimensionsRequest::~ListProductQuotaDimensionsRequest()
|
||||
{}
|
||||
|
||||
std::string ListProductQuotaDimensionsRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListProductQuotaDimensionsRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListProductQuotaDimensionsRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListProductQuotaDimensionsRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setBodyParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
int ListProductQuotaDimensionsRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListProductQuotaDimensionsRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setBodyParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
std::string ListProductQuotaDimensionsRequest::getQuotaCategory()const
|
||||
{
|
||||
return quotaCategory_;
|
||||
}
|
||||
|
||||
void ListProductQuotaDimensionsRequest::setQuotaCategory(const std::string& quotaCategory)
|
||||
{
|
||||
quotaCategory_ = quotaCategory;
|
||||
setBodyParameter("QuotaCategory", quotaCategory);
|
||||
}
|
||||
|
||||
98
quotas/src/model/ListProductQuotaDimensionsResult.cc
Normal file
98
quotas/src/model/ListProductQuotaDimensionsResult.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/quotas/model/ListProductQuotaDimensionsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListProductQuotaDimensionsResult::ListProductQuotaDimensionsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListProductQuotaDimensionsResult::ListProductQuotaDimensionsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListProductQuotaDimensionsResult::~ListProductQuotaDimensionsResult()
|
||||
{}
|
||||
|
||||
void ListProductQuotaDimensionsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allQuotaDimensionsNode = value["QuotaDimensions"]["QuotaDimensionsItem"];
|
||||
for (auto valueQuotaDimensionsQuotaDimensionsItem : allQuotaDimensionsNode)
|
||||
{
|
||||
QuotaDimensionsItem quotaDimensionsObject;
|
||||
if(!valueQuotaDimensionsQuotaDimensionsItem["DimensionKey"].isNull())
|
||||
quotaDimensionsObject.dimensionKey = valueQuotaDimensionsQuotaDimensionsItem["DimensionKey"].asString();
|
||||
if(!valueQuotaDimensionsQuotaDimensionsItem["Name"].isNull())
|
||||
quotaDimensionsObject.name = valueQuotaDimensionsQuotaDimensionsItem["Name"].asString();
|
||||
if(!valueQuotaDimensionsQuotaDimensionsItem["Requisite"].isNull())
|
||||
quotaDimensionsObject.requisite = valueQuotaDimensionsQuotaDimensionsItem["Requisite"].asString() == "true";
|
||||
auto allDimensionValueDetailNode = valueQuotaDimensionsQuotaDimensionsItem["DimensionValueDetail"]["DimensionValueDetailItem"];
|
||||
for (auto valueQuotaDimensionsQuotaDimensionsItemDimensionValueDetailDimensionValueDetailItem : allDimensionValueDetailNode)
|
||||
{
|
||||
QuotaDimensionsItem::DimensionValueDetailItem dimensionValueDetailObject;
|
||||
if(!valueQuotaDimensionsQuotaDimensionsItemDimensionValueDetailDimensionValueDetailItem["Value"].isNull())
|
||||
dimensionValueDetailObject.value = valueQuotaDimensionsQuotaDimensionsItemDimensionValueDetailDimensionValueDetailItem["Value"].asString();
|
||||
if(!valueQuotaDimensionsQuotaDimensionsItemDimensionValueDetailDimensionValueDetailItem["Name"].isNull())
|
||||
dimensionValueDetailObject.name = valueQuotaDimensionsQuotaDimensionsItemDimensionValueDetailDimensionValueDetailItem["Name"].asString();
|
||||
quotaDimensionsObject.dimensionValueDetail.push_back(dimensionValueDetailObject);
|
||||
}
|
||||
auto allDimensionValues = value["DimensionValues"]["DimensionValues"];
|
||||
for (auto value : allDimensionValues)
|
||||
quotaDimensionsObject.dimensionValues.push_back(value.asString());
|
||||
auto allDependentDimensions = value["DependentDimensions"]["DependentDimension"];
|
||||
for (auto value : allDependentDimensions)
|
||||
quotaDimensionsObject.dependentDimensions.push_back(value.asString());
|
||||
quotaDimensions_.push_back(quotaDimensionsObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListProductQuotaDimensionsResult::QuotaDimensionsItem> ListProductQuotaDimensionsResult::getQuotaDimensions()const
|
||||
{
|
||||
return quotaDimensions_;
|
||||
}
|
||||
|
||||
int ListProductQuotaDimensionsResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListProductQuotaDimensionsResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
int ListProductQuotaDimensionsResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
144
quotas/src/model/ListProductQuotasRequest.cc
Normal file
144
quotas/src/model/ListProductQuotasRequest.cc
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* 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/quotas/model/ListProductQuotasRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListProductQuotasRequest;
|
||||
|
||||
ListProductQuotasRequest::ListProductQuotasRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListProductQuotas")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListProductQuotasRequest::~ListProductQuotasRequest()
|
||||
{}
|
||||
|
||||
std::string ListProductQuotasRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListProductQuotasRequest::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setQuotaActionCode(const std::string& quotaActionCode)
|
||||
{
|
||||
quotaActionCode_ = quotaActionCode;
|
||||
setBodyParameter("QuotaActionCode", quotaActionCode);
|
||||
}
|
||||
|
||||
std::string ListProductQuotasRequest::getGroupCode()const
|
||||
{
|
||||
return groupCode_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setGroupCode(const std::string& groupCode)
|
||||
{
|
||||
groupCode_ = groupCode;
|
||||
setBodyParameter("GroupCode", groupCode);
|
||||
}
|
||||
|
||||
std::string ListProductQuotasRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setBodyParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
std::string ListProductQuotasRequest::getSortOrder()const
|
||||
{
|
||||
return sortOrder_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setSortOrder(const std::string& sortOrder)
|
||||
{
|
||||
sortOrder_ = sortOrder;
|
||||
setBodyParameter("SortOrder", sortOrder);
|
||||
}
|
||||
|
||||
std::string ListProductQuotasRequest::getKeyWord()const
|
||||
{
|
||||
return keyWord_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setKeyWord(const std::string& keyWord)
|
||||
{
|
||||
keyWord_ = keyWord;
|
||||
setBodyParameter("KeyWord", keyWord);
|
||||
}
|
||||
|
||||
std::string ListProductQuotasRequest::getQuotaCategory()const
|
||||
{
|
||||
return quotaCategory_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setQuotaCategory(const std::string& quotaCategory)
|
||||
{
|
||||
quotaCategory_ = quotaCategory;
|
||||
setBodyParameter("QuotaCategory", quotaCategory);
|
||||
}
|
||||
|
||||
int ListProductQuotasRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setBodyParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
std::string ListProductQuotasRequest::getSortField()const
|
||||
{
|
||||
return sortField_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setSortField(const std::string& sortField)
|
||||
{
|
||||
sortField_ = sortField;
|
||||
setBodyParameter("SortField", sortField);
|
||||
}
|
||||
|
||||
std::vector<ListProductQuotasRequest::Dimensions> ListProductQuotasRequest::getDimensions()const
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
void ListProductQuotasRequest::setDimensions(const std::vector<Dimensions>& dimensions)
|
||||
{
|
||||
dimensions_ = dimensions;
|
||||
for(int dep1 = 0; dep1!= dimensions.size(); dep1++) {
|
||||
auto dimensionsObj = dimensions.at(dep1);
|
||||
std::string dimensionsObjStr = "Dimensions." + std::to_string(dep1 + 1);
|
||||
setParameter(dimensionsObjStr + ".Key", dimensionsObj.key);
|
||||
setParameter(dimensionsObjStr + ".Value", dimensionsObj.value);
|
||||
}
|
||||
}
|
||||
|
||||
126
quotas/src/model/ListProductQuotasResult.cc
Normal file
126
quotas/src/model/ListProductQuotasResult.cc
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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/quotas/model/ListProductQuotasResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListProductQuotasResult::ListProductQuotasResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListProductQuotasResult::ListProductQuotasResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListProductQuotasResult::~ListProductQuotasResult()
|
||||
{}
|
||||
|
||||
void ListProductQuotasResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allQuotasNode = value["Quotas"]["QuotasItem"];
|
||||
for (auto valueQuotasQuotasItem : allQuotasNode)
|
||||
{
|
||||
QuotasItem quotasObject;
|
||||
if(!valueQuotasQuotasItem["QuotaDescription"].isNull())
|
||||
quotasObject.quotaDescription = valueQuotasQuotasItem["QuotaDescription"].asString();
|
||||
if(!valueQuotasQuotasItem["Consumable"].isNull())
|
||||
quotasObject.consumable = valueQuotasQuotasItem["Consumable"].asString() == "true";
|
||||
if(!valueQuotasQuotasItem["UnadjustableDetail"].isNull())
|
||||
quotasObject.unadjustableDetail = valueQuotasQuotasItem["UnadjustableDetail"].asString();
|
||||
if(!valueQuotasQuotasItem["ProductCode"].isNull())
|
||||
quotasObject.productCode = valueQuotasQuotasItem["ProductCode"].asString();
|
||||
if(!valueQuotasQuotasItem["TotalUsage"].isNull())
|
||||
quotasObject.totalUsage = std::stof(valueQuotasQuotasItem["TotalUsage"].asString());
|
||||
if(!valueQuotasQuotasItem["QuotaType"].isNull())
|
||||
quotasObject.quotaType = valueQuotasQuotasItem["QuotaType"].asString();
|
||||
if(!valueQuotasQuotasItem["Dimensions"].isNull())
|
||||
quotasObject.dimensions = valueQuotasQuotasItem["Dimensions"].asString();
|
||||
if(!valueQuotasQuotasItem["QuotaUnit"].isNull())
|
||||
quotasObject.quotaUnit = valueQuotasQuotasItem["QuotaUnit"].asString();
|
||||
if(!valueQuotasQuotasItem["Adjustable"].isNull())
|
||||
quotasObject.adjustable = valueQuotasQuotasItem["Adjustable"].asString() == "true";
|
||||
if(!valueQuotasQuotasItem["QuotaActionCode"].isNull())
|
||||
quotasObject.quotaActionCode = valueQuotasQuotasItem["QuotaActionCode"].asString();
|
||||
if(!valueQuotasQuotasItem["QuotaName"].isNull())
|
||||
quotasObject.quotaName = valueQuotasQuotasItem["QuotaName"].asString();
|
||||
if(!valueQuotasQuotasItem["QuotaArn"].isNull())
|
||||
quotasObject.quotaArn = valueQuotasQuotasItem["QuotaArn"].asString();
|
||||
if(!valueQuotasQuotasItem["TotalQuota"].isNull())
|
||||
quotasObject.totalQuota = std::stof(valueQuotasQuotasItem["TotalQuota"].asString());
|
||||
if(!valueQuotasQuotasItem["ApplicableType"].isNull())
|
||||
quotasObject.applicableType = valueQuotasQuotasItem["ApplicableType"].asString();
|
||||
auto allQuotaItemsNode = valueQuotasQuotasItem["QuotaItems"]["QuotaItemsItem"];
|
||||
for (auto valueQuotasQuotasItemQuotaItemsQuotaItemsItem : allQuotaItemsNode)
|
||||
{
|
||||
QuotasItem::QuotaItemsItem quotaItemsObject;
|
||||
if(!valueQuotasQuotasItemQuotaItemsQuotaItemsItem["Usage"].isNull())
|
||||
quotaItemsObject.usage = valueQuotasQuotasItemQuotaItemsQuotaItemsItem["Usage"].asString();
|
||||
if(!valueQuotasQuotasItemQuotaItemsQuotaItemsItem["Type"].isNull())
|
||||
quotaItemsObject.type = valueQuotasQuotasItemQuotaItemsQuotaItemsItem["Type"].asString();
|
||||
if(!valueQuotasQuotasItemQuotaItemsQuotaItemsItem["Quota"].isNull())
|
||||
quotaItemsObject.quota = valueQuotasQuotasItemQuotaItemsQuotaItemsItem["Quota"].asString();
|
||||
if(!valueQuotasQuotasItemQuotaItemsQuotaItemsItem["QuotaUnit"].isNull())
|
||||
quotaItemsObject.quotaUnit = valueQuotasQuotasItemQuotaItemsQuotaItemsItem["QuotaUnit"].asString();
|
||||
quotasObject.quotaItems.push_back(quotaItemsObject);
|
||||
}
|
||||
auto periodNode = value["Period"];
|
||||
if(!periodNode["PeriodValue"].isNull())
|
||||
quotasObject.period.periodValue = std::stoi(periodNode["PeriodValue"].asString());
|
||||
if(!periodNode["PeriodUnit"].isNull())
|
||||
quotasObject.period.periodUnit = periodNode["PeriodUnit"].asString();
|
||||
auto allApplicableRange = value["ApplicableRange"]["ApplicableRange"];
|
||||
for (auto value : allApplicableRange)
|
||||
quotasObject.applicableRange.push_back(value.asString());
|
||||
quotas_.push_back(quotasObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
|
||||
}
|
||||
|
||||
int ListProductQuotasResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListProductQuotasResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
std::vector<ListProductQuotasResult::QuotasItem> ListProductQuotasResult::getQuotas()const
|
||||
{
|
||||
return quotas_;
|
||||
}
|
||||
|
||||
int ListProductQuotasResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
51
quotas/src/model/ListProductsRequest.cc
Normal file
51
quotas/src/model/ListProductsRequest.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/quotas/model/ListProductsRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListProductsRequest;
|
||||
|
||||
ListProductsRequest::ListProductsRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListProducts")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListProductsRequest::~ListProductsRequest()
|
||||
{}
|
||||
|
||||
std::string ListProductsRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListProductsRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setBodyParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
int ListProductsRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListProductsRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setBodyParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
94
quotas/src/model/ListProductsResult.cc
Normal file
94
quotas/src/model/ListProductsResult.cc
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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/quotas/model/ListProductsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListProductsResult::ListProductsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListProductsResult::ListProductsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListProductsResult::~ListProductsResult()
|
||||
{}
|
||||
|
||||
void ListProductsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allProductInfoNode = value["ProductInfo"]["ProductInfos"];
|
||||
for (auto valueProductInfoProductInfos : allProductInfoNode)
|
||||
{
|
||||
ProductInfos productInfoObject;
|
||||
if(!valueProductInfoProductInfos["SecondCategoryNameEn"].isNull())
|
||||
productInfoObject.secondCategoryNameEn = valueProductInfoProductInfos["SecondCategoryNameEn"].asString();
|
||||
if(!valueProductInfoProductInfos["Dynamic"].isNull())
|
||||
productInfoObject.dynamic = valueProductInfoProductInfos["Dynamic"].asString() == "true";
|
||||
if(!valueProductInfoProductInfos["CommonQuotaSupport"].isNull())
|
||||
productInfoObject.commonQuotaSupport = valueProductInfoProductInfos["CommonQuotaSupport"].asString();
|
||||
if(!valueProductInfoProductInfos["ProductName"].isNull())
|
||||
productInfoObject.productName = valueProductInfoProductInfos["ProductName"].asString();
|
||||
if(!valueProductInfoProductInfos["ProductCode"].isNull())
|
||||
productInfoObject.productCode = valueProductInfoProductInfos["ProductCode"].asString();
|
||||
if(!valueProductInfoProductInfos["SecondCategoryName"].isNull())
|
||||
productInfoObject.secondCategoryName = valueProductInfoProductInfos["SecondCategoryName"].asString();
|
||||
if(!valueProductInfoProductInfos["FlowControlSupport"].isNull())
|
||||
productInfoObject.flowControlSupport = valueProductInfoProductInfos["FlowControlSupport"].asString();
|
||||
if(!valueProductInfoProductInfos["SecondCategoryId"].isNull())
|
||||
productInfoObject.secondCategoryId = std::stol(valueProductInfoProductInfos["SecondCategoryId"].asString());
|
||||
if(!valueProductInfoProductInfos["ProductNameEn"].isNull())
|
||||
productInfoObject.productNameEn = valueProductInfoProductInfos["ProductNameEn"].asString();
|
||||
productInfo_.push_back(productInfoObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListProductsResult::ProductInfos> ListProductsResult::getProductInfo()const
|
||||
{
|
||||
return productInfo_;
|
||||
}
|
||||
|
||||
int ListProductsResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListProductsResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
int ListProductsResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
100
quotas/src/model/ListQuotaAlarmsRequest.cc
Normal file
100
quotas/src/model/ListQuotaAlarmsRequest.cc
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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/quotas/model/ListQuotaAlarmsRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListQuotaAlarmsRequest;
|
||||
|
||||
ListQuotaAlarmsRequest::ListQuotaAlarmsRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListQuotaAlarms")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListQuotaAlarmsRequest::~ListQuotaAlarmsRequest()
|
||||
{}
|
||||
|
||||
std::string ListQuotaAlarmsRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListQuotaAlarmsRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListQuotaAlarmsRequest::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
void ListQuotaAlarmsRequest::setQuotaActionCode(const std::string& quotaActionCode)
|
||||
{
|
||||
quotaActionCode_ = quotaActionCode;
|
||||
setBodyParameter("QuotaActionCode", quotaActionCode);
|
||||
}
|
||||
|
||||
std::string ListQuotaAlarmsRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListQuotaAlarmsRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setBodyParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
std::vector<ListQuotaAlarmsRequest::QuotaDimensions> ListQuotaAlarmsRequest::getQuotaDimensions()const
|
||||
{
|
||||
return quotaDimensions_;
|
||||
}
|
||||
|
||||
void ListQuotaAlarmsRequest::setQuotaDimensions(const std::vector<QuotaDimensions>& quotaDimensions)
|
||||
{
|
||||
quotaDimensions_ = quotaDimensions;
|
||||
for(int dep1 = 0; dep1!= quotaDimensions.size(); dep1++) {
|
||||
auto quotaDimensionsObj = quotaDimensions.at(dep1);
|
||||
std::string quotaDimensionsObjStr = "QuotaDimensions." + std::to_string(dep1 + 1);
|
||||
setParameter(quotaDimensionsObjStr + ".Key", quotaDimensionsObj.key);
|
||||
setParameter(quotaDimensionsObjStr + ".Value", quotaDimensionsObj.value);
|
||||
}
|
||||
}
|
||||
|
||||
int ListQuotaAlarmsRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListQuotaAlarmsRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setBodyParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
std::string ListQuotaAlarmsRequest::getAlarmName()const
|
||||
{
|
||||
return alarmName_;
|
||||
}
|
||||
|
||||
void ListQuotaAlarmsRequest::setAlarmName(const std::string& alarmName)
|
||||
{
|
||||
alarmName_ = alarmName;
|
||||
setBodyParameter("AlarmName", alarmName);
|
||||
}
|
||||
|
||||
107
quotas/src/model/ListQuotaAlarmsResult.cc
Normal file
107
quotas/src/model/ListQuotaAlarmsResult.cc
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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/quotas/model/ListQuotaAlarmsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListQuotaAlarmsResult::ListQuotaAlarmsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListQuotaAlarmsResult::ListQuotaAlarmsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListQuotaAlarmsResult::~ListQuotaAlarmsResult()
|
||||
{}
|
||||
|
||||
void ListQuotaAlarmsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allQuotaAlarmsNode = value["QuotaAlarms"]["QuotaAlarm"];
|
||||
for (auto valueQuotaAlarmsQuotaAlarm : allQuotaAlarmsNode)
|
||||
{
|
||||
QuotaAlarm quotaAlarmsObject;
|
||||
if(!valueQuotaAlarmsQuotaAlarm["AlarmId"].isNull())
|
||||
quotaAlarmsObject.alarmId = valueQuotaAlarmsQuotaAlarm["AlarmId"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["QuotaDimensions"].isNull())
|
||||
quotaAlarmsObject.quotaDimensions = valueQuotaAlarmsQuotaAlarm["QuotaDimensions"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["ThresholdPercent"].isNull())
|
||||
quotaAlarmsObject.thresholdPercent = std::stof(valueQuotaAlarmsQuotaAlarm["ThresholdPercent"].asString());
|
||||
if(!valueQuotaAlarmsQuotaAlarm["ProductCode"].isNull())
|
||||
quotaAlarmsObject.productCode = valueQuotaAlarmsQuotaAlarm["ProductCode"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["CreateTime"].isNull())
|
||||
quotaAlarmsObject.createTime = valueQuotaAlarmsQuotaAlarm["CreateTime"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["WebHook"].isNull())
|
||||
quotaAlarmsObject.webHook = valueQuotaAlarmsQuotaAlarm["WebHook"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["QuotaUsage"].isNull())
|
||||
quotaAlarmsObject.quotaUsage = std::stof(valueQuotaAlarmsQuotaAlarm["QuotaUsage"].asString());
|
||||
if(!valueQuotaAlarmsQuotaAlarm["ExceedThreshold"].isNull())
|
||||
quotaAlarmsObject.exceedThreshold = valueQuotaAlarmsQuotaAlarm["ExceedThreshold"].asString() == "true";
|
||||
if(!valueQuotaAlarmsQuotaAlarm["QuotaActionCode"].isNull())
|
||||
quotaAlarmsObject.quotaActionCode = valueQuotaAlarmsQuotaAlarm["QuotaActionCode"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["QuotaValue"].isNull())
|
||||
quotaAlarmsObject.quotaValue = std::stof(valueQuotaAlarmsQuotaAlarm["QuotaValue"].asString());
|
||||
if(!valueQuotaAlarmsQuotaAlarm["AlarmName"].isNull())
|
||||
quotaAlarmsObject.alarmName = valueQuotaAlarmsQuotaAlarm["AlarmName"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["NotifyTarget"].isNull())
|
||||
quotaAlarmsObject.notifyTarget = valueQuotaAlarmsQuotaAlarm["NotifyTarget"].asString();
|
||||
if(!valueQuotaAlarmsQuotaAlarm["Threshold"].isNull())
|
||||
quotaAlarmsObject.threshold = std::stof(valueQuotaAlarmsQuotaAlarm["Threshold"].asString());
|
||||
if(!valueQuotaAlarmsQuotaAlarm["ThresholdType"].isNull())
|
||||
quotaAlarmsObject.thresholdType = valueQuotaAlarmsQuotaAlarm["ThresholdType"].asString();
|
||||
auto allNotifyChannels = value["NotifyChannels"]["NotifyChannels"];
|
||||
for (auto value : allNotifyChannels)
|
||||
quotaAlarmsObject.notifyChannels.push_back(value.asString());
|
||||
quotaAlarms_.push_back(quotaAlarmsObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListQuotaAlarmsResult::QuotaAlarm> ListQuotaAlarmsResult::getQuotaAlarms()const
|
||||
{
|
||||
return quotaAlarms_;
|
||||
}
|
||||
|
||||
int ListQuotaAlarmsResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListQuotaAlarmsResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
int ListQuotaAlarmsResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
122
quotas/src/model/ListQuotaApplicationsRequest.cc
Normal file
122
quotas/src/model/ListQuotaApplicationsRequest.cc
Normal 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/quotas/model/ListQuotaApplicationsRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::ListQuotaApplicationsRequest;
|
||||
|
||||
ListQuotaApplicationsRequest::ListQuotaApplicationsRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "ListQuotaApplications")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListQuotaApplicationsRequest::~ListQuotaApplicationsRequest()
|
||||
{}
|
||||
|
||||
std::string ListQuotaApplicationsRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setBodyParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListQuotaApplicationsRequest::getQuotaActionCode()const
|
||||
{
|
||||
return quotaActionCode_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setQuotaActionCode(const std::string& quotaActionCode)
|
||||
{
|
||||
quotaActionCode_ = quotaActionCode;
|
||||
setBodyParameter("QuotaActionCode", quotaActionCode);
|
||||
}
|
||||
|
||||
std::string ListQuotaApplicationsRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setBodyParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
std::string ListQuotaApplicationsRequest::getKeyWord()const
|
||||
{
|
||||
return keyWord_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setKeyWord(const std::string& keyWord)
|
||||
{
|
||||
keyWord_ = keyWord;
|
||||
setBodyParameter("KeyWord", keyWord);
|
||||
}
|
||||
|
||||
std::string ListQuotaApplicationsRequest::getQuotaCategory()const
|
||||
{
|
||||
return quotaCategory_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setQuotaCategory(const std::string& quotaCategory)
|
||||
{
|
||||
quotaCategory_ = quotaCategory;
|
||||
setBodyParameter("QuotaCategory", quotaCategory);
|
||||
}
|
||||
|
||||
int ListQuotaApplicationsRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setBodyParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
std::string ListQuotaApplicationsRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setStatus(const std::string& status)
|
||||
{
|
||||
status_ = status;
|
||||
setBodyParameter("Status", status);
|
||||
}
|
||||
|
||||
std::vector<ListQuotaApplicationsRequest::Dimensions> ListQuotaApplicationsRequest::getDimensions()const
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
void ListQuotaApplicationsRequest::setDimensions(const std::vector<Dimensions>& dimensions)
|
||||
{
|
||||
dimensions_ = dimensions;
|
||||
for(int dep1 = 0; dep1!= dimensions.size(); dep1++) {
|
||||
auto dimensionsObj = dimensions.at(dep1);
|
||||
std::string dimensionsObjStr = "Dimensions." + std::to_string(dep1 + 1);
|
||||
setParameter(dimensionsObjStr + ".Key", dimensionsObj.key);
|
||||
setParameter(dimensionsObjStr + ".Value", dimensionsObj.value);
|
||||
}
|
||||
}
|
||||
|
||||
117
quotas/src/model/ListQuotaApplicationsResult.cc
Normal file
117
quotas/src/model/ListQuotaApplicationsResult.cc
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* 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/quotas/model/ListQuotaApplicationsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
ListQuotaApplicationsResult::ListQuotaApplicationsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListQuotaApplicationsResult::ListQuotaApplicationsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListQuotaApplicationsResult::~ListQuotaApplicationsResult()
|
||||
{}
|
||||
|
||||
void ListQuotaApplicationsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allQuotaApplicationsNode = value["QuotaApplications"]["QuotaApplicationsItem"];
|
||||
for (auto valueQuotaApplicationsQuotaApplicationsItem : allQuotaApplicationsNode)
|
||||
{
|
||||
QuotaApplicationsItem quotaApplicationsObject;
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["Status"].isNull())
|
||||
quotaApplicationsObject.status = valueQuotaApplicationsQuotaApplicationsItem["Status"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["ApplyTime"].isNull())
|
||||
quotaApplicationsObject.applyTime = valueQuotaApplicationsQuotaApplicationsItem["ApplyTime"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["Comment"].isNull())
|
||||
quotaApplicationsObject.comment = valueQuotaApplicationsQuotaApplicationsItem["Comment"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["QuotaDescription"].isNull())
|
||||
quotaApplicationsObject.quotaDescription = valueQuotaApplicationsQuotaApplicationsItem["QuotaDescription"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["ProductCode"].isNull())
|
||||
quotaApplicationsObject.productCode = valueQuotaApplicationsQuotaApplicationsItem["ProductCode"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["EffectiveTime"].isNull())
|
||||
quotaApplicationsObject.effectiveTime = valueQuotaApplicationsQuotaApplicationsItem["EffectiveTime"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["AuditReason"].isNull())
|
||||
quotaApplicationsObject.auditReason = valueQuotaApplicationsQuotaApplicationsItem["AuditReason"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["QuotaUnit"].isNull())
|
||||
quotaApplicationsObject.quotaUnit = valueQuotaApplicationsQuotaApplicationsItem["QuotaUnit"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["Dimension"].isNull())
|
||||
quotaApplicationsObject.dimension = valueQuotaApplicationsQuotaApplicationsItem["Dimension"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["ApproveValue"].isNull())
|
||||
quotaApplicationsObject.approveValue = std::stof(valueQuotaApplicationsQuotaApplicationsItem["ApproveValue"].asString());
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["Reason"].isNull())
|
||||
quotaApplicationsObject.reason = valueQuotaApplicationsQuotaApplicationsItem["Reason"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["QuotaActionCode"].isNull())
|
||||
quotaApplicationsObject.quotaActionCode = valueQuotaApplicationsQuotaApplicationsItem["QuotaActionCode"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["QuotaName"].isNull())
|
||||
quotaApplicationsObject.quotaName = valueQuotaApplicationsQuotaApplicationsItem["QuotaName"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["QuotaArn"].isNull())
|
||||
quotaApplicationsObject.quotaArn = valueQuotaApplicationsQuotaApplicationsItem["QuotaArn"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["NoticeType"].isNull())
|
||||
quotaApplicationsObject.noticeType = std::stoi(valueQuotaApplicationsQuotaApplicationsItem["NoticeType"].asString());
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["ApplicationId"].isNull())
|
||||
quotaApplicationsObject.applicationId = valueQuotaApplicationsQuotaApplicationsItem["ApplicationId"].asString();
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["DesireValue"].isNull())
|
||||
quotaApplicationsObject.desireValue = std::stof(valueQuotaApplicationsQuotaApplicationsItem["DesireValue"].asString());
|
||||
if(!valueQuotaApplicationsQuotaApplicationsItem["ExpireTime"].isNull())
|
||||
quotaApplicationsObject.expireTime = valueQuotaApplicationsQuotaApplicationsItem["ExpireTime"].asString();
|
||||
auto periodNode = value["Period"];
|
||||
if(!periodNode["PeriodValue"].isNull())
|
||||
quotaApplicationsObject.period.periodValue = std::stol(periodNode["PeriodValue"].asString());
|
||||
if(!periodNode["PeriodUnit"].isNull())
|
||||
quotaApplicationsObject.period.periodUnit = periodNode["PeriodUnit"].asString();
|
||||
quotaApplications_.push_back(quotaApplicationsObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListQuotaApplicationsResult::QuotaApplicationsItem> ListQuotaApplicationsResult::getQuotaApplications()const
|
||||
{
|
||||
return quotaApplications_;
|
||||
}
|
||||
|
||||
int ListQuotaApplicationsResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListQuotaApplicationsResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
int ListQuotaApplicationsResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
95
quotas/src/model/UpdateQuotaAlarmRequest.cc
Normal file
95
quotas/src/model/UpdateQuotaAlarmRequest.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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/quotas/model/UpdateQuotaAlarmRequest.h>
|
||||
|
||||
using AlibabaCloud::Quotas::Model::UpdateQuotaAlarmRequest;
|
||||
|
||||
UpdateQuotaAlarmRequest::UpdateQuotaAlarmRequest() :
|
||||
RpcServiceRequest("quotas", "2020-05-10", "UpdateQuotaAlarm")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateQuotaAlarmRequest::~UpdateQuotaAlarmRequest()
|
||||
{}
|
||||
|
||||
std::string UpdateQuotaAlarmRequest::getWebHook()const
|
||||
{
|
||||
return webHook_;
|
||||
}
|
||||
|
||||
void UpdateQuotaAlarmRequest::setWebHook(const std::string& webHook)
|
||||
{
|
||||
webHook_ = webHook;
|
||||
setBodyParameter("WebHook", webHook);
|
||||
}
|
||||
|
||||
float UpdateQuotaAlarmRequest::getThreshold()const
|
||||
{
|
||||
return threshold_;
|
||||
}
|
||||
|
||||
void UpdateQuotaAlarmRequest::setThreshold(float threshold)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
setBodyParameter("Threshold", std::to_string(threshold));
|
||||
}
|
||||
|
||||
std::string UpdateQuotaAlarmRequest::getThresholdType()const
|
||||
{
|
||||
return thresholdType_;
|
||||
}
|
||||
|
||||
void UpdateQuotaAlarmRequest::setThresholdType(const std::string& thresholdType)
|
||||
{
|
||||
thresholdType_ = thresholdType;
|
||||
setBodyParameter("ThresholdType", thresholdType);
|
||||
}
|
||||
|
||||
float UpdateQuotaAlarmRequest::getThresholdPercent()const
|
||||
{
|
||||
return thresholdPercent_;
|
||||
}
|
||||
|
||||
void UpdateQuotaAlarmRequest::setThresholdPercent(float thresholdPercent)
|
||||
{
|
||||
thresholdPercent_ = thresholdPercent;
|
||||
setBodyParameter("ThresholdPercent", std::to_string(thresholdPercent));
|
||||
}
|
||||
|
||||
std::string UpdateQuotaAlarmRequest::getAlarmId()const
|
||||
{
|
||||
return alarmId_;
|
||||
}
|
||||
|
||||
void UpdateQuotaAlarmRequest::setAlarmId(const std::string& alarmId)
|
||||
{
|
||||
alarmId_ = alarmId;
|
||||
setBodyParameter("AlarmId", alarmId);
|
||||
}
|
||||
|
||||
std::string UpdateQuotaAlarmRequest::getAlarmName()const
|
||||
{
|
||||
return alarmName_;
|
||||
}
|
||||
|
||||
void UpdateQuotaAlarmRequest::setAlarmName(const std::string& alarmName)
|
||||
{
|
||||
alarmName_ = alarmName;
|
||||
setBodyParameter("AlarmName", alarmName);
|
||||
}
|
||||
|
||||
44
quotas/src/model/UpdateQuotaAlarmResult.cc
Normal file
44
quotas/src/model/UpdateQuotaAlarmResult.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/quotas/model/UpdateQuotaAlarmResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quotas;
|
||||
using namespace AlibabaCloud::Quotas::Model;
|
||||
|
||||
UpdateQuotaAlarmResult::UpdateQuotaAlarmResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdateQuotaAlarmResult::UpdateQuotaAlarmResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdateQuotaAlarmResult::~UpdateQuotaAlarmResult()
|
||||
{}
|
||||
|
||||
void UpdateQuotaAlarmResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user