{-# 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.DLM.Types.PolicyDetails where
import qualified Amazonka.Core as Core
import Amazonka.DLM.Types.Action
import Amazonka.DLM.Types.EventSource
import Amazonka.DLM.Types.Parameters
import Amazonka.DLM.Types.PolicyTypeValues
import Amazonka.DLM.Types.ResourceLocationValues
import Amazonka.DLM.Types.ResourceTypeValues
import Amazonka.DLM.Types.Schedule
import Amazonka.DLM.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PolicyDetails = PolicyDetails'
{
PolicyDetails -> Maybe (NonEmpty Action)
actions :: Prelude.Maybe (Prelude.NonEmpty Action),
PolicyDetails -> Maybe (NonEmpty Tag)
targetTags :: Prelude.Maybe (Prelude.NonEmpty Tag),
PolicyDetails -> Maybe PolicyTypeValues
policyType :: Prelude.Maybe PolicyTypeValues,
PolicyDetails -> Maybe (NonEmpty ResourceLocationValues)
resourceLocations :: Prelude.Maybe (Prelude.NonEmpty ResourceLocationValues),
PolicyDetails -> Maybe Parameters
parameters :: Prelude.Maybe Parameters,
PolicyDetails -> Maybe (NonEmpty Schedule)
schedules :: Prelude.Maybe (Prelude.NonEmpty Schedule),
PolicyDetails -> Maybe EventSource
eventSource :: Prelude.Maybe EventSource,
PolicyDetails -> Maybe (NonEmpty ResourceTypeValues)
resourceTypes :: Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues)
}
deriving (PolicyDetails -> PolicyDetails -> Bool
(PolicyDetails -> PolicyDetails -> Bool)
-> (PolicyDetails -> PolicyDetails -> Bool) -> Eq PolicyDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyDetails -> PolicyDetails -> Bool
$c/= :: PolicyDetails -> PolicyDetails -> Bool
== :: PolicyDetails -> PolicyDetails -> Bool
$c== :: PolicyDetails -> PolicyDetails -> Bool
Prelude.Eq, ReadPrec [PolicyDetails]
ReadPrec PolicyDetails
Int -> ReadS PolicyDetails
ReadS [PolicyDetails]
(Int -> ReadS PolicyDetails)
-> ReadS [PolicyDetails]
-> ReadPrec PolicyDetails
-> ReadPrec [PolicyDetails]
-> Read PolicyDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyDetails]
$creadListPrec :: ReadPrec [PolicyDetails]
readPrec :: ReadPrec PolicyDetails
$creadPrec :: ReadPrec PolicyDetails
readList :: ReadS [PolicyDetails]
$creadList :: ReadS [PolicyDetails]
readsPrec :: Int -> ReadS PolicyDetails
$creadsPrec :: Int -> ReadS PolicyDetails
Prelude.Read, Int -> PolicyDetails -> ShowS
[PolicyDetails] -> ShowS
PolicyDetails -> String
(Int -> PolicyDetails -> ShowS)
-> (PolicyDetails -> String)
-> ([PolicyDetails] -> ShowS)
-> Show PolicyDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyDetails] -> ShowS
$cshowList :: [PolicyDetails] -> ShowS
show :: PolicyDetails -> String
$cshow :: PolicyDetails -> String
showsPrec :: Int -> PolicyDetails -> ShowS
$cshowsPrec :: Int -> PolicyDetails -> ShowS
Prelude.Show, (forall x. PolicyDetails -> Rep PolicyDetails x)
-> (forall x. Rep PolicyDetails x -> PolicyDetails)
-> Generic PolicyDetails
forall x. Rep PolicyDetails x -> PolicyDetails
forall x. PolicyDetails -> Rep PolicyDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyDetails x -> PolicyDetails
$cfrom :: forall x. PolicyDetails -> Rep PolicyDetails x
Prelude.Generic)
newPolicyDetails ::
PolicyDetails
newPolicyDetails :: PolicyDetails
newPolicyDetails =
PolicyDetails' :: Maybe (NonEmpty Action)
-> Maybe (NonEmpty Tag)
-> Maybe PolicyTypeValues
-> Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails
PolicyDetails'
{ $sel:actions:PolicyDetails' :: Maybe (NonEmpty Action)
actions = Maybe (NonEmpty Action)
forall a. Maybe a
Prelude.Nothing,
$sel:targetTags:PolicyDetails' :: Maybe (NonEmpty Tag)
targetTags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:policyType:PolicyDetails' :: Maybe PolicyTypeValues
policyType = Maybe PolicyTypeValues
forall a. Maybe a
Prelude.Nothing,
$sel:resourceLocations:PolicyDetails' :: Maybe (NonEmpty ResourceLocationValues)
resourceLocations = Maybe (NonEmpty ResourceLocationValues)
forall a. Maybe a
Prelude.Nothing,
$sel:parameters:PolicyDetails' :: Maybe Parameters
parameters = Maybe Parameters
forall a. Maybe a
Prelude.Nothing,
$sel:schedules:PolicyDetails' :: Maybe (NonEmpty Schedule)
schedules = Maybe (NonEmpty Schedule)
forall a. Maybe a
Prelude.Nothing,
$sel:eventSource:PolicyDetails' :: Maybe EventSource
eventSource = Maybe EventSource
forall a. Maybe a
Prelude.Nothing,
$sel:resourceTypes:PolicyDetails' :: Maybe (NonEmpty ResourceTypeValues)
resourceTypes = Maybe (NonEmpty ResourceTypeValues)
forall a. Maybe a
Prelude.Nothing
}
policyDetails_actions :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty Action))
policyDetails_actions :: (Maybe (NonEmpty Action) -> f (Maybe (NonEmpty Action)))
-> PolicyDetails -> f PolicyDetails
policyDetails_actions = (PolicyDetails -> Maybe (NonEmpty Action))
-> (PolicyDetails -> Maybe (NonEmpty Action) -> PolicyDetails)
-> Lens
PolicyDetails
PolicyDetails
(Maybe (NonEmpty Action))
(Maybe (NonEmpty Action))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe (NonEmpty Action)
actions :: Maybe (NonEmpty Action)
$sel:actions:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty Action)
actions} -> Maybe (NonEmpty Action)
actions) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe (NonEmpty Action)
a -> PolicyDetails
s {$sel:actions:PolicyDetails' :: Maybe (NonEmpty Action)
actions = Maybe (NonEmpty Action)
a} :: PolicyDetails) ((Maybe (NonEmpty Action) -> f (Maybe (NonEmpty Action)))
-> PolicyDetails -> f PolicyDetails)
-> ((Maybe (NonEmpty Action) -> f (Maybe (NonEmpty Action)))
-> Maybe (NonEmpty Action) -> f (Maybe (NonEmpty Action)))
-> (Maybe (NonEmpty Action) -> f (Maybe (NonEmpty Action)))
-> PolicyDetails
-> f PolicyDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Action)
(NonEmpty Action)
(NonEmpty Action)
(NonEmpty Action)
-> Iso
(Maybe (NonEmpty Action))
(Maybe (NonEmpty Action))
(Maybe (NonEmpty Action))
(Maybe (NonEmpty Action))
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
(NonEmpty Action)
(NonEmpty Action)
(NonEmpty Action)
(NonEmpty Action)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policyDetails_targetTags :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty Tag))
policyDetails_targetTags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> PolicyDetails -> f PolicyDetails
policyDetails_targetTags = (PolicyDetails -> Maybe (NonEmpty Tag))
-> (PolicyDetails -> Maybe (NonEmpty Tag) -> PolicyDetails)
-> Lens
PolicyDetails
PolicyDetails
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe (NonEmpty Tag)
targetTags :: Maybe (NonEmpty Tag)
$sel:targetTags:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty Tag)
targetTags} -> Maybe (NonEmpty Tag)
targetTags) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe (NonEmpty Tag)
a -> PolicyDetails
s {$sel:targetTags:PolicyDetails' :: Maybe (NonEmpty Tag)
targetTags = Maybe (NonEmpty Tag)
a} :: PolicyDetails) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> PolicyDetails -> f PolicyDetails)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> PolicyDetails
-> f PolicyDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policyDetails_policyType :: Lens.Lens' PolicyDetails (Prelude.Maybe PolicyTypeValues)
policyDetails_policyType :: (Maybe PolicyTypeValues -> f (Maybe PolicyTypeValues))
-> PolicyDetails -> f PolicyDetails
policyDetails_policyType = (PolicyDetails -> Maybe PolicyTypeValues)
-> (PolicyDetails -> Maybe PolicyTypeValues -> PolicyDetails)
-> Lens
PolicyDetails
PolicyDetails
(Maybe PolicyTypeValues)
(Maybe PolicyTypeValues)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe PolicyTypeValues
policyType :: Maybe PolicyTypeValues
$sel:policyType:PolicyDetails' :: PolicyDetails -> Maybe PolicyTypeValues
policyType} -> Maybe PolicyTypeValues
policyType) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe PolicyTypeValues
a -> PolicyDetails
s {$sel:policyType:PolicyDetails' :: Maybe PolicyTypeValues
policyType = Maybe PolicyTypeValues
a} :: PolicyDetails)
policyDetails_resourceLocations :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty ResourceLocationValues))
policyDetails_resourceLocations :: (Maybe (NonEmpty ResourceLocationValues)
-> f (Maybe (NonEmpty ResourceLocationValues)))
-> PolicyDetails -> f PolicyDetails
policyDetails_resourceLocations = (PolicyDetails -> Maybe (NonEmpty ResourceLocationValues))
-> (PolicyDetails
-> Maybe (NonEmpty ResourceLocationValues) -> PolicyDetails)
-> Lens
PolicyDetails
PolicyDetails
(Maybe (NonEmpty ResourceLocationValues))
(Maybe (NonEmpty ResourceLocationValues))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe (NonEmpty ResourceLocationValues)
resourceLocations :: Maybe (NonEmpty ResourceLocationValues)
$sel:resourceLocations:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty ResourceLocationValues)
resourceLocations} -> Maybe (NonEmpty ResourceLocationValues)
resourceLocations) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe (NonEmpty ResourceLocationValues)
a -> PolicyDetails
s {$sel:resourceLocations:PolicyDetails' :: Maybe (NonEmpty ResourceLocationValues)
resourceLocations = Maybe (NonEmpty ResourceLocationValues)
a} :: PolicyDetails) ((Maybe (NonEmpty ResourceLocationValues)
-> f (Maybe (NonEmpty ResourceLocationValues)))
-> PolicyDetails -> f PolicyDetails)
-> ((Maybe (NonEmpty ResourceLocationValues)
-> f (Maybe (NonEmpty ResourceLocationValues)))
-> Maybe (NonEmpty ResourceLocationValues)
-> f (Maybe (NonEmpty ResourceLocationValues)))
-> (Maybe (NonEmpty ResourceLocationValues)
-> f (Maybe (NonEmpty ResourceLocationValues)))
-> PolicyDetails
-> f PolicyDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ResourceLocationValues)
(NonEmpty ResourceLocationValues)
(NonEmpty ResourceLocationValues)
(NonEmpty ResourceLocationValues)
-> Iso
(Maybe (NonEmpty ResourceLocationValues))
(Maybe (NonEmpty ResourceLocationValues))
(Maybe (NonEmpty ResourceLocationValues))
(Maybe (NonEmpty ResourceLocationValues))
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
(NonEmpty ResourceLocationValues)
(NonEmpty ResourceLocationValues)
(NonEmpty ResourceLocationValues)
(NonEmpty ResourceLocationValues)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policyDetails_parameters :: Lens.Lens' PolicyDetails (Prelude.Maybe Parameters)
policyDetails_parameters :: (Maybe Parameters -> f (Maybe Parameters))
-> PolicyDetails -> f PolicyDetails
policyDetails_parameters = (PolicyDetails -> Maybe Parameters)
-> (PolicyDetails -> Maybe Parameters -> PolicyDetails)
-> Lens
PolicyDetails PolicyDetails (Maybe Parameters) (Maybe Parameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe Parameters
parameters :: Maybe Parameters
$sel:parameters:PolicyDetails' :: PolicyDetails -> Maybe Parameters
parameters} -> Maybe Parameters
parameters) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe Parameters
a -> PolicyDetails
s {$sel:parameters:PolicyDetails' :: Maybe Parameters
parameters = Maybe Parameters
a} :: PolicyDetails)
policyDetails_schedules :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty Schedule))
policyDetails_schedules :: (Maybe (NonEmpty Schedule) -> f (Maybe (NonEmpty Schedule)))
-> PolicyDetails -> f PolicyDetails
policyDetails_schedules = (PolicyDetails -> Maybe (NonEmpty Schedule))
-> (PolicyDetails -> Maybe (NonEmpty Schedule) -> PolicyDetails)
-> Lens
PolicyDetails
PolicyDetails
(Maybe (NonEmpty Schedule))
(Maybe (NonEmpty Schedule))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe (NonEmpty Schedule)
schedules :: Maybe (NonEmpty Schedule)
$sel:schedules:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty Schedule)
schedules} -> Maybe (NonEmpty Schedule)
schedules) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe (NonEmpty Schedule)
a -> PolicyDetails
s {$sel:schedules:PolicyDetails' :: Maybe (NonEmpty Schedule)
schedules = Maybe (NonEmpty Schedule)
a} :: PolicyDetails) ((Maybe (NonEmpty Schedule) -> f (Maybe (NonEmpty Schedule)))
-> PolicyDetails -> f PolicyDetails)
-> ((Maybe (NonEmpty Schedule) -> f (Maybe (NonEmpty Schedule)))
-> Maybe (NonEmpty Schedule) -> f (Maybe (NonEmpty Schedule)))
-> (Maybe (NonEmpty Schedule) -> f (Maybe (NonEmpty Schedule)))
-> PolicyDetails
-> f PolicyDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Schedule)
(NonEmpty Schedule)
(NonEmpty Schedule)
(NonEmpty Schedule)
-> Iso
(Maybe (NonEmpty Schedule))
(Maybe (NonEmpty Schedule))
(Maybe (NonEmpty Schedule))
(Maybe (NonEmpty Schedule))
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
(NonEmpty Schedule)
(NonEmpty Schedule)
(NonEmpty Schedule)
(NonEmpty Schedule)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policyDetails_eventSource :: Lens.Lens' PolicyDetails (Prelude.Maybe EventSource)
policyDetails_eventSource :: (Maybe EventSource -> f (Maybe EventSource))
-> PolicyDetails -> f PolicyDetails
policyDetails_eventSource = (PolicyDetails -> Maybe EventSource)
-> (PolicyDetails -> Maybe EventSource -> PolicyDetails)
-> Lens
PolicyDetails PolicyDetails (Maybe EventSource) (Maybe EventSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe EventSource
eventSource :: Maybe EventSource
$sel:eventSource:PolicyDetails' :: PolicyDetails -> Maybe EventSource
eventSource} -> Maybe EventSource
eventSource) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe EventSource
a -> PolicyDetails
s {$sel:eventSource:PolicyDetails' :: Maybe EventSource
eventSource = Maybe EventSource
a} :: PolicyDetails)
policyDetails_resourceTypes :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues))
policyDetails_resourceTypes :: (Maybe (NonEmpty ResourceTypeValues)
-> f (Maybe (NonEmpty ResourceTypeValues)))
-> PolicyDetails -> f PolicyDetails
policyDetails_resourceTypes = (PolicyDetails -> Maybe (NonEmpty ResourceTypeValues))
-> (PolicyDetails
-> Maybe (NonEmpty ResourceTypeValues) -> PolicyDetails)
-> Lens
PolicyDetails
PolicyDetails
(Maybe (NonEmpty ResourceTypeValues))
(Maybe (NonEmpty ResourceTypeValues))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetails' {Maybe (NonEmpty ResourceTypeValues)
resourceTypes :: Maybe (NonEmpty ResourceTypeValues)
$sel:resourceTypes:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty ResourceTypeValues)
resourceTypes} -> Maybe (NonEmpty ResourceTypeValues)
resourceTypes) (\s :: PolicyDetails
s@PolicyDetails' {} Maybe (NonEmpty ResourceTypeValues)
a -> PolicyDetails
s {$sel:resourceTypes:PolicyDetails' :: Maybe (NonEmpty ResourceTypeValues)
resourceTypes = Maybe (NonEmpty ResourceTypeValues)
a} :: PolicyDetails) ((Maybe (NonEmpty ResourceTypeValues)
-> f (Maybe (NonEmpty ResourceTypeValues)))
-> PolicyDetails -> f PolicyDetails)
-> ((Maybe (NonEmpty ResourceTypeValues)
-> f (Maybe (NonEmpty ResourceTypeValues)))
-> Maybe (NonEmpty ResourceTypeValues)
-> f (Maybe (NonEmpty ResourceTypeValues)))
-> (Maybe (NonEmpty ResourceTypeValues)
-> f (Maybe (NonEmpty ResourceTypeValues)))
-> PolicyDetails
-> f PolicyDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ResourceTypeValues)
(NonEmpty ResourceTypeValues)
(NonEmpty ResourceTypeValues)
(NonEmpty ResourceTypeValues)
-> Iso
(Maybe (NonEmpty ResourceTypeValues))
(Maybe (NonEmpty ResourceTypeValues))
(Maybe (NonEmpty ResourceTypeValues))
(Maybe (NonEmpty ResourceTypeValues))
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
(NonEmpty ResourceTypeValues)
(NonEmpty ResourceTypeValues)
(NonEmpty ResourceTypeValues)
(NonEmpty ResourceTypeValues)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON PolicyDetails where
parseJSON :: Value -> Parser PolicyDetails
parseJSON =
String
-> (Object -> Parser PolicyDetails)
-> Value
-> Parser PolicyDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PolicyDetails"
( \Object
x ->
Maybe (NonEmpty Action)
-> Maybe (NonEmpty Tag)
-> Maybe PolicyTypeValues
-> Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails
PolicyDetails'
(Maybe (NonEmpty Action)
-> Maybe (NonEmpty Tag)
-> Maybe PolicyTypeValues
-> Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
-> Parser (Maybe (NonEmpty Action))
-> Parser
(Maybe (NonEmpty Tag)
-> Maybe PolicyTypeValues
-> Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Action))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Actions")
Parser
(Maybe (NonEmpty Tag)
-> Maybe PolicyTypeValues
-> Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
-> Parser (Maybe (NonEmpty Tag))
-> Parser
(Maybe PolicyTypeValues
-> Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetTags")
Parser
(Maybe PolicyTypeValues
-> Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
-> Parser (Maybe PolicyTypeValues)
-> Parser
(Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PolicyTypeValues)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PolicyType")
Parser
(Maybe (NonEmpty ResourceLocationValues)
-> Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
-> Parser (Maybe (NonEmpty ResourceLocationValues))
-> Parser
(Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty ResourceLocationValues))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceLocations")
Parser
(Maybe Parameters
-> Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
-> Parser (Maybe Parameters)
-> Parser
(Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Parameters)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Parameters")
Parser
(Maybe (NonEmpty Schedule)
-> Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues)
-> PolicyDetails)
-> Parser (Maybe (NonEmpty Schedule))
-> Parser
(Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues) -> PolicyDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Schedule))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Schedules")
Parser
(Maybe EventSource
-> Maybe (NonEmpty ResourceTypeValues) -> PolicyDetails)
-> Parser (Maybe EventSource)
-> Parser (Maybe (NonEmpty ResourceTypeValues) -> PolicyDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EventSource")
Parser (Maybe (NonEmpty ResourceTypeValues) -> PolicyDetails)
-> Parser (Maybe (NonEmpty ResourceTypeValues))
-> Parser PolicyDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty ResourceTypeValues))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceTypes")
)
instance Prelude.Hashable PolicyDetails
instance Prelude.NFData PolicyDetails
instance Core.ToJSON PolicyDetails where
toJSON :: PolicyDetails -> Value
toJSON PolicyDetails' {Maybe (NonEmpty ResourceLocationValues)
Maybe (NonEmpty ResourceTypeValues)
Maybe (NonEmpty Action)
Maybe (NonEmpty Tag)
Maybe (NonEmpty Schedule)
Maybe EventSource
Maybe Parameters
Maybe PolicyTypeValues
resourceTypes :: Maybe (NonEmpty ResourceTypeValues)
eventSource :: Maybe EventSource
schedules :: Maybe (NonEmpty Schedule)
parameters :: Maybe Parameters
resourceLocations :: Maybe (NonEmpty ResourceLocationValues)
policyType :: Maybe PolicyTypeValues
targetTags :: Maybe (NonEmpty Tag)
actions :: Maybe (NonEmpty Action)
$sel:resourceTypes:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty ResourceTypeValues)
$sel:eventSource:PolicyDetails' :: PolicyDetails -> Maybe EventSource
$sel:schedules:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty Schedule)
$sel:parameters:PolicyDetails' :: PolicyDetails -> Maybe Parameters
$sel:resourceLocations:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty ResourceLocationValues)
$sel:policyType:PolicyDetails' :: PolicyDetails -> Maybe PolicyTypeValues
$sel:targetTags:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty Tag)
$sel:actions:PolicyDetails' :: PolicyDetails -> Maybe (NonEmpty Action)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Actions" Text -> NonEmpty Action -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Action -> Pair) -> Maybe (NonEmpty Action) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Action)
actions,
(Text
"TargetTags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
targetTags,
(Text
"PolicyType" Text -> PolicyTypeValues -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PolicyTypeValues -> Pair) -> Maybe PolicyTypeValues -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PolicyTypeValues
policyType,
(Text
"ResourceLocations" Text -> NonEmpty ResourceLocationValues -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty ResourceLocationValues -> Pair)
-> Maybe (NonEmpty ResourceLocationValues) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ResourceLocationValues)
resourceLocations,
(Text
"Parameters" Text -> Parameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Parameters -> Pair) -> Maybe Parameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Parameters
parameters,
(Text
"Schedules" Text -> NonEmpty Schedule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Schedule -> Pair)
-> Maybe (NonEmpty Schedule) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Schedule)
schedules,
(Text
"EventSource" Text -> EventSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EventSource -> Pair) -> Maybe EventSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EventSource
eventSource,
(Text
"ResourceTypes" Text -> NonEmpty ResourceTypeValues -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty ResourceTypeValues -> Pair)
-> Maybe (NonEmpty ResourceTypeValues) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ResourceTypeValues)
resourceTypes
]
)