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,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/honeycode/model/ColumnMetadata.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Honeycode
{
namespace Model
{
ColumnMetadata::ColumnMetadata() :
m_nameHasBeenSet(false),
m_format(Format::NOT_SET),
m_formatHasBeenSet(false)
{
}
ColumnMetadata::ColumnMetadata(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_format(Format::NOT_SET),
m_formatHasBeenSet(false)
{
*this = jsonValue;
}
ColumnMetadata& ColumnMetadata::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = jsonValue.GetString("name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("format"))
{
m_format = FormatMapper::GetFormatForName(jsonValue.GetString("format"));
m_formatHasBeenSet = true;
}
return *this;
}
JsonValue ColumnMetadata::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_formatHasBeenSet)
{
payload.WithString("format", FormatMapper::GetNameForFormat(m_format));
}
return payload;
}
} // namespace Model
} // namespace Honeycode
} // namespace Aws

View File

@@ -0,0 +1,90 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/honeycode/model/DataItem.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Honeycode
{
namespace Model
{
DataItem::DataItem() :
m_overrideFormat(Format::NOT_SET),
m_overrideFormatHasBeenSet(false),
m_rawValueHasBeenSet(false),
m_formattedValueHasBeenSet(false)
{
}
DataItem::DataItem(JsonView jsonValue) :
m_overrideFormat(Format::NOT_SET),
m_overrideFormatHasBeenSet(false),
m_rawValueHasBeenSet(false),
m_formattedValueHasBeenSet(false)
{
*this = jsonValue;
}
DataItem& DataItem::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("overrideFormat"))
{
m_overrideFormat = FormatMapper::GetFormatForName(jsonValue.GetString("overrideFormat"));
m_overrideFormatHasBeenSet = true;
}
if(jsonValue.ValueExists("rawValue"))
{
m_rawValue = jsonValue.GetString("rawValue");
m_rawValueHasBeenSet = true;
}
if(jsonValue.ValueExists("formattedValue"))
{
m_formattedValue = jsonValue.GetString("formattedValue");
m_formattedValueHasBeenSet = true;
}
return *this;
}
JsonValue DataItem::Jsonize() const
{
JsonValue payload;
if(m_overrideFormatHasBeenSet)
{
payload.WithString("overrideFormat", FormatMapper::GetNameForFormat(m_overrideFormat));
}
if(m_rawValueHasBeenSet)
{
payload.WithString("rawValue", m_rawValue);
}
if(m_formattedValueHasBeenSet)
{
payload.WithString("formattedValue", m_formattedValue);
}
return payload;
}
} // namespace Model
} // namespace Honeycode
} // 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/honeycode/model/Format.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 Honeycode
{
namespace Model
{
namespace FormatMapper
{
static const int AUTO_HASH = HashingUtils::HashString("AUTO");
static const int NUMBER_HASH = HashingUtils::HashString("NUMBER");
static const int CURRENCY_HASH = HashingUtils::HashString("CURRENCY");
static const int DATE_HASH = HashingUtils::HashString("DATE");
static const int TIME_HASH = HashingUtils::HashString("TIME");
static const int DATE_TIME_HASH = HashingUtils::HashString("DATE_TIME");
static const int PERCENTAGE_HASH = HashingUtils::HashString("PERCENTAGE");
static const int TEXT_HASH = HashingUtils::HashString("TEXT");
static const int ACCOUNTING_HASH = HashingUtils::HashString("ACCOUNTING");
static const int CONTACT_HASH = HashingUtils::HashString("CONTACT");
static const int ROWLINK_HASH = HashingUtils::HashString("ROWLINK");
Format GetFormatForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == AUTO_HASH)
{
return Format::AUTO;
}
else if (hashCode == NUMBER_HASH)
{
return Format::NUMBER;
}
else if (hashCode == CURRENCY_HASH)
{
return Format::CURRENCY;
}
else if (hashCode == DATE_HASH)
{
return Format::DATE;
}
else if (hashCode == TIME_HASH)
{
return Format::TIME;
}
else if (hashCode == DATE_TIME_HASH)
{
return Format::DATE_TIME;
}
else if (hashCode == PERCENTAGE_HASH)
{
return Format::PERCENTAGE;
}
else if (hashCode == TEXT_HASH)
{
return Format::TEXT;
}
else if (hashCode == ACCOUNTING_HASH)
{
return Format::ACCOUNTING;
}
else if (hashCode == CONTACT_HASH)
{
return Format::CONTACT;
}
else if (hashCode == ROWLINK_HASH)
{
return Format::ROWLINK;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<Format>(hashCode);
}
return Format::NOT_SET;
}
Aws::String GetNameForFormat(Format enumValue)
{
switch(enumValue)
{
case Format::AUTO:
return "AUTO";
case Format::NUMBER:
return "NUMBER";
case Format::CURRENCY:
return "CURRENCY";
case Format::DATE:
return "DATE";
case Format::TIME:
return "TIME";
case Format::DATE_TIME:
return "DATE_TIME";
case Format::PERCENTAGE:
return "PERCENTAGE";
case Format::TEXT:
return "TEXT";
case Format::ACCOUNTING:
return "ACCOUNTING";
case Format::CONTACT:
return "CONTACT";
case Format::ROWLINK:
return "ROWLINK";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace FormatMapper
} // namespace Model
} // namespace Honeycode
} // namespace Aws

View File

@@ -0,0 +1,76 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/honeycode/model/GetScreenDataRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Honeycode::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
GetScreenDataRequest::GetScreenDataRequest() :
m_workbookIdHasBeenSet(false),
m_appIdHasBeenSet(false),
m_screenIdHasBeenSet(false),
m_variablesHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false),
m_nextTokenHasBeenSet(false)
{
}
Aws::String GetScreenDataRequest::SerializePayload() const
{
JsonValue payload;
if(m_workbookIdHasBeenSet)
{
payload.WithString("workbookId", m_workbookId);
}
if(m_appIdHasBeenSet)
{
payload.WithString("appId", m_appId);
}
if(m_screenIdHasBeenSet)
{
payload.WithString("screenId", m_screenId);
}
if(m_variablesHasBeenSet)
{
JsonValue variablesJsonMap;
for(auto& variablesItem : m_variables)
{
variablesJsonMap.WithObject(variablesItem.first, variablesItem.second.Jsonize());
}
payload.WithObject("variables", std::move(variablesJsonMap));
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("maxResults", m_maxResults);
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("nextToken", m_nextToken);
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,57 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/honeycode/model/GetScreenDataResult.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::Honeycode::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
GetScreenDataResult::GetScreenDataResult() :
m_workbookCursor(0)
{
}
GetScreenDataResult::GetScreenDataResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_workbookCursor(0)
{
*this = result;
}
GetScreenDataResult& GetScreenDataResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("results"))
{
Aws::Map<Aws::String, JsonView> resultsJsonMap = jsonValue.GetObject("results").GetAllObjects();
for(auto& resultsItem : resultsJsonMap)
{
m_results[resultsItem.first] = resultsItem.second.AsObject();
}
}
if(jsonValue.ValueExists("workbookCursor"))
{
m_workbookCursor = jsonValue.GetInt64("workbookCursor");
}
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
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/honeycode/model/InvokeScreenAutomationRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Honeycode::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
InvokeScreenAutomationRequest::InvokeScreenAutomationRequest() :
m_workbookIdHasBeenSet(false),
m_appIdHasBeenSet(false),
m_screenIdHasBeenSet(false),
m_screenAutomationIdHasBeenSet(false),
m_variablesHasBeenSet(false),
m_rowIdHasBeenSet(false),
m_clientRequestTokenHasBeenSet(false)
{
}
Aws::String InvokeScreenAutomationRequest::SerializePayload() const
{
JsonValue payload;
if(m_variablesHasBeenSet)
{
JsonValue variablesJsonMap;
for(auto& variablesItem : m_variables)
{
variablesJsonMap.WithObject(variablesItem.first, variablesItem.second.Jsonize());
}
payload.WithObject("variables", std::move(variablesJsonMap));
}
if(m_rowIdHasBeenSet)
{
payload.WithString("rowId", m_rowId);
}
if(m_clientRequestTokenHasBeenSet)
{
payload.WithString("clientRequestToken", m_clientRequestToken);
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/honeycode/model/InvokeScreenAutomationResult.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::Honeycode::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
InvokeScreenAutomationResult::InvokeScreenAutomationResult() :
m_workbookCursor(0)
{
}
InvokeScreenAutomationResult::InvokeScreenAutomationResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_workbookCursor(0)
{
*this = result;
}
InvokeScreenAutomationResult& InvokeScreenAutomationResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("workbookCursor"))
{
m_workbookCursor = jsonValue.GetInt64("workbookCursor");
}
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/honeycode/model/ResultRow.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Honeycode
{
namespace Model
{
ResultRow::ResultRow() :
m_rowIdHasBeenSet(false),
m_dataItemsHasBeenSet(false)
{
}
ResultRow::ResultRow(JsonView jsonValue) :
m_rowIdHasBeenSet(false),
m_dataItemsHasBeenSet(false)
{
*this = jsonValue;
}
ResultRow& ResultRow::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("rowId"))
{
m_rowId = jsonValue.GetString("rowId");
m_rowIdHasBeenSet = true;
}
if(jsonValue.ValueExists("dataItems"))
{
Array<JsonView> dataItemsJsonList = jsonValue.GetArray("dataItems");
for(unsigned dataItemsIndex = 0; dataItemsIndex < dataItemsJsonList.GetLength(); ++dataItemsIndex)
{
m_dataItems.push_back(dataItemsJsonList[dataItemsIndex].AsObject());
}
m_dataItemsHasBeenSet = true;
}
return *this;
}
JsonValue ResultRow::Jsonize() const
{
JsonValue payload;
if(m_rowIdHasBeenSet)
{
payload.WithString("rowId", m_rowId);
}
if(m_dataItemsHasBeenSet)
{
Array<JsonValue> dataItemsJsonList(m_dataItems.size());
for(unsigned dataItemsIndex = 0; dataItemsIndex < dataItemsJsonList.GetLength(); ++dataItemsIndex)
{
dataItemsJsonList[dataItemsIndex].AsObject(m_dataItems[dataItemsIndex].Jsonize());
}
payload.WithArray("dataItems", std::move(dataItemsJsonList));
}
return payload;
}
} // namespace Model
} // namespace Honeycode
} // namespace Aws

View File

@@ -0,0 +1,90 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/honeycode/model/ResultSet.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Honeycode
{
namespace Model
{
ResultSet::ResultSet() :
m_headersHasBeenSet(false),
m_rowsHasBeenSet(false)
{
}
ResultSet::ResultSet(JsonView jsonValue) :
m_headersHasBeenSet(false),
m_rowsHasBeenSet(false)
{
*this = jsonValue;
}
ResultSet& ResultSet::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("headers"))
{
Array<JsonView> headersJsonList = jsonValue.GetArray("headers");
for(unsigned headersIndex = 0; headersIndex < headersJsonList.GetLength(); ++headersIndex)
{
m_headers.push_back(headersJsonList[headersIndex].AsObject());
}
m_headersHasBeenSet = true;
}
if(jsonValue.ValueExists("rows"))
{
Array<JsonView> rowsJsonList = jsonValue.GetArray("rows");
for(unsigned rowsIndex = 0; rowsIndex < rowsJsonList.GetLength(); ++rowsIndex)
{
m_rows.push_back(rowsJsonList[rowsIndex].AsObject());
}
m_rowsHasBeenSet = true;
}
return *this;
}
JsonValue ResultSet::Jsonize() const
{
JsonValue payload;
if(m_headersHasBeenSet)
{
Array<JsonValue> headersJsonList(m_headers.size());
for(unsigned headersIndex = 0; headersIndex < headersJsonList.GetLength(); ++headersIndex)
{
headersJsonList[headersIndex].AsObject(m_headers[headersIndex].Jsonize());
}
payload.WithArray("headers", std::move(headersJsonList));
}
if(m_rowsHasBeenSet)
{
Array<JsonValue> rowsJsonList(m_rows.size());
for(unsigned rowsIndex = 0; rowsIndex < rowsJsonList.GetLength(); ++rowsIndex)
{
rowsJsonList[rowsIndex].AsObject(m_rows[rowsIndex].Jsonize());
}
payload.WithArray("rows", std::move(rowsJsonList));
}
return payload;
}
} // namespace Model
} // namespace Honeycode
} // namespace Aws

View File

@@ -0,0 +1,59 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/honeycode/model/VariableValue.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Honeycode
{
namespace Model
{
VariableValue::VariableValue() :
m_rawValueHasBeenSet(false)
{
}
VariableValue::VariableValue(JsonView jsonValue) :
m_rawValueHasBeenSet(false)
{
*this = jsonValue;
}
VariableValue& VariableValue::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("rawValue"))
{
m_rawValue = jsonValue.GetString("rawValue");
m_rawValueHasBeenSet = true;
}
return *this;
}
JsonValue VariableValue::Jsonize() const
{
JsonValue payload;
if(m_rawValueHasBeenSet)
{
payload.WithString("rawValue", m_rawValue);
}
return payload;
}
} // namespace Model
} // namespace Honeycode
} // namespace Aws