{-# 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.ECRPublic.Types.AuthorizationData 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 AuthorizationData = AuthorizationData'
{
AuthorizationData -> Maybe Text
authorizationToken :: Prelude.Maybe Prelude.Text,
AuthorizationData -> Maybe POSIX
expiresAt :: Prelude.Maybe Data.POSIX
}
deriving (AuthorizationData -> AuthorizationData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthorizationData -> AuthorizationData -> Bool
$c/= :: AuthorizationData -> AuthorizationData -> Bool
== :: AuthorizationData -> AuthorizationData -> Bool
$c== :: AuthorizationData -> AuthorizationData -> Bool
Prelude.Eq, ReadPrec [AuthorizationData]
ReadPrec AuthorizationData
Int -> ReadS AuthorizationData
ReadS [AuthorizationData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthorizationData]
$creadListPrec :: ReadPrec [AuthorizationData]
readPrec :: ReadPrec AuthorizationData
$creadPrec :: ReadPrec AuthorizationData
readList :: ReadS [AuthorizationData]
$creadList :: ReadS [AuthorizationData]
readsPrec :: Int -> ReadS AuthorizationData
$creadsPrec :: Int -> ReadS AuthorizationData
Prelude.Read, Int -> AuthorizationData -> ShowS
[AuthorizationData] -> ShowS
AuthorizationData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthorizationData] -> ShowS
$cshowList :: [AuthorizationData] -> ShowS
show :: AuthorizationData -> String
$cshow :: AuthorizationData -> String
showsPrec :: Int -> AuthorizationData -> ShowS
$cshowsPrec :: Int -> AuthorizationData -> ShowS
Prelude.Show, forall x. Rep AuthorizationData x -> AuthorizationData
forall x. AuthorizationData -> Rep AuthorizationData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthorizationData x -> AuthorizationData
$cfrom :: forall x. AuthorizationData -> Rep AuthorizationData x
Prelude.Generic)
newAuthorizationData ::
AuthorizationData
newAuthorizationData :: AuthorizationData
newAuthorizationData =
AuthorizationData'
{ $sel:authorizationToken:AuthorizationData' :: Maybe Text
authorizationToken =
forall a. Maybe a
Prelude.Nothing,
$sel:expiresAt:AuthorizationData' :: Maybe POSIX
expiresAt = forall a. Maybe a
Prelude.Nothing
}
authorizationData_authorizationToken :: Lens.Lens' AuthorizationData (Prelude.Maybe Prelude.Text)
authorizationData_authorizationToken :: Lens' AuthorizationData (Maybe Text)
authorizationData_authorizationToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizationData' {Maybe Text
authorizationToken :: Maybe Text
$sel:authorizationToken:AuthorizationData' :: AuthorizationData -> Maybe Text
authorizationToken} -> Maybe Text
authorizationToken) (\s :: AuthorizationData
s@AuthorizationData' {} Maybe Text
a -> AuthorizationData
s {$sel:authorizationToken:AuthorizationData' :: Maybe Text
authorizationToken = Maybe Text
a} :: AuthorizationData)
authorizationData_expiresAt :: Lens.Lens' AuthorizationData (Prelude.Maybe Prelude.UTCTime)
authorizationData_expiresAt :: Lens' AuthorizationData (Maybe UTCTime)
authorizationData_expiresAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizationData' {Maybe POSIX
expiresAt :: Maybe POSIX
$sel:expiresAt:AuthorizationData' :: AuthorizationData -> Maybe POSIX
expiresAt} -> Maybe POSIX
expiresAt) (\s :: AuthorizationData
s@AuthorizationData' {} Maybe POSIX
a -> AuthorizationData
s {$sel:expiresAt:AuthorizationData' :: Maybe POSIX
expiresAt = Maybe POSIX
a} :: AuthorizationData) 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
instance Data.FromJSON AuthorizationData where
parseJSON :: Value -> Parser AuthorizationData
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AuthorizationData"
( \Object
x ->
Maybe Text -> Maybe POSIX -> AuthorizationData
AuthorizationData'
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
"authorizationToken")
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
"expiresAt")
)
instance Prelude.Hashable AuthorizationData where
hashWithSalt :: Int -> AuthorizationData -> Int
hashWithSalt Int
_salt AuthorizationData' {Maybe Text
Maybe POSIX
expiresAt :: Maybe POSIX
authorizationToken :: Maybe Text
$sel:expiresAt:AuthorizationData' :: AuthorizationData -> Maybe POSIX
$sel:authorizationToken:AuthorizationData' :: AuthorizationData -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorizationToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
expiresAt
instance Prelude.NFData AuthorizationData where
rnf :: AuthorizationData -> ()
rnf AuthorizationData' {Maybe Text
Maybe POSIX
expiresAt :: Maybe POSIX
authorizationToken :: Maybe Text
$sel:expiresAt:AuthorizationData' :: AuthorizationData -> Maybe POSIX
$sel:authorizationToken:AuthorizationData' :: AuthorizationData -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizationToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
expiresAt