feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,86 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sqs/model/SendMessageRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::SQS::Model;
using namespace Aws::Utils;
SendMessageRequest::SendMessageRequest() :
m_queueUrlHasBeenSet(false),
m_messageBodyHasBeenSet(false),
m_delaySeconds(0),
m_delaySecondsHasBeenSet(false),
m_messageAttributesHasBeenSet(false),
m_messageSystemAttributesHasBeenSet(false),
m_messageDeduplicationIdHasBeenSet(false),
m_messageGroupIdHasBeenSet(false)
{
}
Aws::String SendMessageRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=SendMessage&";
if(m_queueUrlHasBeenSet)
{
ss << "QueueUrl=" << StringUtils::URLEncode(m_queueUrl.c_str()) << "&";
}
if(m_messageBodyHasBeenSet)
{
ss << "MessageBody=" << StringUtils::URLEncode(m_messageBody.c_str()) << "&";
}
if(m_delaySecondsHasBeenSet)
{
ss << "DelaySeconds=" << m_delaySeconds << "&";
}
if(m_messageAttributesHasBeenSet)
{
unsigned messageAttributesCount = 1;
for(auto& item : m_messageAttributes)
{
ss << "MessageAttribute." << messageAttributesCount << ".Name="
<< StringUtils::URLEncode(item.first.c_str()) << "&";
item.second.OutputToStream(ss, "MessageAttribute.", messageAttributesCount, ".Value");
messageAttributesCount++;
}
}
if(m_messageSystemAttributesHasBeenSet)
{
unsigned messageSystemAttributesCount = 1;
for(auto& item : m_messageSystemAttributes)
{
ss << "MessageSystemAttribute." << messageSystemAttributesCount << ".Name="
<< StringUtils::URLEncode(MessageSystemAttributeNameForSendsMapper::GetNameForMessageSystemAttributeNameForSends(item.first).c_str()) << "&";
item.second.OutputToStream(ss, "MessageSystemAttribute.", messageSystemAttributesCount, ".Value");
messageSystemAttributesCount++;
}
}
if(m_messageDeduplicationIdHasBeenSet)
{
ss << "MessageDeduplicationId=" << StringUtils::URLEncode(m_messageDeduplicationId.c_str()) << "&";
}
if(m_messageGroupIdHasBeenSet)
{
ss << "MessageGroupId=" << StringUtils::URLEncode(m_messageGroupId.c_str()) << "&";
}
ss << "Version=2012-11-05";
return ss.str();
}
void SendMessageRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}