{-# 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.Organizations.Types.DelegatedService where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DelegatedService = DelegatedService'
{
DelegatedService -> Maybe Text
servicePrincipal :: Prelude.Maybe Prelude.Text,
DelegatedService -> Maybe POSIX
delegationEnabledDate :: Prelude.Maybe Core.POSIX
}
deriving (DelegatedService -> DelegatedService -> Bool
(DelegatedService -> DelegatedService -> Bool)
-> (DelegatedService -> DelegatedService -> Bool)
-> Eq DelegatedService
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DelegatedService -> DelegatedService -> Bool
$c/= :: DelegatedService -> DelegatedService -> Bool
== :: DelegatedService -> DelegatedService -> Bool
$c== :: DelegatedService -> DelegatedService -> Bool
Prelude.Eq, ReadPrec [DelegatedService]
ReadPrec DelegatedService
Int -> ReadS DelegatedService
ReadS [DelegatedService]
(Int -> ReadS DelegatedService)
-> ReadS [DelegatedService]
-> ReadPrec DelegatedService
-> ReadPrec [DelegatedService]
-> Read DelegatedService
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DelegatedService]
$creadListPrec :: ReadPrec [DelegatedService]
readPrec :: ReadPrec DelegatedService
$creadPrec :: ReadPrec DelegatedService
readList :: ReadS [DelegatedService]
$creadList :: ReadS [DelegatedService]
readsPrec :: Int -> ReadS DelegatedService
$creadsPrec :: Int -> ReadS DelegatedService
Prelude.Read, Int -> DelegatedService -> ShowS
[DelegatedService] -> ShowS
DelegatedService -> String
(Int -> DelegatedService -> ShowS)
-> (DelegatedService -> String)
-> ([DelegatedService] -> ShowS)
-> Show DelegatedService
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DelegatedService] -> ShowS
$cshowList :: [DelegatedService] -> ShowS
show :: DelegatedService -> String
$cshow :: DelegatedService -> String
showsPrec :: Int -> DelegatedService -> ShowS
$cshowsPrec :: Int -> DelegatedService -> ShowS
Prelude.Show, (forall x. DelegatedService -> Rep DelegatedService x)
-> (forall x. Rep DelegatedService x -> DelegatedService)
-> Generic DelegatedService
forall x. Rep DelegatedService x -> DelegatedService
forall x. DelegatedService -> Rep DelegatedService x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DelegatedService x -> DelegatedService
$cfrom :: forall x. DelegatedService -> Rep DelegatedService x
Prelude.Generic)
newDelegatedService ::
DelegatedService
newDelegatedService :: DelegatedService
newDelegatedService =
DelegatedService' :: Maybe Text -> Maybe POSIX -> DelegatedService
DelegatedService'
{ $sel:servicePrincipal:DelegatedService' :: Maybe Text
servicePrincipal =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:delegationEnabledDate:DelegatedService' :: Maybe POSIX
delegationEnabledDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
delegatedService_servicePrincipal :: Lens.Lens' DelegatedService (Prelude.Maybe Prelude.Text)
delegatedService_servicePrincipal :: (Maybe Text -> f (Maybe Text))
-> DelegatedService -> f DelegatedService
delegatedService_servicePrincipal = (DelegatedService -> Maybe Text)
-> (DelegatedService -> Maybe Text -> DelegatedService)
-> Lens DelegatedService DelegatedService (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DelegatedService' {Maybe Text
servicePrincipal :: Maybe Text
$sel:servicePrincipal:DelegatedService' :: DelegatedService -> Maybe Text
servicePrincipal} -> Maybe Text
servicePrincipal) (\s :: DelegatedService
s@DelegatedService' {} Maybe Text
a -> DelegatedService
s {$sel:servicePrincipal:DelegatedService' :: Maybe Text
servicePrincipal = Maybe Text
a} :: DelegatedService)
delegatedService_delegationEnabledDate :: Lens.Lens' DelegatedService (Prelude.Maybe Prelude.UTCTime)
delegatedService_delegationEnabledDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DelegatedService -> f DelegatedService
delegatedService_delegationEnabledDate = (DelegatedService -> Maybe POSIX)
-> (DelegatedService -> Maybe POSIX -> DelegatedService)
-> Lens
DelegatedService DelegatedService (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DelegatedService' {Maybe POSIX
delegationEnabledDate :: Maybe POSIX
$sel:delegationEnabledDate:DelegatedService' :: DelegatedService -> Maybe POSIX
delegationEnabledDate} -> Maybe POSIX
delegationEnabledDate) (\s :: DelegatedService
s@DelegatedService' {} Maybe POSIX
a -> DelegatedService
s {$sel:delegationEnabledDate:DelegatedService' :: Maybe POSIX
delegationEnabledDate = Maybe POSIX
a} :: DelegatedService) ((Maybe POSIX -> f (Maybe POSIX))
-> DelegatedService -> f DelegatedService)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DelegatedService
-> f DelegatedService
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
instance Core.FromJSON DelegatedService where
parseJSON :: Value -> Parser DelegatedService
parseJSON =
String
-> (Object -> Parser DelegatedService)
-> Value
-> Parser DelegatedService
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DelegatedService"
( \Object
x ->
Maybe Text -> Maybe POSIX -> DelegatedService
DelegatedService'
(Maybe Text -> Maybe POSIX -> DelegatedService)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> DelegatedService)
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
"ServicePrincipal")
Parser (Maybe POSIX -> DelegatedService)
-> Parser (Maybe POSIX) -> Parser DelegatedService
forall (f :: * -> *) a b. Applicative f => 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
"DelegationEnabledDate")
)
instance Prelude.Hashable DelegatedService
instance Prelude.NFData DelegatedService