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,122 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/cognito-sync/model/IdentityUsage.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace CognitoSync
{
namespace Model
{
IdentityUsage::IdentityUsage() :
m_identityIdHasBeenSet(false),
m_identityPoolIdHasBeenSet(false),
m_lastModifiedDateHasBeenSet(false),
m_datasetCount(0),
m_datasetCountHasBeenSet(false),
m_dataStorage(0),
m_dataStorageHasBeenSet(false)
{
}
IdentityUsage::IdentityUsage(JsonView jsonValue) :
m_identityIdHasBeenSet(false),
m_identityPoolIdHasBeenSet(false),
m_lastModifiedDateHasBeenSet(false),
m_datasetCount(0),
m_datasetCountHasBeenSet(false),
m_dataStorage(0),
m_dataStorageHasBeenSet(false)
{
*this = jsonValue;
}
IdentityUsage& IdentityUsage::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("IdentityId"))
{
m_identityId = jsonValue.GetString("IdentityId");
m_identityIdHasBeenSet = true;
}
if(jsonValue.ValueExists("IdentityPoolId"))
{
m_identityPoolId = jsonValue.GetString("IdentityPoolId");
m_identityPoolIdHasBeenSet = true;
}
if(jsonValue.ValueExists("LastModifiedDate"))
{
m_lastModifiedDate = jsonValue.GetDouble("LastModifiedDate");
m_lastModifiedDateHasBeenSet = true;
}
if(jsonValue.ValueExists("DatasetCount"))
{
m_datasetCount = jsonValue.GetInteger("DatasetCount");
m_datasetCountHasBeenSet = true;
}
if(jsonValue.ValueExists("DataStorage"))
{
m_dataStorage = jsonValue.GetInt64("DataStorage");
m_dataStorageHasBeenSet = true;
}
return *this;
}
JsonValue IdentityUsage::Jsonize() const
{
JsonValue payload;
if(m_identityIdHasBeenSet)
{
payload.WithString("IdentityId", m_identityId);
}
if(m_identityPoolIdHasBeenSet)
{
payload.WithString("IdentityPoolId", m_identityPoolId);
}
if(m_lastModifiedDateHasBeenSet)
{
payload.WithDouble("LastModifiedDate", m_lastModifiedDate.SecondsWithMSPrecision());
}
if(m_datasetCountHasBeenSet)
{
payload.WithInteger("DatasetCount", m_datasetCount);
}
if(m_dataStorageHasBeenSet)
{
payload.WithInt64("DataStorage", m_dataStorage);
}
return payload;
}
} // namespace Model
} // namespace CognitoSync
} // namespace Aws