{-# 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.Glue.Types.OtherMetadataValueListItem
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glue.Types.OtherMetadataValueListItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A structure containing other metadata for a schema version belonging to
-- the same metadata key.
--
-- /See:/ 'newOtherMetadataValueListItem' smart constructor.
data OtherMetadataValueListItem = OtherMetadataValueListItem'
  { -- | The time at which the entry was created.
    OtherMetadataValueListItem -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The metadata key’s corresponding value for the other metadata belonging
    -- to the same metadata key.
    OtherMetadataValueListItem -> Maybe Text
metadataValue :: Prelude.Maybe Prelude.Text
  }
  deriving (OtherMetadataValueListItem -> OtherMetadataValueListItem -> Bool
(OtherMetadataValueListItem -> OtherMetadataValueListItem -> Bool)
-> (OtherMetadataValueListItem
    -> OtherMetadataValueListItem -> Bool)
-> Eq OtherMetadataValueListItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OtherMetadataValueListItem -> OtherMetadataValueListItem -> Bool
$c/= :: OtherMetadataValueListItem -> OtherMetadataValueListItem -> Bool
== :: OtherMetadataValueListItem -> OtherMetadataValueListItem -> Bool
$c== :: OtherMetadataValueListItem -> OtherMetadataValueListItem -> Bool
Prelude.Eq, ReadPrec [OtherMetadataValueListItem]
ReadPrec OtherMetadataValueListItem
Int -> ReadS OtherMetadataValueListItem
ReadS [OtherMetadataValueListItem]
(Int -> ReadS OtherMetadataValueListItem)
-> ReadS [OtherMetadataValueListItem]
-> ReadPrec OtherMetadataValueListItem
-> ReadPrec [OtherMetadataValueListItem]
-> Read OtherMetadataValueListItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OtherMetadataValueListItem]
$creadListPrec :: ReadPrec [OtherMetadataValueListItem]
readPrec :: ReadPrec OtherMetadataValueListItem
$creadPrec :: ReadPrec OtherMetadataValueListItem
readList :: ReadS [OtherMetadataValueListItem]
$creadList :: ReadS [OtherMetadataValueListItem]
readsPrec :: Int -> ReadS OtherMetadataValueListItem
$creadsPrec :: Int -> ReadS OtherMetadataValueListItem
Prelude.Read, Int -> OtherMetadataValueListItem -> ShowS
[OtherMetadataValueListItem] -> ShowS
OtherMetadataValueListItem -> String
(Int -> OtherMetadataValueListItem -> ShowS)
-> (OtherMetadataValueListItem -> String)
-> ([OtherMetadataValueListItem] -> ShowS)
-> Show OtherMetadataValueListItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OtherMetadataValueListItem] -> ShowS
$cshowList :: [OtherMetadataValueListItem] -> ShowS
show :: OtherMetadataValueListItem -> String
$cshow :: OtherMetadataValueListItem -> String
showsPrec :: Int -> OtherMetadataValueListItem -> ShowS
$cshowsPrec :: Int -> OtherMetadataValueListItem -> ShowS
Prelude.Show, (forall x.
 OtherMetadataValueListItem -> Rep OtherMetadataValueListItem x)
-> (forall x.
    Rep OtherMetadataValueListItem x -> OtherMetadataValueListItem)
-> Generic OtherMetadataValueListItem
forall x.
Rep OtherMetadataValueListItem x -> OtherMetadataValueListItem
forall x.
OtherMetadataValueListItem -> Rep OtherMetadataValueListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OtherMetadataValueListItem x -> OtherMetadataValueListItem
$cfrom :: forall x.
OtherMetadataValueListItem -> Rep OtherMetadataValueListItem x
Prelude.Generic)

-- |
-- Create a value of 'OtherMetadataValueListItem' 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:
--
-- 'createdTime', 'otherMetadataValueListItem_createdTime' - The time at which the entry was created.
--
-- 'metadataValue', 'otherMetadataValueListItem_metadataValue' - The metadata key’s corresponding value for the other metadata belonging
-- to the same metadata key.
newOtherMetadataValueListItem ::
  OtherMetadataValueListItem
newOtherMetadataValueListItem :: OtherMetadataValueListItem
newOtherMetadataValueListItem =
  OtherMetadataValueListItem' :: Maybe Text -> Maybe Text -> OtherMetadataValueListItem
OtherMetadataValueListItem'
    { $sel:createdTime:OtherMetadataValueListItem' :: Maybe Text
createdTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:metadataValue:OtherMetadataValueListItem' :: Maybe Text
metadataValue = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time at which the entry was created.
otherMetadataValueListItem_createdTime :: Lens.Lens' OtherMetadataValueListItem (Prelude.Maybe Prelude.Text)
otherMetadataValueListItem_createdTime :: (Maybe Text -> f (Maybe Text))
-> OtherMetadataValueListItem -> f OtherMetadataValueListItem
otherMetadataValueListItem_createdTime = (OtherMetadataValueListItem -> Maybe Text)
-> (OtherMetadataValueListItem
    -> Maybe Text -> OtherMetadataValueListItem)
-> Lens
     OtherMetadataValueListItem
     OtherMetadataValueListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OtherMetadataValueListItem' {Maybe Text
createdTime :: Maybe Text
$sel:createdTime:OtherMetadataValueListItem' :: OtherMetadataValueListItem -> Maybe Text
createdTime} -> Maybe Text
createdTime) (\s :: OtherMetadataValueListItem
s@OtherMetadataValueListItem' {} Maybe Text
a -> OtherMetadataValueListItem
s {$sel:createdTime:OtherMetadataValueListItem' :: Maybe Text
createdTime = Maybe Text
a} :: OtherMetadataValueListItem)

-- | The metadata key’s corresponding value for the other metadata belonging
-- to the same metadata key.
otherMetadataValueListItem_metadataValue :: Lens.Lens' OtherMetadataValueListItem (Prelude.Maybe Prelude.Text)
otherMetadataValueListItem_metadataValue :: (Maybe Text -> f (Maybe Text))
-> OtherMetadataValueListItem -> f OtherMetadataValueListItem
otherMetadataValueListItem_metadataValue = (OtherMetadataValueListItem -> Maybe Text)
-> (OtherMetadataValueListItem
    -> Maybe Text -> OtherMetadataValueListItem)
-> Lens
     OtherMetadataValueListItem
     OtherMetadataValueListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OtherMetadataValueListItem' {Maybe Text
metadataValue :: Maybe Text
$sel:metadataValue:OtherMetadataValueListItem' :: OtherMetadataValueListItem -> Maybe Text
metadataValue} -> Maybe Text
metadataValue) (\s :: OtherMetadataValueListItem
s@OtherMetadataValueListItem' {} Maybe Text
a -> OtherMetadataValueListItem
s {$sel:metadataValue:OtherMetadataValueListItem' :: Maybe Text
metadataValue = Maybe Text
a} :: OtherMetadataValueListItem)

instance Core.FromJSON OtherMetadataValueListItem where
  parseJSON :: Value -> Parser OtherMetadataValueListItem
parseJSON =
    String
-> (Object -> Parser OtherMetadataValueListItem)
-> Value
-> Parser OtherMetadataValueListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OtherMetadataValueListItem"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> OtherMetadataValueListItem
OtherMetadataValueListItem'
            (Maybe Text -> Maybe Text -> OtherMetadataValueListItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> OtherMetadataValueListItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
            Parser (Maybe Text -> OtherMetadataValueListItem)
-> Parser (Maybe Text) -> Parser OtherMetadataValueListItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MetadataValue")
      )

instance Prelude.Hashable OtherMetadataValueListItem

instance Prelude.NFData OtherMetadataValueListItem