Added ElasticSearch Serverless SDK.
This commit is contained in:
665
es-serverless/src/Es-serverlessClient.cc
Normal file
665
es-serverless/src/Es-serverlessClient.cc
Normal file
@@ -0,0 +1,665 @@
|
||||
/*
|
||||
* 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/es-serverless/Es_serverlessClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "es-serverless";
|
||||
}
|
||||
|
||||
Es_serverlessClient::Es_serverlessClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "elkxops");
|
||||
}
|
||||
|
||||
Es_serverlessClient::Es_serverlessClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "elkxops");
|
||||
}
|
||||
|
||||
Es_serverlessClient::Es_serverlessClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "elkxops");
|
||||
}
|
||||
|
||||
Es_serverlessClient::~Es_serverlessClient()
|
||||
{}
|
||||
|
||||
Es_serverlessClient::CreateAppOutcome Es_serverlessClient::createApp(const CreateAppRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateAppOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateAppOutcome(CreateAppResult(outcome.result()));
|
||||
else
|
||||
return CreateAppOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::createAppAsync(const CreateAppRequest& request, const CreateAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createApp(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::CreateAppOutcomeCallable Es_serverlessClient::createAppCallable(const CreateAppRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateAppOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createApp(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::CreateDataStreamOutcome Es_serverlessClient::createDataStream(const CreateDataStreamRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateDataStreamOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateDataStreamOutcome(CreateDataStreamResult(outcome.result()));
|
||||
else
|
||||
return CreateDataStreamOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::createDataStreamAsync(const CreateDataStreamRequest& request, const CreateDataStreamAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createDataStream(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::CreateDataStreamOutcomeCallable Es_serverlessClient::createDataStreamCallable(const CreateDataStreamRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateDataStreamOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createDataStream(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::DeleteAccessTokenOutcome Es_serverlessClient::deleteAccessToken(const DeleteAccessTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteAccessTokenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteAccessTokenOutcome(DeleteAccessTokenResult(outcome.result()));
|
||||
else
|
||||
return DeleteAccessTokenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::deleteAccessTokenAsync(const DeleteAccessTokenRequest& request, const DeleteAccessTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteAccessToken(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::DeleteAccessTokenOutcomeCallable Es_serverlessClient::deleteAccessTokenCallable(const DeleteAccessTokenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteAccessTokenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteAccessToken(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::DeleteAppOutcome Es_serverlessClient::deleteApp(const DeleteAppRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteAppOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteAppOutcome(DeleteAppResult(outcome.result()));
|
||||
else
|
||||
return DeleteAppOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::deleteAppAsync(const DeleteAppRequest& request, const DeleteAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteApp(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::DeleteAppOutcomeCallable Es_serverlessClient::deleteAppCallable(const DeleteAppRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteAppOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteApp(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::DeleteDataStreamOutcome Es_serverlessClient::deleteDataStream(const DeleteDataStreamRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteDataStreamOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteDataStreamOutcome(DeleteDataStreamResult(outcome.result()));
|
||||
else
|
||||
return DeleteDataStreamOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::deleteDataStreamAsync(const DeleteDataStreamRequest& request, const DeleteDataStreamAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteDataStream(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::DeleteDataStreamOutcomeCallable Es_serverlessClient::deleteDataStreamCallable(const DeleteDataStreamRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteDataStreamOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteDataStream(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::DescibeRegionsOutcome Es_serverlessClient::descibeRegions(const DescibeRegionsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescibeRegionsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescibeRegionsOutcome(DescibeRegionsResult(outcome.result()));
|
||||
else
|
||||
return DescibeRegionsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::descibeRegionsAsync(const DescibeRegionsRequest& request, const DescibeRegionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, descibeRegions(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::DescibeRegionsOutcomeCallable Es_serverlessClient::descibeRegionsCallable(const DescibeRegionsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescibeRegionsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->descibeRegions(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::DisableAccessTokenOutcome Es_serverlessClient::disableAccessToken(const DisableAccessTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DisableAccessTokenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DisableAccessTokenOutcome(DisableAccessTokenResult(outcome.result()));
|
||||
else
|
||||
return DisableAccessTokenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::disableAccessTokenAsync(const DisableAccessTokenRequest& request, const DisableAccessTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, disableAccessToken(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::DisableAccessTokenOutcomeCallable Es_serverlessClient::disableAccessTokenCallable(const DisableAccessTokenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DisableAccessTokenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->disableAccessToken(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::EnableAccessTokenOutcome Es_serverlessClient::enableAccessToken(const EnableAccessTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return EnableAccessTokenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return EnableAccessTokenOutcome(EnableAccessTokenResult(outcome.result()));
|
||||
else
|
||||
return EnableAccessTokenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::enableAccessTokenAsync(const EnableAccessTokenRequest& request, const EnableAccessTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, enableAccessToken(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::EnableAccessTokenOutcomeCallable Es_serverlessClient::enableAccessTokenCallable(const EnableAccessTokenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<EnableAccessTokenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->enableAccessToken(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::GenerateAcccessTokenOutcome Es_serverlessClient::generateAcccessToken(const GenerateAcccessTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GenerateAcccessTokenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GenerateAcccessTokenOutcome(GenerateAcccessTokenResult(outcome.result()));
|
||||
else
|
||||
return GenerateAcccessTokenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::generateAcccessTokenAsync(const GenerateAcccessTokenRequest& request, const GenerateAcccessTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, generateAcccessToken(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::GenerateAcccessTokenOutcomeCallable Es_serverlessClient::generateAcccessTokenCallable(const GenerateAcccessTokenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GenerateAcccessTokenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->generateAcccessToken(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::GetAppOutcome Es_serverlessClient::getApp(const GetAppRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetAppOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetAppOutcome(GetAppResult(outcome.result()));
|
||||
else
|
||||
return GetAppOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::getAppAsync(const GetAppRequest& request, const GetAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getApp(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::GetAppOutcomeCallable Es_serverlessClient::getAppCallable(const GetAppRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetAppOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getApp(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::GetDataStreamOutcome Es_serverlessClient::getDataStream(const GetDataStreamRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetDataStreamOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetDataStreamOutcome(GetDataStreamResult(outcome.result()));
|
||||
else
|
||||
return GetDataStreamOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::getDataStreamAsync(const GetDataStreamRequest& request, const GetDataStreamAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getDataStream(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::GetDataStreamOutcomeCallable Es_serverlessClient::getDataStreamCallable(const GetDataStreamRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetDataStreamOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getDataStream(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::GetRegionInfoOutcome Es_serverlessClient::getRegionInfo(const GetRegionInfoRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetRegionInfoOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetRegionInfoOutcome(GetRegionInfoResult(outcome.result()));
|
||||
else
|
||||
return GetRegionInfoOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::getRegionInfoAsync(const GetRegionInfoRequest& request, const GetRegionInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getRegionInfo(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::GetRegionInfoOutcomeCallable Es_serverlessClient::getRegionInfoCallable(const GetRegionInfoRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetRegionInfoOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getRegionInfo(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::ListAccessTokensOutcome Es_serverlessClient::listAccessTokens(const ListAccessTokensRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListAccessTokensOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListAccessTokensOutcome(ListAccessTokensResult(outcome.result()));
|
||||
else
|
||||
return ListAccessTokensOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::listAccessTokensAsync(const ListAccessTokensRequest& request, const ListAccessTokensAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listAccessTokens(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::ListAccessTokensOutcomeCallable Es_serverlessClient::listAccessTokensCallable(const ListAccessTokensRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListAccessTokensOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listAccessTokens(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::ListAppsOutcome Es_serverlessClient::listApps(const ListAppsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListAppsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListAppsOutcome(ListAppsResult(outcome.result()));
|
||||
else
|
||||
return ListAppsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::listAppsAsync(const ListAppsRequest& request, const ListAppsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listApps(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::ListAppsOutcomeCallable Es_serverlessClient::listAppsCallable(const ListAppsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListAppsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listApps(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::ListDataStreamsOutcome Es_serverlessClient::listDataStreams(const ListDataStreamsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListDataStreamsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListDataStreamsOutcome(ListDataStreamsResult(outcome.result()));
|
||||
else
|
||||
return ListDataStreamsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::listDataStreamsAsync(const ListDataStreamsRequest& request, const ListDataStreamsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listDataStreams(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::ListDataStreamsOutcomeCallable Es_serverlessClient::listDataStreamsCallable(const ListDataStreamsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListDataStreamsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listDataStreams(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::UpdateAppOutcome Es_serverlessClient::updateApp(const UpdateAppRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdateAppOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdateAppOutcome(UpdateAppResult(outcome.result()));
|
||||
else
|
||||
return UpdateAppOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::updateAppAsync(const UpdateAppRequest& request, const UpdateAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updateApp(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::UpdateAppOutcomeCallable Es_serverlessClient::updateAppCallable(const UpdateAppRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdateAppOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updateApp(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Es_serverlessClient::UpdateDataStreamOutcome Es_serverlessClient::updateDataStream(const UpdateDataStreamRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdateDataStreamOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdateDataStreamOutcome(UpdateDataStreamResult(outcome.result()));
|
||||
else
|
||||
return UpdateDataStreamOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Es_serverlessClient::updateDataStreamAsync(const UpdateDataStreamRequest& request, const UpdateDataStreamAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updateDataStream(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Es_serverlessClient::UpdateDataStreamOutcomeCallable Es_serverlessClient::updateDataStreamCallable(const UpdateDataStreamRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdateDataStreamOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updateDataStream(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
37
es-serverless/src/model/CreateAppRequest.cc
Normal file
37
es-serverless/src/model/CreateAppRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/es-serverless/model/CreateAppRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::CreateAppRequest;
|
||||
|
||||
CreateAppRequest::CreateAppRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateAppRequest::~CreateAppRequest() {}
|
||||
|
||||
std::string CreateAppRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void CreateAppRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("Body"), body);
|
||||
}
|
||||
|
||||
51
es-serverless/src/model/CreateAppResult.cc
Normal file
51
es-serverless/src/model/CreateAppResult.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/es-serverless/model/CreateAppResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
CreateAppResult::CreateAppResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateAppResult::CreateAppResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateAppResult::~CreateAppResult()
|
||||
{}
|
||||
|
||||
void CreateAppResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateAppResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
46
es-serverless/src/model/CreateDataStreamRequest.cc
Normal file
46
es-serverless/src/model/CreateDataStreamRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/es-serverless/model/CreateDataStreamRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::CreateDataStreamRequest;
|
||||
|
||||
CreateDataStreamRequest::CreateDataStreamRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]/data-streams"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateDataStreamRequest::~CreateDataStreamRequest() {}
|
||||
|
||||
std::string CreateDataStreamRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void CreateDataStreamRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string CreateDataStreamRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void CreateDataStreamRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("Body"), body);
|
||||
}
|
||||
|
||||
51
es-serverless/src/model/CreateDataStreamResult.cc
Normal file
51
es-serverless/src/model/CreateDataStreamResult.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/es-serverless/model/CreateDataStreamResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
CreateDataStreamResult::CreateDataStreamResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateDataStreamResult::CreateDataStreamResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateDataStreamResult::~CreateDataStreamResult()
|
||||
{}
|
||||
|
||||
void CreateDataStreamResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateDataStreamResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
37
es-serverless/src/model/DeleteAccessTokenRequest.cc
Normal file
37
es-serverless/src/model/DeleteAccessTokenRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DeleteAccessTokenRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::DeleteAccessTokenRequest;
|
||||
|
||||
DeleteAccessTokenRequest::DeleteAccessTokenRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/tokens/[tokenId]"};
|
||||
setMethod(HttpRequest::Method::Delete);
|
||||
}
|
||||
|
||||
DeleteAccessTokenRequest::~DeleteAccessTokenRequest() {}
|
||||
|
||||
std::string DeleteAccessTokenRequest::getTokenId() const {
|
||||
return tokenId_;
|
||||
}
|
||||
|
||||
void DeleteAccessTokenRequest::setTokenId(const std::string &tokenId) {
|
||||
tokenId_ = tokenId;
|
||||
setParameter(std::string("tokenId"), tokenId);
|
||||
}
|
||||
|
||||
51
es-serverless/src/model/DeleteAccessTokenResult.cc
Normal file
51
es-serverless/src/model/DeleteAccessTokenResult.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/es-serverless/model/DeleteAccessTokenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
DeleteAccessTokenResult::DeleteAccessTokenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteAccessTokenResult::DeleteAccessTokenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteAccessTokenResult::~DeleteAccessTokenResult()
|
||||
{}
|
||||
|
||||
void DeleteAccessTokenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteAccessTokenResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
37
es-serverless/src/model/DeleteAppRequest.cc
Normal file
37
es-serverless/src/model/DeleteAppRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DeleteAppRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::DeleteAppRequest;
|
||||
|
||||
DeleteAppRequest::DeleteAppRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]"};
|
||||
setMethod(HttpRequest::Method::Delete);
|
||||
}
|
||||
|
||||
DeleteAppRequest::~DeleteAppRequest() {}
|
||||
|
||||
std::string DeleteAppRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void DeleteAppRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
59
es-serverless/src/model/DeleteAppResult.cc
Normal file
59
es-serverless/src/model/DeleteAppResult.cc
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DeleteAppResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
DeleteAppResult::DeleteAppResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteAppResult::DeleteAppResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteAppResult::~DeleteAppResult()
|
||||
{}
|
||||
|
||||
void DeleteAppResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto resultNode = value["result"];
|
||||
if(!resultNode["instanceId"].isNull())
|
||||
result_.instanceId = resultNode["instanceId"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteAppResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
DeleteAppResult::Result DeleteAppResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
46
es-serverless/src/model/DeleteDataStreamRequest.cc
Normal file
46
es-serverless/src/model/DeleteDataStreamRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DeleteDataStreamRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::DeleteDataStreamRequest;
|
||||
|
||||
DeleteDataStreamRequest::DeleteDataStreamRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]/data-streams/[dataStreamName]"};
|
||||
setMethod(HttpRequest::Method::Delete);
|
||||
}
|
||||
|
||||
DeleteDataStreamRequest::~DeleteDataStreamRequest() {}
|
||||
|
||||
std::string DeleteDataStreamRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void DeleteDataStreamRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string DeleteDataStreamRequest::getDataStreamName() const {
|
||||
return dataStreamName_;
|
||||
}
|
||||
|
||||
void DeleteDataStreamRequest::setDataStreamName(const std::string &dataStreamName) {
|
||||
dataStreamName_ = dataStreamName;
|
||||
setParameter(std::string("dataStreamName"), dataStreamName);
|
||||
}
|
||||
|
||||
58
es-serverless/src/model/DeleteDataStreamResult.cc
Normal file
58
es-serverless/src/model/DeleteDataStreamResult.cc
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DeleteDataStreamResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
DeleteDataStreamResult::DeleteDataStreamResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteDataStreamResult::DeleteDataStreamResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteDataStreamResult::~DeleteDataStreamResult()
|
||||
{}
|
||||
|
||||
void DeleteDataStreamResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["result"].isNull())
|
||||
result_ = value["result"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteDataStreamResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
bool DeleteDataStreamResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
28
es-serverless/src/model/DescibeRegionsRequest.cc
Normal file
28
es-serverless/src/model/DescibeRegionsRequest.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DescibeRegionsRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::DescibeRegionsRequest;
|
||||
|
||||
DescibeRegionsRequest::DescibeRegionsRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/regions"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
DescibeRegionsRequest::~DescibeRegionsRequest() {}
|
||||
|
||||
68
es-serverless/src/model/DescibeRegionsResult.cc
Normal file
68
es-serverless/src/model/DescibeRegionsResult.cc
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DescibeRegionsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
DescibeRegionsResult::DescibeRegionsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescibeRegionsResult::DescibeRegionsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescibeRegionsResult::~DescibeRegionsResult()
|
||||
{}
|
||||
|
||||
void DescibeRegionsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allresultNode = value["result"]["RegionInfo"];
|
||||
for (auto valueresultRegionInfo : allresultNode)
|
||||
{
|
||||
RegionInfo resultObject;
|
||||
if(!valueresultRegionInfo["regionId"].isNull())
|
||||
resultObject.regionId = valueresultRegionInfo["regionId"].asString();
|
||||
if(!valueresultRegionInfo["localName"].isNull())
|
||||
resultObject.localName = valueresultRegionInfo["localName"].asString();
|
||||
if(!valueresultRegionInfo["endpoint"].isNull())
|
||||
resultObject.endpoint = valueresultRegionInfo["endpoint"].asString();
|
||||
result_.push_back(resultObject);
|
||||
}
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::vector<DescibeRegionsResult::RegionInfo> DescibeRegionsResult::getresult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
std::string DescibeRegionsResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
37
es-serverless/src/model/DisableAccessTokenRequest.cc
Normal file
37
es-serverless/src/model/DisableAccessTokenRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/es-serverless/model/DisableAccessTokenRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::DisableAccessTokenRequest;
|
||||
|
||||
DisableAccessTokenRequest::DisableAccessTokenRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/tokens/[tokenId]/actions/disable"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DisableAccessTokenRequest::~DisableAccessTokenRequest() {}
|
||||
|
||||
std::string DisableAccessTokenRequest::getTokenId() const {
|
||||
return tokenId_;
|
||||
}
|
||||
|
||||
void DisableAccessTokenRequest::setTokenId(const std::string &tokenId) {
|
||||
tokenId_ = tokenId;
|
||||
setParameter(std::string("tokenId"), tokenId);
|
||||
}
|
||||
|
||||
51
es-serverless/src/model/DisableAccessTokenResult.cc
Normal file
51
es-serverless/src/model/DisableAccessTokenResult.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/es-serverless/model/DisableAccessTokenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
DisableAccessTokenResult::DisableAccessTokenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DisableAccessTokenResult::DisableAccessTokenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DisableAccessTokenResult::~DisableAccessTokenResult()
|
||||
{}
|
||||
|
||||
void DisableAccessTokenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DisableAccessTokenResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
37
es-serverless/src/model/EnableAccessTokenRequest.cc
Normal file
37
es-serverless/src/model/EnableAccessTokenRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/es-serverless/model/EnableAccessTokenRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::EnableAccessTokenRequest;
|
||||
|
||||
EnableAccessTokenRequest::EnableAccessTokenRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/tokens/[tokenId]/actions/enable"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
EnableAccessTokenRequest::~EnableAccessTokenRequest() {}
|
||||
|
||||
std::string EnableAccessTokenRequest::getTokenId() const {
|
||||
return tokenId_;
|
||||
}
|
||||
|
||||
void EnableAccessTokenRequest::setTokenId(const std::string &tokenId) {
|
||||
tokenId_ = tokenId;
|
||||
setParameter(std::string("tokenId"), tokenId);
|
||||
}
|
||||
|
||||
51
es-serverless/src/model/EnableAccessTokenResult.cc
Normal file
51
es-serverless/src/model/EnableAccessTokenResult.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/es-serverless/model/EnableAccessTokenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
EnableAccessTokenResult::EnableAccessTokenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
EnableAccessTokenResult::EnableAccessTokenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
EnableAccessTokenResult::~EnableAccessTokenResult()
|
||||
{}
|
||||
|
||||
void EnableAccessTokenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string EnableAccessTokenResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
28
es-serverless/src/model/GenerateAcccessTokenRequest.cc
Normal file
28
es-serverless/src/model/GenerateAcccessTokenRequest.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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/es-serverless/model/GenerateAcccessTokenRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::GenerateAcccessTokenRequest;
|
||||
|
||||
GenerateAcccessTokenRequest::GenerateAcccessTokenRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/tokens"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GenerateAcccessTokenRequest::~GenerateAcccessTokenRequest() {}
|
||||
|
||||
51
es-serverless/src/model/GenerateAcccessTokenResult.cc
Normal file
51
es-serverless/src/model/GenerateAcccessTokenResult.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/es-serverless/model/GenerateAcccessTokenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
GenerateAcccessTokenResult::GenerateAcccessTokenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GenerateAcccessTokenResult::GenerateAcccessTokenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GenerateAcccessTokenResult::~GenerateAcccessTokenResult()
|
||||
{}
|
||||
|
||||
void GenerateAcccessTokenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GenerateAcccessTokenResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
37
es-serverless/src/model/GetAppRequest.cc
Normal file
37
es-serverless/src/model/GetAppRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/es-serverless/model/GetAppRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::GetAppRequest;
|
||||
|
||||
GetAppRequest::GetAppRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
GetAppRequest::~GetAppRequest() {}
|
||||
|
||||
std::string GetAppRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void GetAppRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
73
es-serverless/src/model/GetAppResult.cc
Normal file
73
es-serverless/src/model/GetAppResult.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/es-serverless/model/GetAppResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
GetAppResult::GetAppResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetAppResult::GetAppResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetAppResult::~GetAppResult()
|
||||
{}
|
||||
|
||||
void GetAppResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto resultNode = value["result"];
|
||||
if(!resultNode["appName"].isNull())
|
||||
result_.appName = resultNode["appName"].asString();
|
||||
if(!resultNode["storageQuota"].isNull())
|
||||
result_.storageQuota = resultNode["storageQuota"].asString();
|
||||
if(!resultNode["ownerId"].isNull())
|
||||
result_.ownerId = resultNode["ownerId"].asString();
|
||||
if(!resultNode["regionId"].isNull())
|
||||
result_.regionId = resultNode["regionId"].asString();
|
||||
if(!resultNode["status"].isNull())
|
||||
result_.status = resultNode["status"].asString();
|
||||
if(!resultNode["createTime"].isNull())
|
||||
result_.createTime = resultNode["createTime"].asString();
|
||||
if(!resultNode["flowQuota"].isNull())
|
||||
result_.flowQuota = resultNode["flowQuota"].asString();
|
||||
if(!resultNode["description"].isNull())
|
||||
result_.description = resultNode["description"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetAppResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
GetAppResult::Result GetAppResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
46
es-serverless/src/model/GetDataStreamRequest.cc
Normal file
46
es-serverless/src/model/GetDataStreamRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/es-serverless/model/GetDataStreamRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::GetDataStreamRequest;
|
||||
|
||||
GetDataStreamRequest::GetDataStreamRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]/data-streams/[dataStreamName]"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
GetDataStreamRequest::~GetDataStreamRequest() {}
|
||||
|
||||
std::string GetDataStreamRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void GetDataStreamRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string GetDataStreamRequest::getDataStreamName() const {
|
||||
return dataStreamName_;
|
||||
}
|
||||
|
||||
void GetDataStreamRequest::setDataStreamName(const std::string &dataStreamName) {
|
||||
dataStreamName_ = dataStreamName;
|
||||
setParameter(std::string("dataStreamName"), dataStreamName);
|
||||
}
|
||||
|
||||
96
es-serverless/src/model/GetDataStreamResult.cc
Normal file
96
es-serverless/src/model/GetDataStreamResult.cc
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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/es-serverless/model/GetDataStreamResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
GetDataStreamResult::GetDataStreamResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetDataStreamResult::GetDataStreamResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetDataStreamResult::~GetDataStreamResult()
|
||||
{}
|
||||
|
||||
void GetDataStreamResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto resultNode = value["result"];
|
||||
if(!resultNode["appName"].isNull())
|
||||
result_.appName = resultNode["appName"].asString();
|
||||
if(!resultNode["regionId"].isNull())
|
||||
result_.regionId = resultNode["regionId"].asString();
|
||||
if(!resultNode["deletePhase"].isNull())
|
||||
result_.deletePhase = resultNode["deletePhase"].asString();
|
||||
if(!resultNode["dataStreamId"].isNull())
|
||||
result_.dataStreamId = resultNode["dataStreamId"].asString();
|
||||
if(!resultNode["dataStreamName"].isNull())
|
||||
result_.dataStreamName = resultNode["dataStreamName"].asString();
|
||||
if(!resultNode["type"].isNull())
|
||||
result_.type = resultNode["type"].asString();
|
||||
if(!resultNode["createTime"].isNull())
|
||||
result_.createTime = resultNode["createTime"].asString();
|
||||
if(!resultNode["timeStampKey"].isNull())
|
||||
result_.timeStampKey = resultNode["timeStampKey"].asString();
|
||||
auto _templateNode = resultNode["template"];
|
||||
auto allmappingsNode = _templateNode["mappings"]["mappingsItem"];
|
||||
for (auto _templateNodemappingsmappingsItem : allmappingsNode)
|
||||
{
|
||||
Result::_Template::MappingsItem mappingsItemObject;
|
||||
if(!_templateNodemappingsmappingsItem["type"].isNull())
|
||||
mappingsItemObject.type = _templateNodemappingsmappingsItem["type"].asString();
|
||||
if(!_templateNodemappingsmappingsItem["caseSensitive"].isNull())
|
||||
mappingsItemObject.caseSensitive = _templateNodemappingsmappingsItem["caseSensitive"].asString() == "true";
|
||||
if(!_templateNodemappingsmappingsItem["docValues"].isNull())
|
||||
mappingsItemObject.docValues = _templateNodemappingsmappingsItem["docValues"].asString() == "true";
|
||||
if(!_templateNodemappingsmappingsItem["index"].isNull())
|
||||
mappingsItemObject.index = _templateNodemappingsmappingsItem["index"].asString() == "true";
|
||||
if(!_templateNodemappingsmappingsItem["key"].isNull())
|
||||
mappingsItemObject.key = _templateNodemappingsmappingsItem["key"].asString();
|
||||
auto allTokenizeOnChars = value["tokenizeOnChars"]["null"];
|
||||
for (auto value : allTokenizeOnChars)
|
||||
mappingsItemObject.tokenizeOnChars.push_back(value.asString());
|
||||
auto allProperties = value["properties"]["null"];
|
||||
for (auto value : allProperties)
|
||||
mappingsItemObject.properties.push_back(value.asString());
|
||||
result_._template.mappings.push_back(mappingsItemObject);
|
||||
}
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetDataStreamResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
GetDataStreamResult::Result GetDataStreamResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
28
es-serverless/src/model/GetRegionInfoRequest.cc
Normal file
28
es-serverless/src/model/GetRegionInfoRequest.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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/es-serverless/model/GetRegionInfoRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::GetRegionInfoRequest;
|
||||
|
||||
GetRegionInfoRequest::GetRegionInfoRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/regions/info"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
GetRegionInfoRequest::~GetRegionInfoRequest() {}
|
||||
|
||||
51
es-serverless/src/model/GetRegionInfoResult.cc
Normal file
51
es-serverless/src/model/GetRegionInfoResult.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/es-serverless/model/GetRegionInfoResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
GetRegionInfoResult::GetRegionInfoResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetRegionInfoResult::GetRegionInfoResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetRegionInfoResult::~GetRegionInfoResult()
|
||||
{}
|
||||
|
||||
void GetRegionInfoResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetRegionInfoResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
37
es-serverless/src/model/ListAccessTokensRequest.cc
Normal file
37
es-serverless/src/model/ListAccessTokensRequest.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/es-serverless/model/ListAccessTokensRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::ListAccessTokensRequest;
|
||||
|
||||
ListAccessTokensRequest::ListAccessTokensRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/tokens"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
ListAccessTokensRequest::~ListAccessTokensRequest() {}
|
||||
|
||||
std::string ListAccessTokensRequest::getTokenId() const {
|
||||
return tokenId_;
|
||||
}
|
||||
|
||||
void ListAccessTokensRequest::setTokenId(const std::string &tokenId) {
|
||||
tokenId_ = tokenId;
|
||||
setParameter(std::string("tokenId"), tokenId);
|
||||
}
|
||||
|
||||
51
es-serverless/src/model/ListAccessTokensResult.cc
Normal file
51
es-serverless/src/model/ListAccessTokensResult.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/es-serverless/model/ListAccessTokensResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
ListAccessTokensResult::ListAccessTokensResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListAccessTokensResult::ListAccessTokensResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListAccessTokensResult::~ListAccessTokensResult()
|
||||
{}
|
||||
|
||||
void ListAccessTokensResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ListAccessTokensResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
64
es-serverless/src/model/ListAppsRequest.cc
Normal file
64
es-serverless/src/model/ListAppsRequest.cc
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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/es-serverless/model/ListAppsRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::ListAppsRequest;
|
||||
|
||||
ListAppsRequest::ListAppsRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
ListAppsRequest::~ListAppsRequest() {}
|
||||
|
||||
std::string ListAppsRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void ListAppsRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
int ListAppsRequest::getPageSize() const {
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListAppsRequest::setPageSize(int pageSize) {
|
||||
pageSize_ = pageSize;
|
||||
setParameter(std::string("pageSize"), std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string ListAppsRequest::getDescription() const {
|
||||
return description_;
|
||||
}
|
||||
|
||||
void ListAppsRequest::setDescription(const std::string &description) {
|
||||
description_ = description;
|
||||
setParameter(std::string("description"), description);
|
||||
}
|
||||
|
||||
int ListAppsRequest::getPageNumber() const {
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void ListAppsRequest::setPageNumber(int pageNumber) {
|
||||
pageNumber_ = pageNumber;
|
||||
setParameter(std::string("pageNumber"), std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
85
es-serverless/src/model/ListAppsResult.cc
Normal file
85
es-serverless/src/model/ListAppsResult.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/es-serverless/model/ListAppsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
ListAppsResult::ListAppsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListAppsResult::ListAppsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListAppsResult::~ListAppsResult()
|
||||
{}
|
||||
|
||||
void ListAppsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allresultNode = value["result"]["app"];
|
||||
for (auto valueresultapp : allresultNode)
|
||||
{
|
||||
App resultObject;
|
||||
if(!valueresultapp["appName"].isNull())
|
||||
resultObject.appName = valueresultapp["appName"].asString();
|
||||
if(!valueresultapp["ownerId"].isNull())
|
||||
resultObject.ownerId = valueresultapp["ownerId"].asString();
|
||||
if(!valueresultapp["storageQuota"].isNull())
|
||||
resultObject.storageQuota = valueresultapp["storageQuota"].asString();
|
||||
if(!valueresultapp["regionId"].isNull())
|
||||
resultObject.regionId = valueresultapp["regionId"].asString();
|
||||
if(!valueresultapp["status"].isNull())
|
||||
resultObject.status = valueresultapp["status"].asString();
|
||||
if(!valueresultapp["createTime"].isNull())
|
||||
resultObject.createTime = valueresultapp["createTime"].asString();
|
||||
if(!valueresultapp["flowQuota"].isNull())
|
||||
resultObject.flowQuota = valueresultapp["flowQuota"].asString();
|
||||
if(!valueresultapp["description"].isNull())
|
||||
resultObject.description = valueresultapp["description"].asString();
|
||||
result_.push_back(resultObject);
|
||||
}
|
||||
if(!value["totalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["totalCount"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListAppsResult::App> ListAppsResult::getresult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
int ListAppsResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListAppsResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
64
es-serverless/src/model/ListDataStreamsRequest.cc
Normal file
64
es-serverless/src/model/ListDataStreamsRequest.cc
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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/es-serverless/model/ListDataStreamsRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::ListDataStreamsRequest;
|
||||
|
||||
ListDataStreamsRequest::ListDataStreamsRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]/data-streams"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
ListDataStreamsRequest::~ListDataStreamsRequest() {}
|
||||
|
||||
std::string ListDataStreamsRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void ListDataStreamsRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string ListDataStreamsRequest::getDataStreamName() const {
|
||||
return dataStreamName_;
|
||||
}
|
||||
|
||||
void ListDataStreamsRequest::setDataStreamName(const std::string &dataStreamName) {
|
||||
dataStreamName_ = dataStreamName;
|
||||
setParameter(std::string("dataStreamName"), dataStreamName);
|
||||
}
|
||||
|
||||
int ListDataStreamsRequest::getPageSize() const {
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListDataStreamsRequest::setPageSize(int pageSize) {
|
||||
pageSize_ = pageSize;
|
||||
setParameter(std::string("pageSize"), std::to_string(pageSize));
|
||||
}
|
||||
|
||||
int ListDataStreamsRequest::getPageNumber() const {
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void ListDataStreamsRequest::setPageNumber(int pageNumber) {
|
||||
pageNumber_ = pageNumber;
|
||||
setParameter(std::string("pageNumber"), std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
108
es-serverless/src/model/ListDataStreamsResult.cc
Normal file
108
es-serverless/src/model/ListDataStreamsResult.cc
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/es-serverless/model/ListDataStreamsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
ListDataStreamsResult::ListDataStreamsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListDataStreamsResult::ListDataStreamsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListDataStreamsResult::~ListDataStreamsResult()
|
||||
{}
|
||||
|
||||
void ListDataStreamsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allresultNode = value["result"]["dataStream"];
|
||||
for (auto valueresultdataStream : allresultNode)
|
||||
{
|
||||
DataStream resultObject;
|
||||
if(!valueresultdataStream["appName"].isNull())
|
||||
resultObject.appName = valueresultdataStream["appName"].asString();
|
||||
if(!valueresultdataStream["regionId"].isNull())
|
||||
resultObject.regionId = valueresultdataStream["regionId"].asString();
|
||||
if(!valueresultdataStream["deletePhase"].isNull())
|
||||
resultObject.deletePhase = valueresultdataStream["deletePhase"].asString();
|
||||
if(!valueresultdataStream["dataStreamName"].isNull())
|
||||
resultObject.dataStreamName = valueresultdataStream["dataStreamName"].asString();
|
||||
if(!valueresultdataStream["dataStreamId"].isNull())
|
||||
resultObject.dataStreamId = valueresultdataStream["dataStreamId"].asString();
|
||||
if(!valueresultdataStream["type"].isNull())
|
||||
resultObject.type = valueresultdataStream["type"].asString();
|
||||
if(!valueresultdataStream["createTime"].isNull())
|
||||
resultObject.createTime = valueresultdataStream["createTime"].asString();
|
||||
if(!valueresultdataStream["timeStampKey"].isNull())
|
||||
resultObject.timeStampKey = valueresultdataStream["timeStampKey"].asString();
|
||||
auto _templateNode = value["template"];
|
||||
auto allmappingsNode = _templateNode["mappings"]["mappingsItem"];
|
||||
for (auto _templateNodemappingsmappingsItem : allmappingsNode)
|
||||
{
|
||||
DataStream::_Template::MappingsItem mappingsItemObject;
|
||||
if(!_templateNodemappingsmappingsItem["type"].isNull())
|
||||
mappingsItemObject.type = _templateNodemappingsmappingsItem["type"].asString();
|
||||
if(!_templateNodemappingsmappingsItem["caseSensitive"].isNull())
|
||||
mappingsItemObject.caseSensitive = _templateNodemappingsmappingsItem["caseSensitive"].asString() == "true";
|
||||
if(!_templateNodemappingsmappingsItem["docValues"].isNull())
|
||||
mappingsItemObject.docValues = _templateNodemappingsmappingsItem["docValues"].asString() == "true";
|
||||
if(!_templateNodemappingsmappingsItem["index"].isNull())
|
||||
mappingsItemObject.index = _templateNodemappingsmappingsItem["index"].asString() == "true";
|
||||
if(!_templateNodemappingsmappingsItem["key"].isNull())
|
||||
mappingsItemObject.key = _templateNodemappingsmappingsItem["key"].asString();
|
||||
auto allTokenizeOnChars = value["tokenizeOnChars"]["null"];
|
||||
for (auto value : allTokenizeOnChars)
|
||||
mappingsItemObject.tokenizeOnChars.push_back(value.asString());
|
||||
auto allProperties = value["properties"]["null"];
|
||||
for (auto value : allProperties)
|
||||
mappingsItemObject.properties.push_back(value.asString());
|
||||
resultObject._template.mappings.push_back(mappingsItemObject);
|
||||
}
|
||||
result_.push_back(resultObject);
|
||||
}
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["totalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["totalCount"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListDataStreamsResult::DataStream> ListDataStreamsResult::getresult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
int ListDataStreamsResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string ListDataStreamsResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
46
es-serverless/src/model/UpdateAppRequest.cc
Normal file
46
es-serverless/src/model/UpdateAppRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/es-serverless/model/UpdateAppRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::UpdateAppRequest;
|
||||
|
||||
UpdateAppRequest::UpdateAppRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]"};
|
||||
setMethod(HttpRequest::Method::Put);
|
||||
}
|
||||
|
||||
UpdateAppRequest::~UpdateAppRequest() {}
|
||||
|
||||
std::string UpdateAppRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void UpdateAppRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string UpdateAppRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void UpdateAppRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("Body"), body);
|
||||
}
|
||||
|
||||
51
es-serverless/src/model/UpdateAppResult.cc
Normal file
51
es-serverless/src/model/UpdateAppResult.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/es-serverless/model/UpdateAppResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
UpdateAppResult::UpdateAppResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdateAppResult::UpdateAppResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdateAppResult::~UpdateAppResult()
|
||||
{}
|
||||
|
||||
void UpdateAppResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string UpdateAppResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
55
es-serverless/src/model/UpdateDataStreamRequest.cc
Normal file
55
es-serverless/src/model/UpdateDataStreamRequest.cc
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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/es-serverless/model/UpdateDataStreamRequest.h>
|
||||
|
||||
using AlibabaCloud::Es_serverless::Model::UpdateDataStreamRequest;
|
||||
|
||||
UpdateDataStreamRequest::UpdateDataStreamRequest()
|
||||
: RoaServiceRequest("es-serverless", "2022-08-22") {
|
||||
setResourcePath("/openapi/xops/instances/[appName]/data-streams/[dataStreamName]"};
|
||||
setMethod(HttpRequest::Method::Put);
|
||||
}
|
||||
|
||||
UpdateDataStreamRequest::~UpdateDataStreamRequest() {}
|
||||
|
||||
std::string UpdateDataStreamRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void UpdateDataStreamRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string UpdateDataStreamRequest::getDataStreamName() const {
|
||||
return dataStreamName_;
|
||||
}
|
||||
|
||||
void UpdateDataStreamRequest::setDataStreamName(const std::string &dataStreamName) {
|
||||
dataStreamName_ = dataStreamName;
|
||||
setParameter(std::string("dataStreamName"), dataStreamName);
|
||||
}
|
||||
|
||||
std::string UpdateDataStreamRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void UpdateDataStreamRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("Body"), body);
|
||||
}
|
||||
|
||||
59
es-serverless/src/model/UpdateDataStreamResult.cc
Normal file
59
es-serverless/src/model/UpdateDataStreamResult.cc
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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/es-serverless/model/UpdateDataStreamResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Es_serverless;
|
||||
using namespace AlibabaCloud::Es_serverless::Model;
|
||||
|
||||
UpdateDataStreamResult::UpdateDataStreamResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdateDataStreamResult::UpdateDataStreamResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdateDataStreamResult::~UpdateDataStreamResult()
|
||||
{}
|
||||
|
||||
void UpdateDataStreamResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto resultNode = value["result"];
|
||||
if(!resultNode["appName"].isNull())
|
||||
result_.appName = resultNode["appName"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string UpdateDataStreamResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
UpdateDataStreamResult::Result UpdateDataStreamResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user