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,128 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/medialive/model/HlsWebdavSettings.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace MediaLive
{
namespace Model
{
HlsWebdavSettings::HlsWebdavSettings() :
m_connectionRetryInterval(0),
m_connectionRetryIntervalHasBeenSet(false),
m_filecacheDuration(0),
m_filecacheDurationHasBeenSet(false),
m_httpTransferMode(HlsWebdavHttpTransferMode::NOT_SET),
m_httpTransferModeHasBeenSet(false),
m_numRetries(0),
m_numRetriesHasBeenSet(false),
m_restartDelay(0),
m_restartDelayHasBeenSet(false)
{
}
HlsWebdavSettings::HlsWebdavSettings(JsonView jsonValue) :
m_connectionRetryInterval(0),
m_connectionRetryIntervalHasBeenSet(false),
m_filecacheDuration(0),
m_filecacheDurationHasBeenSet(false),
m_httpTransferMode(HlsWebdavHttpTransferMode::NOT_SET),
m_httpTransferModeHasBeenSet(false),
m_numRetries(0),
m_numRetriesHasBeenSet(false),
m_restartDelay(0),
m_restartDelayHasBeenSet(false)
{
*this = jsonValue;
}
HlsWebdavSettings& HlsWebdavSettings::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("connectionRetryInterval"))
{
m_connectionRetryInterval = jsonValue.GetInteger("connectionRetryInterval");
m_connectionRetryIntervalHasBeenSet = true;
}
if(jsonValue.ValueExists("filecacheDuration"))
{
m_filecacheDuration = jsonValue.GetInteger("filecacheDuration");
m_filecacheDurationHasBeenSet = true;
}
if(jsonValue.ValueExists("httpTransferMode"))
{
m_httpTransferMode = HlsWebdavHttpTransferModeMapper::GetHlsWebdavHttpTransferModeForName(jsonValue.GetString("httpTransferMode"));
m_httpTransferModeHasBeenSet = true;
}
if(jsonValue.ValueExists("numRetries"))
{
m_numRetries = jsonValue.GetInteger("numRetries");
m_numRetriesHasBeenSet = true;
}
if(jsonValue.ValueExists("restartDelay"))
{
m_restartDelay = jsonValue.GetInteger("restartDelay");
m_restartDelayHasBeenSet = true;
}
return *this;
}
JsonValue HlsWebdavSettings::Jsonize() const
{
JsonValue payload;
if(m_connectionRetryIntervalHasBeenSet)
{
payload.WithInteger("connectionRetryInterval", m_connectionRetryInterval);
}
if(m_filecacheDurationHasBeenSet)
{
payload.WithInteger("filecacheDuration", m_filecacheDuration);
}
if(m_httpTransferModeHasBeenSet)
{
payload.WithString("httpTransferMode", HlsWebdavHttpTransferModeMapper::GetNameForHlsWebdavHttpTransferMode(m_httpTransferMode));
}
if(m_numRetriesHasBeenSet)
{
payload.WithInteger("numRetries", m_numRetries);
}
if(m_restartDelayHasBeenSet)
{
payload.WithInteger("restartDelay", m_restartDelay);
}
return payload;
}
} // namespace Model
} // namespace MediaLive
} // namespace Aws