amazonka-qldb-2.0: gen/Amazonka/QLDB/Types/ValueHolder.hs
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Amazonka.QLDB.Types.ValueHolder
-- Copyright : (c) 2013-2023 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QLDB.Types.ValueHolder where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
-- | A structure that can contain a value in multiple encoding formats.
--
-- /See:/ 'newValueHolder' smart constructor.
data ValueHolder = ValueHolder'
{ -- | An Amazon Ion plaintext value contained in a @ValueHolder@ structure.
ionText :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (Prelude.Eq, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'ValueHolder' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'ionText', 'valueHolder_ionText' - An Amazon Ion plaintext value contained in a @ValueHolder@ structure.
newValueHolder ::
ValueHolder
newValueHolder =
ValueHolder' {ionText = Prelude.Nothing}
-- | An Amazon Ion plaintext value contained in a @ValueHolder@ structure.
valueHolder_ionText :: Lens.Lens' ValueHolder (Prelude.Maybe Prelude.Text)
valueHolder_ionText = Lens.lens (\ValueHolder' {ionText} -> ionText) (\s@ValueHolder' {} a -> s {ionText = a} :: ValueHolder) Prelude.. Lens.mapping Data._Sensitive
instance Data.FromJSON ValueHolder where
parseJSON =
Data.withObject
"ValueHolder"
( \x ->
ValueHolder' Prelude.<$> (x Data..:? "IonText")
)
instance Prelude.Hashable ValueHolder where
hashWithSalt _salt ValueHolder' {..} =
_salt `Prelude.hashWithSalt` ionText
instance Prelude.NFData ValueHolder where
rnf ValueHolder' {..} = Prelude.rnf ionText
instance Data.ToJSON ValueHolder where
toJSON ValueHolder' {..} =
Data.object
( Prelude.catMaybes
[("IonText" Data..=) Prelude.<$> ionText]
)