This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-textract/source/model/Document.cpp

74 lines
1.3 KiB
C++
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/textract/model/Document.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/HashingUtils.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Textract
{
namespace Model
{
Document::Document() :
m_bytesHasBeenSet(false),
m_s3ObjectHasBeenSet(false)
{
}
Document::Document(JsonView jsonValue) :
m_bytesHasBeenSet(false),
m_s3ObjectHasBeenSet(false)
{
*this = jsonValue;
}
Document& Document::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Bytes"))
{
m_bytes = HashingUtils::Base64Decode(jsonValue.GetString("Bytes"));
m_bytesHasBeenSet = true;
}
if(jsonValue.ValueExists("S3Object"))
{
m_s3Object = jsonValue.GetObject("S3Object");
m_s3ObjectHasBeenSet = true;
}
return *this;
}
JsonValue Document::Jsonize() const
{
JsonValue payload;
if(m_bytesHasBeenSet)
{
payload.WithString("Bytes", HashingUtils::Base64Encode(m_bytes));
}
if(m_s3ObjectHasBeenSet)
{
payload.WithObject("S3Object", m_s3Object.Jsonize());
}
return payload;
}
} // namespace Model
} // namespace Textract
} // namespace Aws