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,51 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/CloseTunnelRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CloseTunnelRequest::CloseTunnelRequest() :
m_tunnelIdHasBeenSet(false),
m_delete(false),
m_deleteHasBeenSet(false)
{
}
Aws::String CloseTunnelRequest::SerializePayload() const
{
JsonValue payload;
if(m_tunnelIdHasBeenSet)
{
payload.WithString("tunnelId", m_tunnelId);
}
if(m_deleteHasBeenSet)
{
payload.WithBool("delete", m_delete);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection CloseTunnelRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IoTSecuredTunneling.CloseTunnel"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/CloseTunnelResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
CloseTunnelResult::CloseTunnelResult()
{
}
CloseTunnelResult::CloseTunnelResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
CloseTunnelResult& CloseTunnelResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/ConnectionState.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
ConnectionState::ConnectionState() :
m_status(ConnectionStatus::NOT_SET),
m_statusHasBeenSet(false),
m_lastUpdatedAtHasBeenSet(false)
{
}
ConnectionState::ConnectionState(JsonView jsonValue) :
m_status(ConnectionStatus::NOT_SET),
m_statusHasBeenSet(false),
m_lastUpdatedAtHasBeenSet(false)
{
*this = jsonValue;
}
ConnectionState& ConnectionState::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("status"))
{
m_status = ConnectionStatusMapper::GetConnectionStatusForName(jsonValue.GetString("status"));
m_statusHasBeenSet = true;
}
if(jsonValue.ValueExists("lastUpdatedAt"))
{
m_lastUpdatedAt = jsonValue.GetDouble("lastUpdatedAt");
m_lastUpdatedAtHasBeenSet = true;
}
return *this;
}
JsonValue ConnectionState::Jsonize() const
{
JsonValue payload;
if(m_statusHasBeenSet)
{
payload.WithString("status", ConnectionStatusMapper::GetNameForConnectionStatus(m_status));
}
if(m_lastUpdatedAtHasBeenSet)
{
payload.WithDouble("lastUpdatedAt", m_lastUpdatedAt.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/ConnectionStatus.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
namespace ConnectionStatusMapper
{
static const int CONNECTED_HASH = HashingUtils::HashString("CONNECTED");
static const int DISCONNECTED_HASH = HashingUtils::HashString("DISCONNECTED");
ConnectionStatus GetConnectionStatusForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == CONNECTED_HASH)
{
return ConnectionStatus::CONNECTED;
}
else if (hashCode == DISCONNECTED_HASH)
{
return ConnectionStatus::DISCONNECTED;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ConnectionStatus>(hashCode);
}
return ConnectionStatus::NOT_SET;
}
Aws::String GetNameForConnectionStatus(ConnectionStatus enumValue)
{
switch(enumValue)
{
case ConnectionStatus::CONNECTED:
return "CONNECTED";
case ConnectionStatus::DISCONNECTED:
return "DISCONNECTED";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ConnectionStatusMapper
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/DescribeTunnelRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeTunnelRequest::DescribeTunnelRequest() :
m_tunnelIdHasBeenSet(false)
{
}
Aws::String DescribeTunnelRequest::SerializePayload() const
{
JsonValue payload;
if(m_tunnelIdHasBeenSet)
{
payload.WithString("tunnelId", m_tunnelId);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DescribeTunnelRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IoTSecuredTunneling.DescribeTunnel"));
return headers;
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/DescribeTunnelResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeTunnelResult::DescribeTunnelResult()
{
}
DescribeTunnelResult::DescribeTunnelResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeTunnelResult& DescribeTunnelResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("tunnel"))
{
m_tunnel = jsonValue.GetObject("tunnel");
}
return *this;
}

View File

@@ -0,0 +1,82 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/DestinationConfig.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
DestinationConfig::DestinationConfig() :
m_thingNameHasBeenSet(false),
m_servicesHasBeenSet(false)
{
}
DestinationConfig::DestinationConfig(JsonView jsonValue) :
m_thingNameHasBeenSet(false),
m_servicesHasBeenSet(false)
{
*this = jsonValue;
}
DestinationConfig& DestinationConfig::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("thingName"))
{
m_thingName = jsonValue.GetString("thingName");
m_thingNameHasBeenSet = true;
}
if(jsonValue.ValueExists("services"))
{
Array<JsonView> servicesJsonList = jsonValue.GetArray("services");
for(unsigned servicesIndex = 0; servicesIndex < servicesJsonList.GetLength(); ++servicesIndex)
{
m_services.push_back(servicesJsonList[servicesIndex].AsString());
}
m_servicesHasBeenSet = true;
}
return *this;
}
JsonValue DestinationConfig::Jsonize() const
{
JsonValue payload;
if(m_thingNameHasBeenSet)
{
payload.WithString("thingName", m_thingName);
}
if(m_servicesHasBeenSet)
{
Array<JsonValue> servicesJsonList(m_services.size());
for(unsigned servicesIndex = 0; servicesIndex < servicesJsonList.GetLength(); ++servicesIndex)
{
servicesJsonList[servicesIndex].AsString(m_services[servicesIndex]);
}
payload.WithArray("services", std::move(servicesJsonList));
}
return payload;
}
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/ListTagsForResourceRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
ListTagsForResourceRequest::ListTagsForResourceRequest() :
m_resourceArnHasBeenSet(false)
{
}
Aws::String ListTagsForResourceRequest::SerializePayload() const
{
JsonValue payload;
if(m_resourceArnHasBeenSet)
{
payload.WithString("resourceArn", m_resourceArn);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection ListTagsForResourceRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IoTSecuredTunneling.ListTagsForResource"));
return headers;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/ListTagsForResourceResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListTagsForResourceResult::ListTagsForResourceResult()
{
}
ListTagsForResourceResult::ListTagsForResourceResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListTagsForResourceResult& ListTagsForResourceResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("tags"))
{
Array<JsonView> tagsJsonList = jsonValue.GetArray("tags");
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
m_tags.push_back(tagsJsonList[tagsIndex].AsObject());
}
}
return *this;
}

View File

@@ -0,0 +1,58 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/ListTunnelsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
ListTunnelsRequest::ListTunnelsRequest() :
m_thingNameHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false),
m_nextTokenHasBeenSet(false)
{
}
Aws::String ListTunnelsRequest::SerializePayload() const
{
JsonValue payload;
if(m_thingNameHasBeenSet)
{
payload.WithString("thingName", m_thingName);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("maxResults", m_maxResults);
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("nextToken", m_nextToken);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection ListTunnelsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IoTSecuredTunneling.ListTunnels"));
return headers;
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/ListTunnelsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListTunnelsResult::ListTunnelsResult()
{
}
ListTunnelsResult::ListTunnelsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListTunnelsResult& ListTunnelsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("tunnelSummaries"))
{
Array<JsonView> tunnelSummariesJsonList = jsonValue.GetArray("tunnelSummaries");
for(unsigned tunnelSummariesIndex = 0; tunnelSummariesIndex < tunnelSummariesJsonList.GetLength(); ++tunnelSummariesIndex)
{
m_tunnelSummaries.push_back(tunnelSummariesJsonList[tunnelSummariesIndex].AsObject());
}
}
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
return *this;
}

View File

@@ -0,0 +1,69 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/OpenTunnelRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
OpenTunnelRequest::OpenTunnelRequest() :
m_descriptionHasBeenSet(false),
m_tagsHasBeenSet(false),
m_destinationConfigHasBeenSet(false),
m_timeoutConfigHasBeenSet(false)
{
}
Aws::String OpenTunnelRequest::SerializePayload() const
{
JsonValue payload;
if(m_descriptionHasBeenSet)
{
payload.WithString("description", m_description);
}
if(m_tagsHasBeenSet)
{
Array<JsonValue> tagsJsonList(m_tags.size());
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
}
payload.WithArray("tags", std::move(tagsJsonList));
}
if(m_destinationConfigHasBeenSet)
{
payload.WithObject("destinationConfig", m_destinationConfig.Jsonize());
}
if(m_timeoutConfigHasBeenSet)
{
payload.WithObject("timeoutConfig", m_timeoutConfig.Jsonize());
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection OpenTunnelRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IoTSecuredTunneling.OpenTunnel"));
return headers;
}

View File

@@ -0,0 +1,58 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/OpenTunnelResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
OpenTunnelResult::OpenTunnelResult()
{
}
OpenTunnelResult::OpenTunnelResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
OpenTunnelResult& OpenTunnelResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("tunnelId"))
{
m_tunnelId = jsonValue.GetString("tunnelId");
}
if(jsonValue.ValueExists("tunnelArn"))
{
m_tunnelArn = jsonValue.GetString("tunnelArn");
}
if(jsonValue.ValueExists("sourceAccessToken"))
{
m_sourceAccessToken = jsonValue.GetString("sourceAccessToken");
}
if(jsonValue.ValueExists("destinationAccessToken"))
{
m_destinationAccessToken = jsonValue.GetString("destinationAccessToken");
}
return *this;
}

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/Tag.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
Tag::Tag() :
m_keyHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
Tag::Tag(JsonView jsonValue) :
m_keyHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
Tag& Tag::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("key"))
{
m_key = jsonValue.GetString("key");
m_keyHasBeenSet = true;
}
if(jsonValue.ValueExists("value"))
{
m_value = jsonValue.GetString("value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue Tag::Jsonize() const
{
JsonValue payload;
if(m_keyHasBeenSet)
{
payload.WithString("key", m_key);
}
if(m_valueHasBeenSet)
{
payload.WithString("value", m_value);
}
return payload;
}
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,55 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/TagResourceRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
TagResourceRequest::TagResourceRequest() :
m_resourceArnHasBeenSet(false),
m_tagsHasBeenSet(false)
{
}
Aws::String TagResourceRequest::SerializePayload() const
{
JsonValue payload;
if(m_resourceArnHasBeenSet)
{
payload.WithString("resourceArn", m_resourceArn);
}
if(m_tagsHasBeenSet)
{
Array<JsonValue> tagsJsonList(m_tags.size());
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
}
payload.WithArray("tags", std::move(tagsJsonList));
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection TagResourceRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IoTSecuredTunneling.TagResource"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/TagResourceResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
TagResourceResult::TagResourceResult()
{
}
TagResourceResult::TagResourceResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
TagResourceResult& TagResourceResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,61 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/TimeoutConfig.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
TimeoutConfig::TimeoutConfig() :
m_maxLifetimeTimeoutMinutes(0),
m_maxLifetimeTimeoutMinutesHasBeenSet(false)
{
}
TimeoutConfig::TimeoutConfig(JsonView jsonValue) :
m_maxLifetimeTimeoutMinutes(0),
m_maxLifetimeTimeoutMinutesHasBeenSet(false)
{
*this = jsonValue;
}
TimeoutConfig& TimeoutConfig::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("maxLifetimeTimeoutMinutes"))
{
m_maxLifetimeTimeoutMinutes = jsonValue.GetInteger("maxLifetimeTimeoutMinutes");
m_maxLifetimeTimeoutMinutesHasBeenSet = true;
}
return *this;
}
JsonValue TimeoutConfig::Jsonize() const
{
JsonValue payload;
if(m_maxLifetimeTimeoutMinutesHasBeenSet)
{
payload.WithInteger("maxLifetimeTimeoutMinutes", m_maxLifetimeTimeoutMinutes);
}
return payload;
}
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,216 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/Tunnel.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
Tunnel::Tunnel() :
m_tunnelIdHasBeenSet(false),
m_tunnelArnHasBeenSet(false),
m_status(TunnelStatus::NOT_SET),
m_statusHasBeenSet(false),
m_sourceConnectionStateHasBeenSet(false),
m_destinationConnectionStateHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_destinationConfigHasBeenSet(false),
m_timeoutConfigHasBeenSet(false),
m_tagsHasBeenSet(false),
m_createdAtHasBeenSet(false),
m_lastUpdatedAtHasBeenSet(false)
{
}
Tunnel::Tunnel(JsonView jsonValue) :
m_tunnelIdHasBeenSet(false),
m_tunnelArnHasBeenSet(false),
m_status(TunnelStatus::NOT_SET),
m_statusHasBeenSet(false),
m_sourceConnectionStateHasBeenSet(false),
m_destinationConnectionStateHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_destinationConfigHasBeenSet(false),
m_timeoutConfigHasBeenSet(false),
m_tagsHasBeenSet(false),
m_createdAtHasBeenSet(false),
m_lastUpdatedAtHasBeenSet(false)
{
*this = jsonValue;
}
Tunnel& Tunnel::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("tunnelId"))
{
m_tunnelId = jsonValue.GetString("tunnelId");
m_tunnelIdHasBeenSet = true;
}
if(jsonValue.ValueExists("tunnelArn"))
{
m_tunnelArn = jsonValue.GetString("tunnelArn");
m_tunnelArnHasBeenSet = true;
}
if(jsonValue.ValueExists("status"))
{
m_status = TunnelStatusMapper::GetTunnelStatusForName(jsonValue.GetString("status"));
m_statusHasBeenSet = true;
}
if(jsonValue.ValueExists("sourceConnectionState"))
{
m_sourceConnectionState = jsonValue.GetObject("sourceConnectionState");
m_sourceConnectionStateHasBeenSet = true;
}
if(jsonValue.ValueExists("destinationConnectionState"))
{
m_destinationConnectionState = jsonValue.GetObject("destinationConnectionState");
m_destinationConnectionStateHasBeenSet = true;
}
if(jsonValue.ValueExists("description"))
{
m_description = jsonValue.GetString("description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("destinationConfig"))
{
m_destinationConfig = jsonValue.GetObject("destinationConfig");
m_destinationConfigHasBeenSet = true;
}
if(jsonValue.ValueExists("timeoutConfig"))
{
m_timeoutConfig = jsonValue.GetObject("timeoutConfig");
m_timeoutConfigHasBeenSet = true;
}
if(jsonValue.ValueExists("tags"))
{
Array<JsonView> tagsJsonList = jsonValue.GetArray("tags");
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
m_tags.push_back(tagsJsonList[tagsIndex].AsObject());
}
m_tagsHasBeenSet = true;
}
if(jsonValue.ValueExists("createdAt"))
{
m_createdAt = jsonValue.GetDouble("createdAt");
m_createdAtHasBeenSet = true;
}
if(jsonValue.ValueExists("lastUpdatedAt"))
{
m_lastUpdatedAt = jsonValue.GetDouble("lastUpdatedAt");
m_lastUpdatedAtHasBeenSet = true;
}
return *this;
}
JsonValue Tunnel::Jsonize() const
{
JsonValue payload;
if(m_tunnelIdHasBeenSet)
{
payload.WithString("tunnelId", m_tunnelId);
}
if(m_tunnelArnHasBeenSet)
{
payload.WithString("tunnelArn", m_tunnelArn);
}
if(m_statusHasBeenSet)
{
payload.WithString("status", TunnelStatusMapper::GetNameForTunnelStatus(m_status));
}
if(m_sourceConnectionStateHasBeenSet)
{
payload.WithObject("sourceConnectionState", m_sourceConnectionState.Jsonize());
}
if(m_destinationConnectionStateHasBeenSet)
{
payload.WithObject("destinationConnectionState", m_destinationConnectionState.Jsonize());
}
if(m_descriptionHasBeenSet)
{
payload.WithString("description", m_description);
}
if(m_destinationConfigHasBeenSet)
{
payload.WithObject("destinationConfig", m_destinationConfig.Jsonize());
}
if(m_timeoutConfigHasBeenSet)
{
payload.WithObject("timeoutConfig", m_timeoutConfig.Jsonize());
}
if(m_tagsHasBeenSet)
{
Array<JsonValue> tagsJsonList(m_tags.size());
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
}
payload.WithArray("tags", std::move(tagsJsonList));
}
if(m_createdAtHasBeenSet)
{
payload.WithDouble("createdAt", m_createdAt.SecondsWithMSPrecision());
}
if(m_lastUpdatedAtHasBeenSet)
{
payload.WithDouble("lastUpdatedAt", m_lastUpdatedAt.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/TunnelStatus.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
namespace TunnelStatusMapper
{
static const int OPEN_HASH = HashingUtils::HashString("OPEN");
static const int CLOSED_HASH = HashingUtils::HashString("CLOSED");
TunnelStatus GetTunnelStatusForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == OPEN_HASH)
{
return TunnelStatus::OPEN;
}
else if (hashCode == CLOSED_HASH)
{
return TunnelStatus::CLOSED;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<TunnelStatus>(hashCode);
}
return TunnelStatus::NOT_SET;
}
Aws::String GetNameForTunnelStatus(TunnelStatus enumValue)
{
switch(enumValue)
{
case TunnelStatus::OPEN:
return "OPEN";
case TunnelStatus::CLOSED:
return "CLOSED";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace TunnelStatusMapper
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,133 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/TunnelSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTSecureTunneling
{
namespace Model
{
TunnelSummary::TunnelSummary() :
m_tunnelIdHasBeenSet(false),
m_tunnelArnHasBeenSet(false),
m_status(TunnelStatus::NOT_SET),
m_statusHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_createdAtHasBeenSet(false),
m_lastUpdatedAtHasBeenSet(false)
{
}
TunnelSummary::TunnelSummary(JsonView jsonValue) :
m_tunnelIdHasBeenSet(false),
m_tunnelArnHasBeenSet(false),
m_status(TunnelStatus::NOT_SET),
m_statusHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_createdAtHasBeenSet(false),
m_lastUpdatedAtHasBeenSet(false)
{
*this = jsonValue;
}
TunnelSummary& TunnelSummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("tunnelId"))
{
m_tunnelId = jsonValue.GetString("tunnelId");
m_tunnelIdHasBeenSet = true;
}
if(jsonValue.ValueExists("tunnelArn"))
{
m_tunnelArn = jsonValue.GetString("tunnelArn");
m_tunnelArnHasBeenSet = true;
}
if(jsonValue.ValueExists("status"))
{
m_status = TunnelStatusMapper::GetTunnelStatusForName(jsonValue.GetString("status"));
m_statusHasBeenSet = true;
}
if(jsonValue.ValueExists("description"))
{
m_description = jsonValue.GetString("description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("createdAt"))
{
m_createdAt = jsonValue.GetDouble("createdAt");
m_createdAtHasBeenSet = true;
}
if(jsonValue.ValueExists("lastUpdatedAt"))
{
m_lastUpdatedAt = jsonValue.GetDouble("lastUpdatedAt");
m_lastUpdatedAtHasBeenSet = true;
}
return *this;
}
JsonValue TunnelSummary::Jsonize() const
{
JsonValue payload;
if(m_tunnelIdHasBeenSet)
{
payload.WithString("tunnelId", m_tunnelId);
}
if(m_tunnelArnHasBeenSet)
{
payload.WithString("tunnelArn", m_tunnelArn);
}
if(m_statusHasBeenSet)
{
payload.WithString("status", TunnelStatusMapper::GetNameForTunnelStatus(m_status));
}
if(m_descriptionHasBeenSet)
{
payload.WithString("description", m_description);
}
if(m_createdAtHasBeenSet)
{
payload.WithDouble("createdAt", m_createdAt.SecondsWithMSPrecision());
}
if(m_lastUpdatedAtHasBeenSet)
{
payload.WithDouble("lastUpdatedAt", m_lastUpdatedAt.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace IoTSecureTunneling
} // namespace Aws

View File

@@ -0,0 +1,55 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/UntagResourceRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
UntagResourceRequest::UntagResourceRequest() :
m_resourceArnHasBeenSet(false),
m_tagKeysHasBeenSet(false)
{
}
Aws::String UntagResourceRequest::SerializePayload() const
{
JsonValue payload;
if(m_resourceArnHasBeenSet)
{
payload.WithString("resourceArn", m_resourceArn);
}
if(m_tagKeysHasBeenSet)
{
Array<JsonValue> tagKeysJsonList(m_tagKeys.size());
for(unsigned tagKeysIndex = 0; tagKeysIndex < tagKeysJsonList.GetLength(); ++tagKeysIndex)
{
tagKeysJsonList[tagKeysIndex].AsString(m_tagKeys[tagKeysIndex]);
}
payload.WithArray("tagKeys", std::move(tagKeysJsonList));
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection UntagResourceRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IoTSecuredTunneling.UntagResource"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotsecuretunneling/model/UntagResourceResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::IoTSecureTunneling::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
UntagResourceResult::UntagResourceResult()
{
}
UntagResourceResult::UntagResourceResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
UntagResourceResult& UntagResourceResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}