{-# 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.PinpointSmsVoiceV2.Types.OptOutListInformation
-- 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.PinpointSmsVoiceV2.Types.OptOutListInformation 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

-- | The information for all OptOutList in an Amazon Web Services account.
--
-- /See:/ 'newOptOutListInformation' smart constructor.
data OptOutListInformation = OptOutListInformation'
  { -- | The Amazon Resource Name (ARN) of the OptOutList.
    OptOutListInformation -> Text
optOutListArn :: Prelude.Text,
    -- | The name of the OptOutList.
    OptOutListInformation -> Text
optOutListName :: Prelude.Text,
    -- | The time when the OutOutList was created, in
    -- <https://www.epochconverter.com/ UNIX epoch time> format.
    OptOutListInformation -> POSIX
createdTimestamp :: Data.POSIX
  }
  deriving (OptOutListInformation -> OptOutListInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OptOutListInformation -> OptOutListInformation -> Bool
$c/= :: OptOutListInformation -> OptOutListInformation -> Bool
== :: OptOutListInformation -> OptOutListInformation -> Bool
$c== :: OptOutListInformation -> OptOutListInformation -> Bool
Prelude.Eq, ReadPrec [OptOutListInformation]
ReadPrec OptOutListInformation
Int -> ReadS OptOutListInformation
ReadS [OptOutListInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OptOutListInformation]
$creadListPrec :: ReadPrec [OptOutListInformation]
readPrec :: ReadPrec OptOutListInformation
$creadPrec :: ReadPrec OptOutListInformation
readList :: ReadS [OptOutListInformation]
$creadList :: ReadS [OptOutListInformation]
readsPrec :: Int -> ReadS OptOutListInformation
$creadsPrec :: Int -> ReadS OptOutListInformation
Prelude.Read, Int -> OptOutListInformation -> ShowS
[OptOutListInformation] -> ShowS
OptOutListInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OptOutListInformation] -> ShowS
$cshowList :: [OptOutListInformation] -> ShowS
show :: OptOutListInformation -> String
$cshow :: OptOutListInformation -> String
showsPrec :: Int -> OptOutListInformation -> ShowS
$cshowsPrec :: Int -> OptOutListInformation -> ShowS
Prelude.Show, forall x. Rep OptOutListInformation x -> OptOutListInformation
forall x. OptOutListInformation -> Rep OptOutListInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OptOutListInformation x -> OptOutListInformation
$cfrom :: forall x. OptOutListInformation -> Rep OptOutListInformation x
Prelude.Generic)

-- |
-- Create a value of 'OptOutListInformation' 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:
--
-- 'optOutListArn', 'optOutListInformation_optOutListArn' - The Amazon Resource Name (ARN) of the OptOutList.
--
-- 'optOutListName', 'optOutListInformation_optOutListName' - The name of the OptOutList.
--
-- 'createdTimestamp', 'optOutListInformation_createdTimestamp' - The time when the OutOutList was created, in
-- <https://www.epochconverter.com/ UNIX epoch time> format.
newOptOutListInformation ::
  -- | 'optOutListArn'
  Prelude.Text ->
  -- | 'optOutListName'
  Prelude.Text ->
  -- | 'createdTimestamp'
  Prelude.UTCTime ->
  OptOutListInformation
newOptOutListInformation :: Text -> Text -> UTCTime -> OptOutListInformation
newOptOutListInformation
  Text
pOptOutListArn_
  Text
pOptOutListName_
  UTCTime
pCreatedTimestamp_ =
    OptOutListInformation'
      { $sel:optOutListArn:OptOutListInformation' :: Text
optOutListArn =
          Text
pOptOutListArn_,
        $sel:optOutListName:OptOutListInformation' :: Text
optOutListName = Text
pOptOutListName_,
        $sel:createdTimestamp:OptOutListInformation' :: POSIX
createdTimestamp =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedTimestamp_
      }

-- | The Amazon Resource Name (ARN) of the OptOutList.
optOutListInformation_optOutListArn :: Lens.Lens' OptOutListInformation Prelude.Text
optOutListInformation_optOutListArn :: Lens' OptOutListInformation Text
optOutListInformation_optOutListArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptOutListInformation' {Text
optOutListArn :: Text
$sel:optOutListArn:OptOutListInformation' :: OptOutListInformation -> Text
optOutListArn} -> Text
optOutListArn) (\s :: OptOutListInformation
s@OptOutListInformation' {} Text
a -> OptOutListInformation
s {$sel:optOutListArn:OptOutListInformation' :: Text
optOutListArn = Text
a} :: OptOutListInformation)

-- | The name of the OptOutList.
optOutListInformation_optOutListName :: Lens.Lens' OptOutListInformation Prelude.Text
optOutListInformation_optOutListName :: Lens' OptOutListInformation Text
optOutListInformation_optOutListName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptOutListInformation' {Text
optOutListName :: Text
$sel:optOutListName:OptOutListInformation' :: OptOutListInformation -> Text
optOutListName} -> Text
optOutListName) (\s :: OptOutListInformation
s@OptOutListInformation' {} Text
a -> OptOutListInformation
s {$sel:optOutListName:OptOutListInformation' :: Text
optOutListName = Text
a} :: OptOutListInformation)

-- | The time when the OutOutList was created, in
-- <https://www.epochconverter.com/ UNIX epoch time> format.
optOutListInformation_createdTimestamp :: Lens.Lens' OptOutListInformation Prelude.UTCTime
optOutListInformation_createdTimestamp :: Lens' OptOutListInformation UTCTime
optOutListInformation_createdTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptOutListInformation' {POSIX
createdTimestamp :: POSIX
$sel:createdTimestamp:OptOutListInformation' :: OptOutListInformation -> POSIX
createdTimestamp} -> POSIX
createdTimestamp) (\s :: OptOutListInformation
s@OptOutListInformation' {} POSIX
a -> OptOutListInformation
s {$sel:createdTimestamp:OptOutListInformation' :: POSIX
createdTimestamp = POSIX
a} :: OptOutListInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON OptOutListInformation where
  parseJSON :: Value -> Parser OptOutListInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OptOutListInformation"
      ( \Object
x ->
          Text -> Text -> POSIX -> OptOutListInformation
OptOutListInformation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OptOutListArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OptOutListName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreatedTimestamp")
      )

instance Prelude.Hashable OptOutListInformation where
  hashWithSalt :: Int -> OptOutListInformation -> Int
hashWithSalt Int
_salt OptOutListInformation' {Text
POSIX
createdTimestamp :: POSIX
optOutListName :: Text
optOutListArn :: Text
$sel:createdTimestamp:OptOutListInformation' :: OptOutListInformation -> POSIX
$sel:optOutListName:OptOutListInformation' :: OptOutListInformation -> Text
$sel:optOutListArn:OptOutListInformation' :: OptOutListInformation -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
optOutListArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
optOutListName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdTimestamp

instance Prelude.NFData OptOutListInformation where
  rnf :: OptOutListInformation -> ()
rnf OptOutListInformation' {Text
POSIX
createdTimestamp :: POSIX
optOutListName :: Text
optOutListArn :: Text
$sel:createdTimestamp:OptOutListInformation' :: OptOutListInformation -> POSIX
$sel:optOutListName:OptOutListInformation' :: OptOutListInformation -> Text
$sel:optOutListArn:OptOutListInformation' :: OptOutListInformation -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
optOutListArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
optOutListName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdTimestamp