{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AuthorizationData = AuthorizationData'
{
AuthorizationData -> Maybe POSIX
expiresAt :: Prelude.Maybe Core.POSIX,
AuthorizationData -> Maybe Text
authorizationToken :: Prelude.Maybe Prelude.Text
}
deriving (AuthorizationData -> AuthorizationData -> Bool
(AuthorizationData -> AuthorizationData -> Bool)
-> (AuthorizationData -> AuthorizationData -> Bool)
-> Eq AuthorizationData
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]
(Int -> ReadS AuthorizationData)
-> ReadS [AuthorizationData]
-> ReadPrec AuthorizationData
-> ReadPrec [AuthorizationData]
-> Read 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
(Int -> AuthorizationData -> ShowS)
-> (AuthorizationData -> String)
-> ([AuthorizationData] -> ShowS)
-> Show AuthorizationData
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. AuthorizationData -> Rep AuthorizationData x)
-> (forall x. Rep AuthorizationData x -> AuthorizationData)
-> Generic AuthorizationData
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' :: Maybe POSIX -> Maybe Text -> AuthorizationData
AuthorizationData'
{ $sel:expiresAt:AuthorizationData' :: Maybe POSIX
expiresAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:authorizationToken:AuthorizationData' :: Maybe Text
authorizationToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
authorizationData_expiresAt :: Lens.Lens' AuthorizationData (Prelude.Maybe Prelude.UTCTime)
authorizationData_expiresAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AuthorizationData -> f AuthorizationData
authorizationData_expiresAt = (AuthorizationData -> Maybe POSIX)
-> (AuthorizationData -> Maybe POSIX -> AuthorizationData)
-> Lens
AuthorizationData AuthorizationData (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
-> AuthorizationData -> f AuthorizationData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AuthorizationData
-> f AuthorizationData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
authorizationData_authorizationToken :: Lens.Lens' AuthorizationData (Prelude.Maybe Prelude.Text)
authorizationData_authorizationToken :: (Maybe Text -> f (Maybe Text))
-> AuthorizationData -> f AuthorizationData
authorizationData_authorizationToken = (AuthorizationData -> Maybe Text)
-> (AuthorizationData -> Maybe Text -> AuthorizationData)
-> Lens
AuthorizationData AuthorizationData (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON AuthorizationData where
parseJSON :: Value -> Parser AuthorizationData
parseJSON =
String
-> (Object -> Parser AuthorizationData)
-> Value
-> Parser AuthorizationData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AuthorizationData"
( \Object
x ->
Maybe POSIX -> Maybe Text -> AuthorizationData
AuthorizationData'
(Maybe POSIX -> Maybe Text -> AuthorizationData)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> AuthorizationData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"expiresAt")
Parser (Maybe Text -> AuthorizationData)
-> Parser (Maybe Text) -> Parser AuthorizationData
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
"authorizationToken")
)
instance Prelude.Hashable AuthorizationData
instance Prelude.NFData AuthorizationData