Remove useless Agent parameters.
This commit is contained in:
593
mns-open/src/Mns-openClient.cc
Normal file
593
mns-open/src/Mns-openClient.cc
Normal file
@@ -0,0 +1,593 @@
|
||||
/*
|
||||
* 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/mns-open/Mns_openClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "Mns-open";
|
||||
}
|
||||
|
||||
Mns_openClient::Mns_openClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "mns");
|
||||
}
|
||||
|
||||
Mns_openClient::Mns_openClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "mns");
|
||||
}
|
||||
|
||||
Mns_openClient::Mns_openClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "mns");
|
||||
}
|
||||
|
||||
Mns_openClient::~Mns_openClient()
|
||||
{}
|
||||
|
||||
Mns_openClient::CreateQueueOutcome Mns_openClient::createQueue(const CreateQueueRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateQueueOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateQueueOutcome(CreateQueueResult(outcome.result()));
|
||||
else
|
||||
return CreateQueueOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::createQueueAsync(const CreateQueueRequest& request, const CreateQueueAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createQueue(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::CreateQueueOutcomeCallable Mns_openClient::createQueueCallable(const CreateQueueRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateQueueOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createQueue(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::CreateTopicOutcome Mns_openClient::createTopic(const CreateTopicRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateTopicOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateTopicOutcome(CreateTopicResult(outcome.result()));
|
||||
else
|
||||
return CreateTopicOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::createTopicAsync(const CreateTopicRequest& request, const CreateTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createTopic(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::CreateTopicOutcomeCallable Mns_openClient::createTopicCallable(const CreateTopicRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateTopicOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createTopic(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::DeleteQueueOutcome Mns_openClient::deleteQueue(const DeleteQueueRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteQueueOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteQueueOutcome(DeleteQueueResult(outcome.result()));
|
||||
else
|
||||
return DeleteQueueOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::deleteQueueAsync(const DeleteQueueRequest& request, const DeleteQueueAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteQueue(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::DeleteQueueOutcomeCallable Mns_openClient::deleteQueueCallable(const DeleteQueueRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteQueueOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteQueue(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::DeleteTopicOutcome Mns_openClient::deleteTopic(const DeleteTopicRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteTopicOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteTopicOutcome(DeleteTopicResult(outcome.result()));
|
||||
else
|
||||
return DeleteTopicOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::deleteTopicAsync(const DeleteTopicRequest& request, const DeleteTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteTopic(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::DeleteTopicOutcomeCallable Mns_openClient::deleteTopicCallable(const DeleteTopicRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteTopicOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteTopic(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::GetQueueAttributesOutcome Mns_openClient::getQueueAttributes(const GetQueueAttributesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetQueueAttributesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetQueueAttributesOutcome(GetQueueAttributesResult(outcome.result()));
|
||||
else
|
||||
return GetQueueAttributesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::getQueueAttributesAsync(const GetQueueAttributesRequest& request, const GetQueueAttributesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getQueueAttributes(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::GetQueueAttributesOutcomeCallable Mns_openClient::getQueueAttributesCallable(const GetQueueAttributesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetQueueAttributesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getQueueAttributes(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::GetSubscriptionAttributesOutcome Mns_openClient::getSubscriptionAttributes(const GetSubscriptionAttributesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetSubscriptionAttributesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetSubscriptionAttributesOutcome(GetSubscriptionAttributesResult(outcome.result()));
|
||||
else
|
||||
return GetSubscriptionAttributesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::getSubscriptionAttributesAsync(const GetSubscriptionAttributesRequest& request, const GetSubscriptionAttributesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getSubscriptionAttributes(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::GetSubscriptionAttributesOutcomeCallable Mns_openClient::getSubscriptionAttributesCallable(const GetSubscriptionAttributesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetSubscriptionAttributesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getSubscriptionAttributes(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::GetTopicAttributesOutcome Mns_openClient::getTopicAttributes(const GetTopicAttributesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetTopicAttributesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetTopicAttributesOutcome(GetTopicAttributesResult(outcome.result()));
|
||||
else
|
||||
return GetTopicAttributesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::getTopicAttributesAsync(const GetTopicAttributesRequest& request, const GetTopicAttributesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getTopicAttributes(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::GetTopicAttributesOutcomeCallable Mns_openClient::getTopicAttributesCallable(const GetTopicAttributesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetTopicAttributesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getTopicAttributes(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::ListQueueOutcome Mns_openClient::listQueue(const ListQueueRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListQueueOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListQueueOutcome(ListQueueResult(outcome.result()));
|
||||
else
|
||||
return ListQueueOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::listQueueAsync(const ListQueueRequest& request, const ListQueueAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listQueue(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::ListQueueOutcomeCallable Mns_openClient::listQueueCallable(const ListQueueRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListQueueOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listQueue(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::ListSubscriptionByTopicOutcome Mns_openClient::listSubscriptionByTopic(const ListSubscriptionByTopicRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListSubscriptionByTopicOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListSubscriptionByTopicOutcome(ListSubscriptionByTopicResult(outcome.result()));
|
||||
else
|
||||
return ListSubscriptionByTopicOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::listSubscriptionByTopicAsync(const ListSubscriptionByTopicRequest& request, const ListSubscriptionByTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listSubscriptionByTopic(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::ListSubscriptionByTopicOutcomeCallable Mns_openClient::listSubscriptionByTopicCallable(const ListSubscriptionByTopicRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListSubscriptionByTopicOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listSubscriptionByTopic(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::ListTopicOutcome Mns_openClient::listTopic(const ListTopicRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListTopicOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListTopicOutcome(ListTopicResult(outcome.result()));
|
||||
else
|
||||
return ListTopicOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::listTopicAsync(const ListTopicRequest& request, const ListTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listTopic(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::ListTopicOutcomeCallable Mns_openClient::listTopicCallable(const ListTopicRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListTopicOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listTopic(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::SetQueueAttributesOutcome Mns_openClient::setQueueAttributes(const SetQueueAttributesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SetQueueAttributesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SetQueueAttributesOutcome(SetQueueAttributesResult(outcome.result()));
|
||||
else
|
||||
return SetQueueAttributesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::setQueueAttributesAsync(const SetQueueAttributesRequest& request, const SetQueueAttributesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, setQueueAttributes(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::SetQueueAttributesOutcomeCallable Mns_openClient::setQueueAttributesCallable(const SetQueueAttributesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SetQueueAttributesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->setQueueAttributes(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::SetSubscriptionAttributesOutcome Mns_openClient::setSubscriptionAttributes(const SetSubscriptionAttributesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SetSubscriptionAttributesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SetSubscriptionAttributesOutcome(SetSubscriptionAttributesResult(outcome.result()));
|
||||
else
|
||||
return SetSubscriptionAttributesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::setSubscriptionAttributesAsync(const SetSubscriptionAttributesRequest& request, const SetSubscriptionAttributesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, setSubscriptionAttributes(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::SetSubscriptionAttributesOutcomeCallable Mns_openClient::setSubscriptionAttributesCallable(const SetSubscriptionAttributesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SetSubscriptionAttributesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->setSubscriptionAttributes(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::SetTopicAttributesOutcome Mns_openClient::setTopicAttributes(const SetTopicAttributesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SetTopicAttributesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SetTopicAttributesOutcome(SetTopicAttributesResult(outcome.result()));
|
||||
else
|
||||
return SetTopicAttributesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::setTopicAttributesAsync(const SetTopicAttributesRequest& request, const SetTopicAttributesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, setTopicAttributes(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::SetTopicAttributesOutcomeCallable Mns_openClient::setTopicAttributesCallable(const SetTopicAttributesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SetTopicAttributesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->setTopicAttributes(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::SubscribeOutcome Mns_openClient::subscribe(const SubscribeRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SubscribeOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SubscribeOutcome(SubscribeResult(outcome.result()));
|
||||
else
|
||||
return SubscribeOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::subscribeAsync(const SubscribeRequest& request, const SubscribeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, subscribe(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::SubscribeOutcomeCallable Mns_openClient::subscribeCallable(const SubscribeRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SubscribeOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->subscribe(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Mns_openClient::UnsubscribeOutcome Mns_openClient::unsubscribe(const UnsubscribeRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UnsubscribeOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UnsubscribeOutcome(UnsubscribeResult(outcome.result()));
|
||||
else
|
||||
return UnsubscribeOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Mns_openClient::unsubscribeAsync(const UnsubscribeRequest& request, const UnsubscribeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, unsubscribe(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Mns_openClient::UnsubscribeOutcomeCallable Mns_openClient::unsubscribeCallable(const UnsubscribeRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UnsubscribeOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->unsubscribe(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
90
mns-open/src/model/CreateQueueRequest.cc
Normal file
90
mns-open/src/model/CreateQueueRequest.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/CreateQueueRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::CreateQueueRequest;
|
||||
|
||||
CreateQueueRequest::CreateQueueRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "CreateQueue") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateQueueRequest::~CreateQueueRequest() {}
|
||||
|
||||
std::string CreateQueueRequest::getQueueName() const {
|
||||
return queueName_;
|
||||
}
|
||||
|
||||
void CreateQueueRequest::setQueueName(const std::string &queueName) {
|
||||
queueName_ = queueName;
|
||||
setParameter(std::string("QueueName"), queueName);
|
||||
}
|
||||
|
||||
long CreateQueueRequest::getMessageRetentionPeriod() const {
|
||||
return messageRetentionPeriod_;
|
||||
}
|
||||
|
||||
void CreateQueueRequest::setMessageRetentionPeriod(long messageRetentionPeriod) {
|
||||
messageRetentionPeriod_ = messageRetentionPeriod;
|
||||
setParameter(std::string("MessageRetentionPeriod"), std::to_string(messageRetentionPeriod));
|
||||
}
|
||||
|
||||
bool CreateQueueRequest::getEnableLogging() const {
|
||||
return enableLogging_;
|
||||
}
|
||||
|
||||
void CreateQueueRequest::setEnableLogging(bool enableLogging) {
|
||||
enableLogging_ = enableLogging;
|
||||
setParameter(std::string("EnableLogging"), enableLogging ? "true" : "false");
|
||||
}
|
||||
|
||||
long CreateQueueRequest::getVisibilityTimeout() const {
|
||||
return visibilityTimeout_;
|
||||
}
|
||||
|
||||
void CreateQueueRequest::setVisibilityTimeout(long visibilityTimeout) {
|
||||
visibilityTimeout_ = visibilityTimeout;
|
||||
setParameter(std::string("VisibilityTimeout"), std::to_string(visibilityTimeout));
|
||||
}
|
||||
|
||||
long CreateQueueRequest::getMaximumMessageSize() const {
|
||||
return maximumMessageSize_;
|
||||
}
|
||||
|
||||
void CreateQueueRequest::setMaximumMessageSize(long maximumMessageSize) {
|
||||
maximumMessageSize_ = maximumMessageSize;
|
||||
setParameter(std::string("MaximumMessageSize"), std::to_string(maximumMessageSize));
|
||||
}
|
||||
|
||||
long CreateQueueRequest::getDelaySeconds() const {
|
||||
return delaySeconds_;
|
||||
}
|
||||
|
||||
void CreateQueueRequest::setDelaySeconds(long delaySeconds) {
|
||||
delaySeconds_ = delaySeconds;
|
||||
setParameter(std::string("DelaySeconds"), std::to_string(delaySeconds));
|
||||
}
|
||||
|
||||
long CreateQueueRequest::getPollingWaitSeconds() const {
|
||||
return pollingWaitSeconds_;
|
||||
}
|
||||
|
||||
void CreateQueueRequest::setPollingWaitSeconds(long pollingWaitSeconds) {
|
||||
pollingWaitSeconds_ = pollingWaitSeconds;
|
||||
setParameter(std::string("PollingWaitSeconds"), std::to_string(pollingWaitSeconds));
|
||||
}
|
||||
|
||||
84
mns-open/src/model/CreateQueueResult.cc
Normal file
84
mns-open/src/model/CreateQueueResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/CreateQueueResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
CreateQueueResult::CreateQueueResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateQueueResult::CreateQueueResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateQueueResult::~CreateQueueResult()
|
||||
{}
|
||||
|
||||
void CreateQueueResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Code"].isNull())
|
||||
data_.code = std::stol(dataNode["Code"].asString());
|
||||
if(!dataNode["Message"].isNull())
|
||||
data_.message = dataNode["Message"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string CreateQueueResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string CreateQueueResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
CreateQueueResult::Data CreateQueueResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long CreateQueueResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool CreateQueueResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
54
mns-open/src/model/CreateTopicRequest.cc
Normal file
54
mns-open/src/model/CreateTopicRequest.cc
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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/mns-open/model/CreateTopicRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::CreateTopicRequest;
|
||||
|
||||
CreateTopicRequest::CreateTopicRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "CreateTopic") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateTopicRequest::~CreateTopicRequest() {}
|
||||
|
||||
std::string CreateTopicRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void CreateTopicRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setBodyParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
long CreateTopicRequest::getMaxMessageSize() const {
|
||||
return maxMessageSize_;
|
||||
}
|
||||
|
||||
void CreateTopicRequest::setMaxMessageSize(long maxMessageSize) {
|
||||
maxMessageSize_ = maxMessageSize;
|
||||
setBodyParameter(std::string("MaxMessageSize"), std::to_string(maxMessageSize));
|
||||
}
|
||||
|
||||
bool CreateTopicRequest::getEnableLogging() const {
|
||||
return enableLogging_;
|
||||
}
|
||||
|
||||
void CreateTopicRequest::setEnableLogging(bool enableLogging) {
|
||||
enableLogging_ = enableLogging;
|
||||
setBodyParameter(std::string("EnableLogging"), enableLogging ? "true" : "false");
|
||||
}
|
||||
|
||||
84
mns-open/src/model/CreateTopicResult.cc
Normal file
84
mns-open/src/model/CreateTopicResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/CreateTopicResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
CreateTopicResult::CreateTopicResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateTopicResult::CreateTopicResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateTopicResult::~CreateTopicResult()
|
||||
{}
|
||||
|
||||
void CreateTopicResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Code"].isNull())
|
||||
data_.code = std::stol(dataNode["Code"].asString());
|
||||
if(!dataNode["Message"].isNull())
|
||||
data_.message = dataNode["Message"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string CreateTopicResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string CreateTopicResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
CreateTopicResult::Data CreateTopicResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long CreateTopicResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool CreateTopicResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
36
mns-open/src/model/DeleteQueueRequest.cc
Normal file
36
mns-open/src/model/DeleteQueueRequest.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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/mns-open/model/DeleteQueueRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::DeleteQueueRequest;
|
||||
|
||||
DeleteQueueRequest::DeleteQueueRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "DeleteQueue") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteQueueRequest::~DeleteQueueRequest() {}
|
||||
|
||||
std::string DeleteQueueRequest::getQueueName() const {
|
||||
return queueName_;
|
||||
}
|
||||
|
||||
void DeleteQueueRequest::setQueueName(const std::string &queueName) {
|
||||
queueName_ = queueName;
|
||||
setParameter(std::string("QueueName"), queueName);
|
||||
}
|
||||
|
||||
84
mns-open/src/model/DeleteQueueResult.cc
Normal file
84
mns-open/src/model/DeleteQueueResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/DeleteQueueResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
DeleteQueueResult::DeleteQueueResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteQueueResult::DeleteQueueResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteQueueResult::~DeleteQueueResult()
|
||||
{}
|
||||
|
||||
void DeleteQueueResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Code"].isNull())
|
||||
data_.code = std::stol(dataNode["Code"].asString());
|
||||
if(!dataNode["Message"].isNull())
|
||||
data_.message = dataNode["Message"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteQueueResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string DeleteQueueResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
DeleteQueueResult::Data DeleteQueueResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long DeleteQueueResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool DeleteQueueResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
36
mns-open/src/model/DeleteTopicRequest.cc
Normal file
36
mns-open/src/model/DeleteTopicRequest.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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/mns-open/model/DeleteTopicRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::DeleteTopicRequest;
|
||||
|
||||
DeleteTopicRequest::DeleteTopicRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "DeleteTopic") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteTopicRequest::~DeleteTopicRequest() {}
|
||||
|
||||
std::string DeleteTopicRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void DeleteTopicRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
79
mns-open/src/model/DeleteTopicResult.cc
Normal file
79
mns-open/src/model/DeleteTopicResult.cc
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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/mns-open/model/DeleteTopicResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
DeleteTopicResult::DeleteTopicResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteTopicResult::DeleteTopicResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteTopicResult::~DeleteTopicResult()
|
||||
{}
|
||||
|
||||
void DeleteTopicResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteTopicResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string DeleteTopicResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string DeleteTopicResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long DeleteTopicResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool DeleteTopicResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
36
mns-open/src/model/GetQueueAttributesRequest.cc
Normal file
36
mns-open/src/model/GetQueueAttributesRequest.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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/mns-open/model/GetQueueAttributesRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::GetQueueAttributesRequest;
|
||||
|
||||
GetQueueAttributesRequest::GetQueueAttributesRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "GetQueueAttributes") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetQueueAttributesRequest::~GetQueueAttributesRequest() {}
|
||||
|
||||
std::string GetQueueAttributesRequest::getQueueName() const {
|
||||
return queueName_;
|
||||
}
|
||||
|
||||
void GetQueueAttributesRequest::setQueueName(const std::string &queueName) {
|
||||
queueName_ = queueName;
|
||||
setParameter(std::string("QueueName"), queueName);
|
||||
}
|
||||
|
||||
106
mns-open/src/model/GetQueueAttributesResult.cc
Normal file
106
mns-open/src/model/GetQueueAttributesResult.cc
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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/mns-open/model/GetQueueAttributesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
GetQueueAttributesResult::GetQueueAttributesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetQueueAttributesResult::GetQueueAttributesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetQueueAttributesResult::~GetQueueAttributesResult()
|
||||
{}
|
||||
|
||||
void GetQueueAttributesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["QueueUrl"].isNull())
|
||||
data_.queueUrl = dataNode["QueueUrl"].asString();
|
||||
if(!dataNode["QueueInternalUrl"].isNull())
|
||||
data_.queueInternalUrl = dataNode["QueueInternalUrl"].asString();
|
||||
if(!dataNode["QueueName"].isNull())
|
||||
data_.queueName = dataNode["QueueName"].asString();
|
||||
if(!dataNode["CreateTime"].isNull())
|
||||
data_.createTime = std::stol(dataNode["CreateTime"].asString());
|
||||
if(!dataNode["LastModifyTime"].isNull())
|
||||
data_.lastModifyTime = std::stol(dataNode["LastModifyTime"].asString());
|
||||
if(!dataNode["DelaySeconds"].isNull())
|
||||
data_.delaySeconds = std::stol(dataNode["DelaySeconds"].asString());
|
||||
if(!dataNode["MaximumMessageSize"].isNull())
|
||||
data_.maximumMessageSize = std::stol(dataNode["MaximumMessageSize"].asString());
|
||||
if(!dataNode["MessageRetentionPeriod"].isNull())
|
||||
data_.messageRetentionPeriod = std::stol(dataNode["MessageRetentionPeriod"].asString());
|
||||
if(!dataNode["VisibilityTimeout"].isNull())
|
||||
data_.visibilityTimeout = std::stol(dataNode["VisibilityTimeout"].asString());
|
||||
if(!dataNode["PollingWaitSeconds"].isNull())
|
||||
data_.pollingWaitSeconds = std::stol(dataNode["PollingWaitSeconds"].asString());
|
||||
if(!dataNode["ActiveMessages"].isNull())
|
||||
data_.activeMessages = std::stol(dataNode["ActiveMessages"].asString());
|
||||
if(!dataNode["InactiveMessages"].isNull())
|
||||
data_.inactiveMessages = std::stol(dataNode["InactiveMessages"].asString());
|
||||
if(!dataNode["DelayMessages"].isNull())
|
||||
data_.delayMessages = std::stol(dataNode["DelayMessages"].asString());
|
||||
if(!dataNode["LoggingEnabled"].isNull())
|
||||
data_.loggingEnabled = dataNode["LoggingEnabled"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string GetQueueAttributesResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string GetQueueAttributesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
GetQueueAttributesResult::Data GetQueueAttributesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long GetQueueAttributesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetQueueAttributesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
45
mns-open/src/model/GetSubscriptionAttributesRequest.cc
Normal file
45
mns-open/src/model/GetSubscriptionAttributesRequest.cc
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/GetSubscriptionAttributesRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::GetSubscriptionAttributesRequest;
|
||||
|
||||
GetSubscriptionAttributesRequest::GetSubscriptionAttributesRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "GetSubscriptionAttributes") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetSubscriptionAttributesRequest::~GetSubscriptionAttributesRequest() {}
|
||||
|
||||
std::string GetSubscriptionAttributesRequest::getSubscriptionName() const {
|
||||
return subscriptionName_;
|
||||
}
|
||||
|
||||
void GetSubscriptionAttributesRequest::setSubscriptionName(const std::string &subscriptionName) {
|
||||
subscriptionName_ = subscriptionName;
|
||||
setParameter(std::string("SubscriptionName"), subscriptionName);
|
||||
}
|
||||
|
||||
std::string GetSubscriptionAttributesRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void GetSubscriptionAttributesRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
98
mns-open/src/model/GetSubscriptionAttributesResult.cc
Normal file
98
mns-open/src/model/GetSubscriptionAttributesResult.cc
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/GetSubscriptionAttributesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
GetSubscriptionAttributesResult::GetSubscriptionAttributesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetSubscriptionAttributesResult::GetSubscriptionAttributesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetSubscriptionAttributesResult::~GetSubscriptionAttributesResult()
|
||||
{}
|
||||
|
||||
void GetSubscriptionAttributesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["SubscriptionName"].isNull())
|
||||
data_.subscriptionName = dataNode["SubscriptionName"].asString();
|
||||
if(!dataNode["TopicOwner"].isNull())
|
||||
data_.topicOwner = dataNode["TopicOwner"].asString();
|
||||
if(!dataNode["TopicName"].isNull())
|
||||
data_.topicName = dataNode["TopicName"].asString();
|
||||
if(!dataNode["Endpoint"].isNull())
|
||||
data_.endpoint = dataNode["Endpoint"].asString();
|
||||
if(!dataNode["FilterTag"].isNull())
|
||||
data_.filterTag = dataNode["FilterTag"].asString();
|
||||
if(!dataNode["CreateTime"].isNull())
|
||||
data_.createTime = std::stol(dataNode["CreateTime"].asString());
|
||||
if(!dataNode["LastModifyTime"].isNull())
|
||||
data_.lastModifyTime = std::stol(dataNode["LastModifyTime"].asString());
|
||||
if(!dataNode["NotifyStrategy"].isNull())
|
||||
data_.notifyStrategy = dataNode["NotifyStrategy"].asString();
|
||||
if(!dataNode["NotifyContentFormat"].isNull())
|
||||
data_.notifyContentFormat = dataNode["NotifyContentFormat"].asString();
|
||||
if(!dataNode["SubscriptionURL"].isNull())
|
||||
data_.subscriptionURL = dataNode["SubscriptionURL"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string GetSubscriptionAttributesResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string GetSubscriptionAttributesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
GetSubscriptionAttributesResult::Data GetSubscriptionAttributesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long GetSubscriptionAttributesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetSubscriptionAttributesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
36
mns-open/src/model/GetTopicAttributesRequest.cc
Normal file
36
mns-open/src/model/GetTopicAttributesRequest.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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/mns-open/model/GetTopicAttributesRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::GetTopicAttributesRequest;
|
||||
|
||||
GetTopicAttributesRequest::GetTopicAttributesRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "GetTopicAttributes") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetTopicAttributesRequest::~GetTopicAttributesRequest() {}
|
||||
|
||||
std::string GetTopicAttributesRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void GetTopicAttributesRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
96
mns-open/src/model/GetTopicAttributesResult.cc
Normal file
96
mns-open/src/model/GetTopicAttributesResult.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/mns-open/model/GetTopicAttributesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
GetTopicAttributesResult::GetTopicAttributesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetTopicAttributesResult::GetTopicAttributesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetTopicAttributesResult::~GetTopicAttributesResult()
|
||||
{}
|
||||
|
||||
void GetTopicAttributesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["TopicName"].isNull())
|
||||
data_.topicName = dataNode["TopicName"].asString();
|
||||
if(!dataNode["MessageCount"].isNull())
|
||||
data_.messageCount = std::stol(dataNode["MessageCount"].asString());
|
||||
if(!dataNode["MaxMessageSize"].isNull())
|
||||
data_.maxMessageSize = std::stol(dataNode["MaxMessageSize"].asString());
|
||||
if(!dataNode["MessageRetentionPeriod"].isNull())
|
||||
data_.messageRetentionPeriod = std::stol(dataNode["MessageRetentionPeriod"].asString());
|
||||
if(!dataNode["CreateTime"].isNull())
|
||||
data_.createTime = std::stol(dataNode["CreateTime"].asString());
|
||||
if(!dataNode["LastModifyTime"].isNull())
|
||||
data_.lastModifyTime = std::stol(dataNode["LastModifyTime"].asString());
|
||||
if(!dataNode["TopicUrl"].isNull())
|
||||
data_.topicUrl = dataNode["TopicUrl"].asString();
|
||||
if(!dataNode["LoggingEnabled"].isNull())
|
||||
data_.loggingEnabled = dataNode["LoggingEnabled"].asString() == "true";
|
||||
if(!dataNode["TopicInnerUrl"].isNull())
|
||||
data_.topicInnerUrl = dataNode["TopicInnerUrl"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string GetTopicAttributesResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string GetTopicAttributesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
GetTopicAttributesResult::Data GetTopicAttributesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long GetTopicAttributesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetTopicAttributesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
54
mns-open/src/model/ListQueueRequest.cc
Normal file
54
mns-open/src/model/ListQueueRequest.cc
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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/mns-open/model/ListQueueRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::ListQueueRequest;
|
||||
|
||||
ListQueueRequest::ListQueueRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "ListQueue") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListQueueRequest::~ListQueueRequest() {}
|
||||
|
||||
std::string ListQueueRequest::getQueueName() const {
|
||||
return queueName_;
|
||||
}
|
||||
|
||||
void ListQueueRequest::setQueueName(const std::string &queueName) {
|
||||
queueName_ = queueName;
|
||||
setParameter(std::string("QueueName"), queueName);
|
||||
}
|
||||
|
||||
long ListQueueRequest::getPageNum() const {
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void ListQueueRequest::setPageNum(long pageNum) {
|
||||
pageNum_ = pageNum;
|
||||
setParameter(std::string("PageNum"), std::to_string(pageNum));
|
||||
}
|
||||
|
||||
long ListQueueRequest::getPageSize() const {
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListQueueRequest::setPageSize(long pageSize) {
|
||||
pageSize_ = pageSize;
|
||||
setParameter(std::string("PageSize"), std::to_string(pageSize));
|
||||
}
|
||||
|
||||
122
mns-open/src/model/ListQueueResult.cc
Normal file
122
mns-open/src/model/ListQueueResult.cc
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/ListQueueResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
ListQueueResult::ListQueueResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListQueueResult::ListQueueResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListQueueResult::~ListQueueResult()
|
||||
{}
|
||||
|
||||
void ListQueueResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["PageNum"].isNull())
|
||||
data_.pageNum = std::stol(dataNode["PageNum"].asString());
|
||||
if(!dataNode["PageSize"].isNull())
|
||||
data_.pageSize = std::stol(dataNode["PageSize"].asString());
|
||||
if(!dataNode["Size"].isNull())
|
||||
data_.size = std::stol(dataNode["Size"].asString());
|
||||
if(!dataNode["Pages"].isNull())
|
||||
data_.pages = std::stol(dataNode["Pages"].asString());
|
||||
if(!dataNode["Total"].isNull())
|
||||
data_.total = std::stol(dataNode["Total"].asString());
|
||||
auto allPageDataNode = dataNode["PageData"]["pageDataItem"];
|
||||
for (auto dataNodePageDatapageDataItem : allPageDataNode)
|
||||
{
|
||||
Data::PageDataItem pageDataItemObject;
|
||||
if(!dataNodePageDatapageDataItem["QueueUrl"].isNull())
|
||||
pageDataItemObject.queueUrl = dataNodePageDatapageDataItem["QueueUrl"].asString();
|
||||
if(!dataNodePageDatapageDataItem["QueueInternalUrl"].isNull())
|
||||
pageDataItemObject.queueInternalUrl = dataNodePageDatapageDataItem["QueueInternalUrl"].asString();
|
||||
if(!dataNodePageDatapageDataItem["QueueName"].isNull())
|
||||
pageDataItemObject.queueName = dataNodePageDatapageDataItem["QueueName"].asString();
|
||||
if(!dataNodePageDatapageDataItem["CreateTime"].isNull())
|
||||
pageDataItemObject.createTime = std::stol(dataNodePageDatapageDataItem["CreateTime"].asString());
|
||||
if(!dataNodePageDatapageDataItem["LastModifyTime"].isNull())
|
||||
pageDataItemObject.lastModifyTime = std::stol(dataNodePageDatapageDataItem["LastModifyTime"].asString());
|
||||
if(!dataNodePageDatapageDataItem["DelaySeconds"].isNull())
|
||||
pageDataItemObject.delaySeconds = std::stol(dataNodePageDatapageDataItem["DelaySeconds"].asString());
|
||||
if(!dataNodePageDatapageDataItem["MaximumMessageSize"].isNull())
|
||||
pageDataItemObject.maximumMessageSize = std::stol(dataNodePageDatapageDataItem["MaximumMessageSize"].asString());
|
||||
if(!dataNodePageDatapageDataItem["MessageRetentionPeriod"].isNull())
|
||||
pageDataItemObject.messageRetentionPeriod = std::stol(dataNodePageDatapageDataItem["MessageRetentionPeriod"].asString());
|
||||
if(!dataNodePageDatapageDataItem["VisibilityTimeout"].isNull())
|
||||
pageDataItemObject.visibilityTimeout = std::stol(dataNodePageDatapageDataItem["VisibilityTimeout"].asString());
|
||||
if(!dataNodePageDatapageDataItem["PollingWaitSeconds"].isNull())
|
||||
pageDataItemObject.pollingWaitSeconds = std::stol(dataNodePageDatapageDataItem["PollingWaitSeconds"].asString());
|
||||
if(!dataNodePageDatapageDataItem["ActiveMessages"].isNull())
|
||||
pageDataItemObject.activeMessages = std::stol(dataNodePageDatapageDataItem["ActiveMessages"].asString());
|
||||
if(!dataNodePageDatapageDataItem["InactiveMessages"].isNull())
|
||||
pageDataItemObject.inactiveMessages = std::stol(dataNodePageDatapageDataItem["InactiveMessages"].asString());
|
||||
if(!dataNodePageDatapageDataItem["DelayMessages"].isNull())
|
||||
pageDataItemObject.delayMessages = std::stol(dataNodePageDatapageDataItem["DelayMessages"].asString());
|
||||
if(!dataNodePageDatapageDataItem["LoggingEnabled"].isNull())
|
||||
pageDataItemObject.loggingEnabled = dataNodePageDatapageDataItem["LoggingEnabled"].asString() == "true";
|
||||
data_.pageData.push_back(pageDataItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string ListQueueResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string ListQueueResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListQueueResult::Data ListQueueResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long ListQueueResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListQueueResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
63
mns-open/src/model/ListSubscriptionByTopicRequest.cc
Normal file
63
mns-open/src/model/ListSubscriptionByTopicRequest.cc
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/ListSubscriptionByTopicRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::ListSubscriptionByTopicRequest;
|
||||
|
||||
ListSubscriptionByTopicRequest::ListSubscriptionByTopicRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "ListSubscriptionByTopic") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListSubscriptionByTopicRequest::~ListSubscriptionByTopicRequest() {}
|
||||
|
||||
std::string ListSubscriptionByTopicRequest::getSubscriptionName() const {
|
||||
return subscriptionName_;
|
||||
}
|
||||
|
||||
void ListSubscriptionByTopicRequest::setSubscriptionName(const std::string &subscriptionName) {
|
||||
subscriptionName_ = subscriptionName;
|
||||
setParameter(std::string("SubscriptionName"), subscriptionName);
|
||||
}
|
||||
|
||||
std::string ListSubscriptionByTopicRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void ListSubscriptionByTopicRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
long ListSubscriptionByTopicRequest::getPageNum() const {
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void ListSubscriptionByTopicRequest::setPageNum(long pageNum) {
|
||||
pageNum_ = pageNum;
|
||||
setParameter(std::string("PageNum"), std::to_string(pageNum));
|
||||
}
|
||||
|
||||
long ListSubscriptionByTopicRequest::getPageSize() const {
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListSubscriptionByTopicRequest::setPageSize(long pageSize) {
|
||||
pageSize_ = pageSize;
|
||||
setParameter(std::string("PageSize"), std::to_string(pageSize));
|
||||
}
|
||||
|
||||
114
mns-open/src/model/ListSubscriptionByTopicResult.cc
Normal file
114
mns-open/src/model/ListSubscriptionByTopicResult.cc
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* 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/mns-open/model/ListSubscriptionByTopicResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
ListSubscriptionByTopicResult::ListSubscriptionByTopicResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListSubscriptionByTopicResult::ListSubscriptionByTopicResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListSubscriptionByTopicResult::~ListSubscriptionByTopicResult()
|
||||
{}
|
||||
|
||||
void ListSubscriptionByTopicResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["PageNum"].isNull())
|
||||
data_.pageNum = std::stol(dataNode["PageNum"].asString());
|
||||
if(!dataNode["PageSize"].isNull())
|
||||
data_.pageSize = std::stol(dataNode["PageSize"].asString());
|
||||
if(!dataNode["Size"].isNull())
|
||||
data_.size = std::stol(dataNode["Size"].asString());
|
||||
if(!dataNode["Pages"].isNull())
|
||||
data_.pages = std::stol(dataNode["Pages"].asString());
|
||||
if(!dataNode["Total"].isNull())
|
||||
data_.total = std::stol(dataNode["Total"].asString());
|
||||
auto allPageDataNode = dataNode["PageData"]["pageDataItem"];
|
||||
for (auto dataNodePageDatapageDataItem : allPageDataNode)
|
||||
{
|
||||
Data::PageDataItem pageDataItemObject;
|
||||
if(!dataNodePageDatapageDataItem["SubscriptionName"].isNull())
|
||||
pageDataItemObject.subscriptionName = dataNodePageDatapageDataItem["SubscriptionName"].asString();
|
||||
if(!dataNodePageDatapageDataItem["TopicOwner"].isNull())
|
||||
pageDataItemObject.topicOwner = dataNodePageDatapageDataItem["TopicOwner"].asString();
|
||||
if(!dataNodePageDatapageDataItem["TopicName"].isNull())
|
||||
pageDataItemObject.topicName = dataNodePageDatapageDataItem["TopicName"].asString();
|
||||
if(!dataNodePageDatapageDataItem["Endpoint"].isNull())
|
||||
pageDataItemObject.endpoint = dataNodePageDatapageDataItem["Endpoint"].asString();
|
||||
if(!dataNodePageDatapageDataItem["FilterTag"].isNull())
|
||||
pageDataItemObject.filterTag = dataNodePageDatapageDataItem["FilterTag"].asString();
|
||||
if(!dataNodePageDatapageDataItem["CreateTime"].isNull())
|
||||
pageDataItemObject.createTime = std::stol(dataNodePageDatapageDataItem["CreateTime"].asString());
|
||||
if(!dataNodePageDatapageDataItem["LastModifyTime"].isNull())
|
||||
pageDataItemObject.lastModifyTime = std::stol(dataNodePageDatapageDataItem["LastModifyTime"].asString());
|
||||
if(!dataNodePageDatapageDataItem["NotifyStrategy"].isNull())
|
||||
pageDataItemObject.notifyStrategy = dataNodePageDatapageDataItem["NotifyStrategy"].asString();
|
||||
if(!dataNodePageDatapageDataItem["NotifyContentFormat"].isNull())
|
||||
pageDataItemObject.notifyContentFormat = dataNodePageDatapageDataItem["NotifyContentFormat"].asString();
|
||||
if(!dataNodePageDatapageDataItem["SubscriptionURL"].isNull())
|
||||
pageDataItemObject.subscriptionURL = dataNodePageDatapageDataItem["SubscriptionURL"].asString();
|
||||
data_.pageData.push_back(pageDataItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string ListSubscriptionByTopicResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string ListSubscriptionByTopicResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListSubscriptionByTopicResult::Data ListSubscriptionByTopicResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long ListSubscriptionByTopicResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListSubscriptionByTopicResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
54
mns-open/src/model/ListTopicRequest.cc
Normal file
54
mns-open/src/model/ListTopicRequest.cc
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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/mns-open/model/ListTopicRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::ListTopicRequest;
|
||||
|
||||
ListTopicRequest::ListTopicRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "ListTopic") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListTopicRequest::~ListTopicRequest() {}
|
||||
|
||||
std::string ListTopicRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void ListTopicRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
long ListTopicRequest::getPageNum() const {
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void ListTopicRequest::setPageNum(long pageNum) {
|
||||
pageNum_ = pageNum;
|
||||
setParameter(std::string("PageNum"), std::to_string(pageNum));
|
||||
}
|
||||
|
||||
long ListTopicRequest::getPageSize() const {
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListTopicRequest::setPageSize(long pageSize) {
|
||||
pageSize_ = pageSize;
|
||||
setParameter(std::string("PageSize"), std::to_string(pageSize));
|
||||
}
|
||||
|
||||
108
mns-open/src/model/ListTopicResult.cc
Normal file
108
mns-open/src/model/ListTopicResult.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/mns-open/model/ListTopicResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
ListTopicResult::ListTopicResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListTopicResult::ListTopicResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListTopicResult::~ListTopicResult()
|
||||
{}
|
||||
|
||||
void ListTopicResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["PageNum"].isNull())
|
||||
data_.pageNum = std::stol(dataNode["PageNum"].asString());
|
||||
if(!dataNode["PageSize"].isNull())
|
||||
data_.pageSize = std::stol(dataNode["PageSize"].asString());
|
||||
if(!dataNode["Total"].isNull())
|
||||
data_.total = std::stol(dataNode["Total"].asString());
|
||||
auto allPageDataNode = dataNode["PageData"]["pageDataItem"];
|
||||
for (auto dataNodePageDatapageDataItem : allPageDataNode)
|
||||
{
|
||||
Data::PageDataItem pageDataItemObject;
|
||||
if(!dataNodePageDatapageDataItem["TopicName"].isNull())
|
||||
pageDataItemObject.topicName = dataNodePageDatapageDataItem["TopicName"].asString();
|
||||
if(!dataNodePageDatapageDataItem["MessageCount"].isNull())
|
||||
pageDataItemObject.messageCount = std::stol(dataNodePageDatapageDataItem["MessageCount"].asString());
|
||||
if(!dataNodePageDatapageDataItem["MaxMessageSize"].isNull())
|
||||
pageDataItemObject.maxMessageSize = std::stol(dataNodePageDatapageDataItem["MaxMessageSize"].asString());
|
||||
if(!dataNodePageDatapageDataItem["MessageRetentionPeriod"].isNull())
|
||||
pageDataItemObject.messageRetentionPeriod = std::stol(dataNodePageDatapageDataItem["MessageRetentionPeriod"].asString());
|
||||
if(!dataNodePageDatapageDataItem["CreateTime"].isNull())
|
||||
pageDataItemObject.createTime = std::stol(dataNodePageDatapageDataItem["CreateTime"].asString());
|
||||
if(!dataNodePageDatapageDataItem["LastModifyTime"].isNull())
|
||||
pageDataItemObject.lastModifyTime = std::stol(dataNodePageDatapageDataItem["LastModifyTime"].asString());
|
||||
if(!dataNodePageDatapageDataItem["TopicUrl"].isNull())
|
||||
pageDataItemObject.topicUrl = dataNodePageDatapageDataItem["TopicUrl"].asString();
|
||||
if(!dataNodePageDatapageDataItem["TopicInnerUrl"].isNull())
|
||||
pageDataItemObject.topicInnerUrl = dataNodePageDatapageDataItem["TopicInnerUrl"].asString();
|
||||
if(!dataNodePageDatapageDataItem["LoggingEnabled"].isNull())
|
||||
pageDataItemObject.loggingEnabled = dataNodePageDatapageDataItem["LoggingEnabled"].asString() == "true";
|
||||
data_.pageData.push_back(pageDataItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string ListTopicResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string ListTopicResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListTopicResult::Data ListTopicResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long ListTopicResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListTopicResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
90
mns-open/src/model/SetQueueAttributesRequest.cc
Normal file
90
mns-open/src/model/SetQueueAttributesRequest.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/SetQueueAttributesRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::SetQueueAttributesRequest;
|
||||
|
||||
SetQueueAttributesRequest::SetQueueAttributesRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "SetQueueAttributes") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SetQueueAttributesRequest::~SetQueueAttributesRequest() {}
|
||||
|
||||
std::string SetQueueAttributesRequest::getQueueName() const {
|
||||
return queueName_;
|
||||
}
|
||||
|
||||
void SetQueueAttributesRequest::setQueueName(const std::string &queueName) {
|
||||
queueName_ = queueName;
|
||||
setParameter(std::string("QueueName"), queueName);
|
||||
}
|
||||
|
||||
long SetQueueAttributesRequest::getMessageRetentionPeriod() const {
|
||||
return messageRetentionPeriod_;
|
||||
}
|
||||
|
||||
void SetQueueAttributesRequest::setMessageRetentionPeriod(long messageRetentionPeriod) {
|
||||
messageRetentionPeriod_ = messageRetentionPeriod;
|
||||
setParameter(std::string("MessageRetentionPeriod"), std::to_string(messageRetentionPeriod));
|
||||
}
|
||||
|
||||
bool SetQueueAttributesRequest::getEnableLogging() const {
|
||||
return enableLogging_;
|
||||
}
|
||||
|
||||
void SetQueueAttributesRequest::setEnableLogging(bool enableLogging) {
|
||||
enableLogging_ = enableLogging;
|
||||
setParameter(std::string("EnableLogging"), enableLogging ? "true" : "false");
|
||||
}
|
||||
|
||||
long SetQueueAttributesRequest::getVisibilityTimeout() const {
|
||||
return visibilityTimeout_;
|
||||
}
|
||||
|
||||
void SetQueueAttributesRequest::setVisibilityTimeout(long visibilityTimeout) {
|
||||
visibilityTimeout_ = visibilityTimeout;
|
||||
setParameter(std::string("VisibilityTimeout"), std::to_string(visibilityTimeout));
|
||||
}
|
||||
|
||||
long SetQueueAttributesRequest::getDelaySeconds() const {
|
||||
return delaySeconds_;
|
||||
}
|
||||
|
||||
void SetQueueAttributesRequest::setDelaySeconds(long delaySeconds) {
|
||||
delaySeconds_ = delaySeconds;
|
||||
setParameter(std::string("DelaySeconds"), std::to_string(delaySeconds));
|
||||
}
|
||||
|
||||
long SetQueueAttributesRequest::getMaximumMessageSize() const {
|
||||
return maximumMessageSize_;
|
||||
}
|
||||
|
||||
void SetQueueAttributesRequest::setMaximumMessageSize(long maximumMessageSize) {
|
||||
maximumMessageSize_ = maximumMessageSize;
|
||||
setParameter(std::string("MaximumMessageSize"), std::to_string(maximumMessageSize));
|
||||
}
|
||||
|
||||
long SetQueueAttributesRequest::getPollingWaitSeconds() const {
|
||||
return pollingWaitSeconds_;
|
||||
}
|
||||
|
||||
void SetQueueAttributesRequest::setPollingWaitSeconds(long pollingWaitSeconds) {
|
||||
pollingWaitSeconds_ = pollingWaitSeconds;
|
||||
setParameter(std::string("PollingWaitSeconds"), std::to_string(pollingWaitSeconds));
|
||||
}
|
||||
|
||||
84
mns-open/src/model/SetQueueAttributesResult.cc
Normal file
84
mns-open/src/model/SetQueueAttributesResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/SetQueueAttributesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
SetQueueAttributesResult::SetQueueAttributesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SetQueueAttributesResult::SetQueueAttributesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SetQueueAttributesResult::~SetQueueAttributesResult()
|
||||
{}
|
||||
|
||||
void SetQueueAttributesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Code"].isNull())
|
||||
data_.code = std::stol(dataNode["Code"].asString());
|
||||
if(!dataNode["Message"].isNull())
|
||||
data_.message = dataNode["Message"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string SetQueueAttributesResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string SetQueueAttributesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
SetQueueAttributesResult::Data SetQueueAttributesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long SetQueueAttributesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SetQueueAttributesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
54
mns-open/src/model/SetSubscriptionAttributesRequest.cc
Normal file
54
mns-open/src/model/SetSubscriptionAttributesRequest.cc
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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/mns-open/model/SetSubscriptionAttributesRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::SetSubscriptionAttributesRequest;
|
||||
|
||||
SetSubscriptionAttributesRequest::SetSubscriptionAttributesRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "SetSubscriptionAttributes") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SetSubscriptionAttributesRequest::~SetSubscriptionAttributesRequest() {}
|
||||
|
||||
std::string SetSubscriptionAttributesRequest::getSubscriptionName() const {
|
||||
return subscriptionName_;
|
||||
}
|
||||
|
||||
void SetSubscriptionAttributesRequest::setSubscriptionName(const std::string &subscriptionName) {
|
||||
subscriptionName_ = subscriptionName;
|
||||
setParameter(std::string("SubscriptionName"), subscriptionName);
|
||||
}
|
||||
|
||||
std::string SetSubscriptionAttributesRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void SetSubscriptionAttributesRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
std::string SetSubscriptionAttributesRequest::getNotifyStrategy() const {
|
||||
return notifyStrategy_;
|
||||
}
|
||||
|
||||
void SetSubscriptionAttributesRequest::setNotifyStrategy(const std::string ¬ifyStrategy) {
|
||||
notifyStrategy_ = notifyStrategy;
|
||||
setParameter(std::string("NotifyStrategy"), notifyStrategy);
|
||||
}
|
||||
|
||||
84
mns-open/src/model/SetSubscriptionAttributesResult.cc
Normal file
84
mns-open/src/model/SetSubscriptionAttributesResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/SetSubscriptionAttributesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
SetSubscriptionAttributesResult::SetSubscriptionAttributesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SetSubscriptionAttributesResult::SetSubscriptionAttributesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SetSubscriptionAttributesResult::~SetSubscriptionAttributesResult()
|
||||
{}
|
||||
|
||||
void SetSubscriptionAttributesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Code"].isNull())
|
||||
data_.code = std::stol(dataNode["Code"].asString());
|
||||
if(!dataNode["Message"].isNull())
|
||||
data_.message = dataNode["Message"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string SetSubscriptionAttributesResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string SetSubscriptionAttributesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
SetSubscriptionAttributesResult::Data SetSubscriptionAttributesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long SetSubscriptionAttributesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SetSubscriptionAttributesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
54
mns-open/src/model/SetTopicAttributesRequest.cc
Normal file
54
mns-open/src/model/SetTopicAttributesRequest.cc
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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/mns-open/model/SetTopicAttributesRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::SetTopicAttributesRequest;
|
||||
|
||||
SetTopicAttributesRequest::SetTopicAttributesRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "SetTopicAttributes") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SetTopicAttributesRequest::~SetTopicAttributesRequest() {}
|
||||
|
||||
std::string SetTopicAttributesRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void SetTopicAttributesRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
long SetTopicAttributesRequest::getMaxMessageSize() const {
|
||||
return maxMessageSize_;
|
||||
}
|
||||
|
||||
void SetTopicAttributesRequest::setMaxMessageSize(long maxMessageSize) {
|
||||
maxMessageSize_ = maxMessageSize;
|
||||
setParameter(std::string("MaxMessageSize"), std::to_string(maxMessageSize));
|
||||
}
|
||||
|
||||
bool SetTopicAttributesRequest::getEnableLogging() const {
|
||||
return enableLogging_;
|
||||
}
|
||||
|
||||
void SetTopicAttributesRequest::setEnableLogging(bool enableLogging) {
|
||||
enableLogging_ = enableLogging;
|
||||
setParameter(std::string("EnableLogging"), enableLogging ? "true" : "false");
|
||||
}
|
||||
|
||||
84
mns-open/src/model/SetTopicAttributesResult.cc
Normal file
84
mns-open/src/model/SetTopicAttributesResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/SetTopicAttributesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
SetTopicAttributesResult::SetTopicAttributesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SetTopicAttributesResult::SetTopicAttributesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SetTopicAttributesResult::~SetTopicAttributesResult()
|
||||
{}
|
||||
|
||||
void SetTopicAttributesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Code"].isNull())
|
||||
data_.code = std::stol(dataNode["Code"].asString());
|
||||
if(!dataNode["Message"].isNull())
|
||||
data_.message = dataNode["Message"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string SetTopicAttributesResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string SetTopicAttributesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
SetTopicAttributesResult::Data SetTopicAttributesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long SetTopicAttributesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SetTopicAttributesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
90
mns-open/src/model/SubscribeRequest.cc
Normal file
90
mns-open/src/model/SubscribeRequest.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/SubscribeRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::SubscribeRequest;
|
||||
|
||||
SubscribeRequest::SubscribeRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "Subscribe") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SubscribeRequest::~SubscribeRequest() {}
|
||||
|
||||
std::string SubscribeRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void SubscribeRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
std::string SubscribeRequest::getMessageTag() const {
|
||||
return messageTag_;
|
||||
}
|
||||
|
||||
void SubscribeRequest::setMessageTag(const std::string &messageTag) {
|
||||
messageTag_ = messageTag;
|
||||
setParameter(std::string("MessageTag"), messageTag);
|
||||
}
|
||||
|
||||
std::string SubscribeRequest::getEndpoint() const {
|
||||
return endpoint_;
|
||||
}
|
||||
|
||||
void SubscribeRequest::setEndpoint(const std::string &endpoint) {
|
||||
endpoint_ = endpoint;
|
||||
setParameter(std::string("Endpoint"), endpoint);
|
||||
}
|
||||
|
||||
std::string SubscribeRequest::getSubscriptionName() const {
|
||||
return subscriptionName_;
|
||||
}
|
||||
|
||||
void SubscribeRequest::setSubscriptionName(const std::string &subscriptionName) {
|
||||
subscriptionName_ = subscriptionName;
|
||||
setParameter(std::string("SubscriptionName"), subscriptionName);
|
||||
}
|
||||
|
||||
std::string SubscribeRequest::getNotifyStrategy() const {
|
||||
return notifyStrategy_;
|
||||
}
|
||||
|
||||
void SubscribeRequest::setNotifyStrategy(const std::string ¬ifyStrategy) {
|
||||
notifyStrategy_ = notifyStrategy;
|
||||
setParameter(std::string("NotifyStrategy"), notifyStrategy);
|
||||
}
|
||||
|
||||
std::string SubscribeRequest::getNotifyContentFormat() const {
|
||||
return notifyContentFormat_;
|
||||
}
|
||||
|
||||
void SubscribeRequest::setNotifyContentFormat(const std::string ¬ifyContentFormat) {
|
||||
notifyContentFormat_ = notifyContentFormat;
|
||||
setParameter(std::string("NotifyContentFormat"), notifyContentFormat);
|
||||
}
|
||||
|
||||
std::string SubscribeRequest::getPushType() const {
|
||||
return pushType_;
|
||||
}
|
||||
|
||||
void SubscribeRequest::setPushType(const std::string &pushType) {
|
||||
pushType_ = pushType;
|
||||
setParameter(std::string("PushType"), pushType);
|
||||
}
|
||||
|
||||
79
mns-open/src/model/SubscribeResult.cc
Normal file
79
mns-open/src/model/SubscribeResult.cc
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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/mns-open/model/SubscribeResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
SubscribeResult::SubscribeResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SubscribeResult::SubscribeResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SubscribeResult::~SubscribeResult()
|
||||
{}
|
||||
|
||||
void SubscribeResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string SubscribeResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string SubscribeResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string SubscribeResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long SubscribeResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SubscribeResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
45
mns-open/src/model/UnsubscribeRequest.cc
Normal file
45
mns-open/src/model/UnsubscribeRequest.cc
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/UnsubscribeRequest.h>
|
||||
|
||||
using AlibabaCloud::Mns_open::Model::UnsubscribeRequest;
|
||||
|
||||
UnsubscribeRequest::UnsubscribeRequest()
|
||||
: RpcServiceRequest("mns-open", "2022-01-19", "Unsubscribe") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UnsubscribeRequest::~UnsubscribeRequest() {}
|
||||
|
||||
std::string UnsubscribeRequest::getSubscriptionName() const {
|
||||
return subscriptionName_;
|
||||
}
|
||||
|
||||
void UnsubscribeRequest::setSubscriptionName(const std::string &subscriptionName) {
|
||||
subscriptionName_ = subscriptionName;
|
||||
setParameter(std::string("SubscriptionName"), subscriptionName);
|
||||
}
|
||||
|
||||
std::string UnsubscribeRequest::getTopicName() const {
|
||||
return topicName_;
|
||||
}
|
||||
|
||||
void UnsubscribeRequest::setTopicName(const std::string &topicName) {
|
||||
topicName_ = topicName;
|
||||
setParameter(std::string("TopicName"), topicName);
|
||||
}
|
||||
|
||||
84
mns-open/src/model/UnsubscribeResult.cc
Normal file
84
mns-open/src/model/UnsubscribeResult.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/mns-open/model/UnsubscribeResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Mns_open;
|
||||
using namespace AlibabaCloud::Mns_open::Model;
|
||||
|
||||
UnsubscribeResult::UnsubscribeResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UnsubscribeResult::UnsubscribeResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UnsubscribeResult::~UnsubscribeResult()
|
||||
{}
|
||||
|
||||
void UnsubscribeResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Code"].isNull())
|
||||
data_.code = std::stol(dataNode["Code"].asString());
|
||||
if(!dataNode["Message"].isNull())
|
||||
data_.message = dataNode["Message"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stol(value["Code"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string UnsubscribeResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string UnsubscribeResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
UnsubscribeResult::Data UnsubscribeResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
long UnsubscribeResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool UnsubscribeResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user