{-# 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.AmplifyUiBuilder.Types.PutMetadataFlagBody
-- 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.AmplifyUiBuilder.Types.PutMetadataFlagBody 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

-- | Stores the metadata information about a feature on a form or view.
--
-- /See:/ 'newPutMetadataFlagBody' smart constructor.
data PutMetadataFlagBody = PutMetadataFlagBody'
  { -- | The new information to store.
    PutMetadataFlagBody -> Text
newValue' :: Prelude.Text
  }
  deriving (PutMetadataFlagBody -> PutMetadataFlagBody -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutMetadataFlagBody -> PutMetadataFlagBody -> Bool
$c/= :: PutMetadataFlagBody -> PutMetadataFlagBody -> Bool
== :: PutMetadataFlagBody -> PutMetadataFlagBody -> Bool
$c== :: PutMetadataFlagBody -> PutMetadataFlagBody -> Bool
Prelude.Eq, ReadPrec [PutMetadataFlagBody]
ReadPrec PutMetadataFlagBody
Int -> ReadS PutMetadataFlagBody
ReadS [PutMetadataFlagBody]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutMetadataFlagBody]
$creadListPrec :: ReadPrec [PutMetadataFlagBody]
readPrec :: ReadPrec PutMetadataFlagBody
$creadPrec :: ReadPrec PutMetadataFlagBody
readList :: ReadS [PutMetadataFlagBody]
$creadList :: ReadS [PutMetadataFlagBody]
readsPrec :: Int -> ReadS PutMetadataFlagBody
$creadsPrec :: Int -> ReadS PutMetadataFlagBody
Prelude.Read, Int -> PutMetadataFlagBody -> ShowS
[PutMetadataFlagBody] -> ShowS
PutMetadataFlagBody -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutMetadataFlagBody] -> ShowS
$cshowList :: [PutMetadataFlagBody] -> ShowS
show :: PutMetadataFlagBody -> String
$cshow :: PutMetadataFlagBody -> String
showsPrec :: Int -> PutMetadataFlagBody -> ShowS
$cshowsPrec :: Int -> PutMetadataFlagBody -> ShowS
Prelude.Show, forall x. Rep PutMetadataFlagBody x -> PutMetadataFlagBody
forall x. PutMetadataFlagBody -> Rep PutMetadataFlagBody x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutMetadataFlagBody x -> PutMetadataFlagBody
$cfrom :: forall x. PutMetadataFlagBody -> Rep PutMetadataFlagBody x
Prelude.Generic)

-- |
-- Create a value of 'PutMetadataFlagBody' 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:
--
-- 'newValue'', 'putMetadataFlagBody_newValue' - The new information to store.
newPutMetadataFlagBody ::
  -- | 'newValue''
  Prelude.Text ->
  PutMetadataFlagBody
newPutMetadataFlagBody :: Text -> PutMetadataFlagBody
newPutMetadataFlagBody Text
pNewValue_ =
  PutMetadataFlagBody' {$sel:newValue':PutMetadataFlagBody' :: Text
newValue' = Text
pNewValue_}

-- | The new information to store.
putMetadataFlagBody_newValue :: Lens.Lens' PutMetadataFlagBody Prelude.Text
putMetadataFlagBody_newValue :: Lens' PutMetadataFlagBody Text
putMetadataFlagBody_newValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMetadataFlagBody' {Text
newValue' :: Text
$sel:newValue':PutMetadataFlagBody' :: PutMetadataFlagBody -> Text
newValue'} -> Text
newValue') (\s :: PutMetadataFlagBody
s@PutMetadataFlagBody' {} Text
a -> PutMetadataFlagBody
s {$sel:newValue':PutMetadataFlagBody' :: Text
newValue' = Text
a} :: PutMetadataFlagBody)

instance Prelude.Hashable PutMetadataFlagBody where
  hashWithSalt :: Int -> PutMetadataFlagBody -> Int
hashWithSalt Int
_salt PutMetadataFlagBody' {Text
newValue' :: Text
$sel:newValue':PutMetadataFlagBody' :: PutMetadataFlagBody -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
newValue'

instance Prelude.NFData PutMetadataFlagBody where
  rnf :: PutMetadataFlagBody -> ()
rnf PutMetadataFlagBody' {Text
newValue' :: Text
$sel:newValue':PutMetadataFlagBody' :: PutMetadataFlagBody -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
newValue'

instance Data.ToJSON PutMetadataFlagBody where
  toJSON :: PutMetadataFlagBody -> Value
toJSON PutMetadataFlagBody' {Text
newValue' :: Text
$sel:newValue':PutMetadataFlagBody' :: PutMetadataFlagBody -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"newValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
newValue')]
      )