{-# 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 #-}
module Amazonka.Connect.Types.SecurityKey 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
data SecurityKey = SecurityKey'
{
SecurityKey -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
SecurityKey -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
SecurityKey -> Maybe Text
key :: Prelude.Maybe Prelude.Text
}
deriving (SecurityKey -> SecurityKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityKey -> SecurityKey -> Bool
$c/= :: SecurityKey -> SecurityKey -> Bool
== :: SecurityKey -> SecurityKey -> Bool
$c== :: SecurityKey -> SecurityKey -> Bool
Prelude.Eq, ReadPrec [SecurityKey]
ReadPrec SecurityKey
Int -> ReadS SecurityKey
ReadS [SecurityKey]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityKey]
$creadListPrec :: ReadPrec [SecurityKey]
readPrec :: ReadPrec SecurityKey
$creadPrec :: ReadPrec SecurityKey
readList :: ReadS [SecurityKey]
$creadList :: ReadS [SecurityKey]
readsPrec :: Int -> ReadS SecurityKey
$creadsPrec :: Int -> ReadS SecurityKey
Prelude.Read, Int -> SecurityKey -> ShowS
[SecurityKey] -> ShowS
SecurityKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityKey] -> ShowS
$cshowList :: [SecurityKey] -> ShowS
show :: SecurityKey -> String
$cshow :: SecurityKey -> String
showsPrec :: Int -> SecurityKey -> ShowS
$cshowsPrec :: Int -> SecurityKey -> ShowS
Prelude.Show, forall x. Rep SecurityKey x -> SecurityKey
forall x. SecurityKey -> Rep SecurityKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecurityKey x -> SecurityKey
$cfrom :: forall x. SecurityKey -> Rep SecurityKey x
Prelude.Generic)
newSecurityKey ::
SecurityKey
newSecurityKey :: SecurityKey
newSecurityKey =
SecurityKey'
{ $sel:associationId:SecurityKey' :: Maybe Text
associationId = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:SecurityKey' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:key:SecurityKey' :: Maybe Text
key = forall a. Maybe a
Prelude.Nothing
}
securityKey_associationId :: Lens.Lens' SecurityKey (Prelude.Maybe Prelude.Text)
securityKey_associationId :: Lens' SecurityKey (Maybe Text)
securityKey_associationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityKey' {Maybe Text
associationId :: Maybe Text
$sel:associationId:SecurityKey' :: SecurityKey -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: SecurityKey
s@SecurityKey' {} Maybe Text
a -> SecurityKey
s {$sel:associationId:SecurityKey' :: Maybe Text
associationId = Maybe Text
a} :: SecurityKey)
securityKey_creationTime :: Lens.Lens' SecurityKey (Prelude.Maybe Prelude.UTCTime)
securityKey_creationTime :: Lens' SecurityKey (Maybe UTCTime)
securityKey_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityKey' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:SecurityKey' :: SecurityKey -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: SecurityKey
s@SecurityKey' {} Maybe POSIX
a -> SecurityKey
s {$sel:creationTime:SecurityKey' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: SecurityKey) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
securityKey_key :: Lens.Lens' SecurityKey (Prelude.Maybe Prelude.Text)
securityKey_key :: Lens' SecurityKey (Maybe Text)
securityKey_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityKey' {Maybe Text
key :: Maybe Text
$sel:key:SecurityKey' :: SecurityKey -> Maybe Text
key} -> Maybe Text
key) (\s :: SecurityKey
s@SecurityKey' {} Maybe Text
a -> SecurityKey
s {$sel:key:SecurityKey' :: Maybe Text
key = Maybe Text
a} :: SecurityKey)
instance Data.FromJSON SecurityKey where
parseJSON :: Value -> Parser SecurityKey
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SecurityKey"
( \Object
x ->
Maybe Text -> Maybe POSIX -> Maybe Text -> SecurityKey
SecurityKey'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AssociationId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Key")
)
instance Prelude.Hashable SecurityKey where
hashWithSalt :: Int -> SecurityKey -> Int
hashWithSalt Int
_salt SecurityKey' {Maybe Text
Maybe POSIX
key :: Maybe Text
creationTime :: Maybe POSIX
associationId :: Maybe Text
$sel:key:SecurityKey' :: SecurityKey -> Maybe Text
$sel:creationTime:SecurityKey' :: SecurityKey -> Maybe POSIX
$sel:associationId:SecurityKey' :: SecurityKey -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
key
instance Prelude.NFData SecurityKey where
rnf :: SecurityKey -> ()
rnf SecurityKey' {Maybe Text
Maybe POSIX
key :: Maybe Text
creationTime :: Maybe POSIX
associationId :: Maybe Text
$sel:key:SecurityKey' :: SecurityKey -> Maybe Text
$sel:creationTime:SecurityKey' :: SecurityKey -> Maybe POSIX
$sel:associationId:SecurityKey' :: SecurityKey -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
key