{-# 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.SSM.Types.MaintenanceWindowTarget where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.MaintenanceWindowResourceType
import Amazonka.SSM.Types.Target
data MaintenanceWindowTarget = MaintenanceWindowTarget'
{
MaintenanceWindowTarget -> Maybe MaintenanceWindowResourceType
resourceType :: Prelude.Maybe MaintenanceWindowResourceType,
MaintenanceWindowTarget -> Maybe (Sensitive Text)
ownerInformation :: Prelude.Maybe (Core.Sensitive Prelude.Text),
MaintenanceWindowTarget -> Maybe Text
windowTargetId :: Prelude.Maybe Prelude.Text,
MaintenanceWindowTarget -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
MaintenanceWindowTarget -> Maybe [Target]
targets :: Prelude.Maybe [Target],
MaintenanceWindowTarget -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
MaintenanceWindowTarget -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text
}
deriving (MaintenanceWindowTarget -> MaintenanceWindowTarget -> Bool
(MaintenanceWindowTarget -> MaintenanceWindowTarget -> Bool)
-> (MaintenanceWindowTarget -> MaintenanceWindowTarget -> Bool)
-> Eq MaintenanceWindowTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceWindowTarget -> MaintenanceWindowTarget -> Bool
$c/= :: MaintenanceWindowTarget -> MaintenanceWindowTarget -> Bool
== :: MaintenanceWindowTarget -> MaintenanceWindowTarget -> Bool
$c== :: MaintenanceWindowTarget -> MaintenanceWindowTarget -> Bool
Prelude.Eq, Int -> MaintenanceWindowTarget -> ShowS
[MaintenanceWindowTarget] -> ShowS
MaintenanceWindowTarget -> String
(Int -> MaintenanceWindowTarget -> ShowS)
-> (MaintenanceWindowTarget -> String)
-> ([MaintenanceWindowTarget] -> ShowS)
-> Show MaintenanceWindowTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceWindowTarget] -> ShowS
$cshowList :: [MaintenanceWindowTarget] -> ShowS
show :: MaintenanceWindowTarget -> String
$cshow :: MaintenanceWindowTarget -> String
showsPrec :: Int -> MaintenanceWindowTarget -> ShowS
$cshowsPrec :: Int -> MaintenanceWindowTarget -> ShowS
Prelude.Show, (forall x.
MaintenanceWindowTarget -> Rep MaintenanceWindowTarget x)
-> (forall x.
Rep MaintenanceWindowTarget x -> MaintenanceWindowTarget)
-> Generic MaintenanceWindowTarget
forall x. Rep MaintenanceWindowTarget x -> MaintenanceWindowTarget
forall x. MaintenanceWindowTarget -> Rep MaintenanceWindowTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MaintenanceWindowTarget x -> MaintenanceWindowTarget
$cfrom :: forall x. MaintenanceWindowTarget -> Rep MaintenanceWindowTarget x
Prelude.Generic)
newMaintenanceWindowTarget ::
MaintenanceWindowTarget
newMaintenanceWindowTarget :: MaintenanceWindowTarget
newMaintenanceWindowTarget =
MaintenanceWindowTarget' :: Maybe MaintenanceWindowResourceType
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget
MaintenanceWindowTarget'
{ $sel:resourceType:MaintenanceWindowTarget' :: Maybe MaintenanceWindowResourceType
resourceType =
Maybe MaintenanceWindowResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:ownerInformation:MaintenanceWindowTarget' :: Maybe (Sensitive Text)
ownerInformation = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:windowTargetId:MaintenanceWindowTarget' :: Maybe Text
windowTargetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:MaintenanceWindowTarget' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targets:MaintenanceWindowTarget' :: Maybe [Target]
targets = Maybe [Target]
forall a. Maybe a
Prelude.Nothing,
$sel:description:MaintenanceWindowTarget' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:windowId:MaintenanceWindowTarget' :: Maybe Text
windowId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
maintenanceWindowTarget_resourceType :: Lens.Lens' MaintenanceWindowTarget (Prelude.Maybe MaintenanceWindowResourceType)
maintenanceWindowTarget_resourceType :: (Maybe MaintenanceWindowResourceType
-> f (Maybe MaintenanceWindowResourceType))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget
maintenanceWindowTarget_resourceType = (MaintenanceWindowTarget -> Maybe MaintenanceWindowResourceType)
-> (MaintenanceWindowTarget
-> Maybe MaintenanceWindowResourceType -> MaintenanceWindowTarget)
-> Lens
MaintenanceWindowTarget
MaintenanceWindowTarget
(Maybe MaintenanceWindowResourceType)
(Maybe MaintenanceWindowResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTarget' {Maybe MaintenanceWindowResourceType
resourceType :: Maybe MaintenanceWindowResourceType
$sel:resourceType:MaintenanceWindowTarget' :: MaintenanceWindowTarget -> Maybe MaintenanceWindowResourceType
resourceType} -> Maybe MaintenanceWindowResourceType
resourceType) (\s :: MaintenanceWindowTarget
s@MaintenanceWindowTarget' {} Maybe MaintenanceWindowResourceType
a -> MaintenanceWindowTarget
s {$sel:resourceType:MaintenanceWindowTarget' :: Maybe MaintenanceWindowResourceType
resourceType = Maybe MaintenanceWindowResourceType
a} :: MaintenanceWindowTarget)
maintenanceWindowTarget_ownerInformation :: Lens.Lens' MaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
maintenanceWindowTarget_ownerInformation :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget
maintenanceWindowTarget_ownerInformation = (MaintenanceWindowTarget -> Maybe (Sensitive Text))
-> (MaintenanceWindowTarget
-> Maybe (Sensitive Text) -> MaintenanceWindowTarget)
-> Lens
MaintenanceWindowTarget
MaintenanceWindowTarget
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTarget' {Maybe (Sensitive Text)
ownerInformation :: Maybe (Sensitive Text)
$sel:ownerInformation:MaintenanceWindowTarget' :: MaintenanceWindowTarget -> Maybe (Sensitive Text)
ownerInformation} -> Maybe (Sensitive Text)
ownerInformation) (\s :: MaintenanceWindowTarget
s@MaintenanceWindowTarget' {} Maybe (Sensitive Text)
a -> MaintenanceWindowTarget
s {$sel:ownerInformation:MaintenanceWindowTarget' :: Maybe (Sensitive Text)
ownerInformation = Maybe (Sensitive Text)
a} :: MaintenanceWindowTarget) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowTarget
-> f MaintenanceWindowTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
maintenanceWindowTarget_windowTargetId :: Lens.Lens' MaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
maintenanceWindowTarget_windowTargetId :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget
maintenanceWindowTarget_windowTargetId = (MaintenanceWindowTarget -> Maybe Text)
-> (MaintenanceWindowTarget
-> Maybe Text -> MaintenanceWindowTarget)
-> Lens
MaintenanceWindowTarget
MaintenanceWindowTarget
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTarget' {Maybe Text
windowTargetId :: Maybe Text
$sel:windowTargetId:MaintenanceWindowTarget' :: MaintenanceWindowTarget -> Maybe Text
windowTargetId} -> Maybe Text
windowTargetId) (\s :: MaintenanceWindowTarget
s@MaintenanceWindowTarget' {} Maybe Text
a -> MaintenanceWindowTarget
s {$sel:windowTargetId:MaintenanceWindowTarget' :: Maybe Text
windowTargetId = Maybe Text
a} :: MaintenanceWindowTarget)
maintenanceWindowTarget_name :: Lens.Lens' MaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
maintenanceWindowTarget_name :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget
maintenanceWindowTarget_name = (MaintenanceWindowTarget -> Maybe Text)
-> (MaintenanceWindowTarget
-> Maybe Text -> MaintenanceWindowTarget)
-> Lens
MaintenanceWindowTarget
MaintenanceWindowTarget
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTarget' {Maybe Text
name :: Maybe Text
$sel:name:MaintenanceWindowTarget' :: MaintenanceWindowTarget -> Maybe Text
name} -> Maybe Text
name) (\s :: MaintenanceWindowTarget
s@MaintenanceWindowTarget' {} Maybe Text
a -> MaintenanceWindowTarget
s {$sel:name:MaintenanceWindowTarget' :: Maybe Text
name = Maybe Text
a} :: MaintenanceWindowTarget)
maintenanceWindowTarget_targets :: Lens.Lens' MaintenanceWindowTarget (Prelude.Maybe [Target])
maintenanceWindowTarget_targets :: (Maybe [Target] -> f (Maybe [Target]))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget
maintenanceWindowTarget_targets = (MaintenanceWindowTarget -> Maybe [Target])
-> (MaintenanceWindowTarget
-> Maybe [Target] -> MaintenanceWindowTarget)
-> Lens
MaintenanceWindowTarget
MaintenanceWindowTarget
(Maybe [Target])
(Maybe [Target])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTarget' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:MaintenanceWindowTarget' :: MaintenanceWindowTarget -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: MaintenanceWindowTarget
s@MaintenanceWindowTarget' {} Maybe [Target]
a -> MaintenanceWindowTarget
s {$sel:targets:MaintenanceWindowTarget' :: Maybe [Target]
targets = Maybe [Target]
a} :: MaintenanceWindowTarget) ((Maybe [Target] -> f (Maybe [Target]))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget)
-> ((Maybe [Target] -> f (Maybe [Target]))
-> Maybe [Target] -> f (Maybe [Target]))
-> (Maybe [Target] -> f (Maybe [Target]))
-> MaintenanceWindowTarget
-> f MaintenanceWindowTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Target] [Target] [Target] [Target]
-> Iso
(Maybe [Target]) (Maybe [Target]) (Maybe [Target]) (Maybe [Target])
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 [Target] [Target] [Target] [Target]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
maintenanceWindowTarget_description :: Lens.Lens' MaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
maintenanceWindowTarget_description :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget
maintenanceWindowTarget_description = (MaintenanceWindowTarget -> Maybe (Sensitive Text))
-> (MaintenanceWindowTarget
-> Maybe (Sensitive Text) -> MaintenanceWindowTarget)
-> Lens
MaintenanceWindowTarget
MaintenanceWindowTarget
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTarget' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:MaintenanceWindowTarget' :: MaintenanceWindowTarget -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: MaintenanceWindowTarget
s@MaintenanceWindowTarget' {} Maybe (Sensitive Text)
a -> MaintenanceWindowTarget
s {$sel:description:MaintenanceWindowTarget' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: MaintenanceWindowTarget) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowTarget
-> f MaintenanceWindowTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
maintenanceWindowTarget_windowId :: Lens.Lens' MaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
maintenanceWindowTarget_windowId :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowTarget -> f MaintenanceWindowTarget
maintenanceWindowTarget_windowId = (MaintenanceWindowTarget -> Maybe Text)
-> (MaintenanceWindowTarget
-> Maybe Text -> MaintenanceWindowTarget)
-> Lens
MaintenanceWindowTarget
MaintenanceWindowTarget
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTarget' {Maybe Text
windowId :: Maybe Text
$sel:windowId:MaintenanceWindowTarget' :: MaintenanceWindowTarget -> Maybe Text
windowId} -> Maybe Text
windowId) (\s :: MaintenanceWindowTarget
s@MaintenanceWindowTarget' {} Maybe Text
a -> MaintenanceWindowTarget
s {$sel:windowId:MaintenanceWindowTarget' :: Maybe Text
windowId = Maybe Text
a} :: MaintenanceWindowTarget)
instance Core.FromJSON MaintenanceWindowTarget where
parseJSON :: Value -> Parser MaintenanceWindowTarget
parseJSON =
String
-> (Object -> Parser MaintenanceWindowTarget)
-> Value
-> Parser MaintenanceWindowTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MaintenanceWindowTarget"
( \Object
x ->
Maybe MaintenanceWindowResourceType
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget
MaintenanceWindowTarget'
(Maybe MaintenanceWindowResourceType
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget)
-> Parser (Maybe MaintenanceWindowResourceType)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MaintenanceWindowResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceType")
Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OwnerInformation")
Parser
(Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget)
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
"WindowTargetId")
Parser
(Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> MaintenanceWindowTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe [Target]
-> Maybe (Sensitive Text) -> Maybe Text -> MaintenanceWindowTarget)
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
"Name")
Parser
(Maybe [Target]
-> Maybe (Sensitive Text) -> Maybe Text -> MaintenanceWindowTarget)
-> Parser (Maybe [Target])
-> Parser
(Maybe (Sensitive Text) -> Maybe Text -> MaintenanceWindowTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Target]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Targets" Parser (Maybe (Maybe [Target]))
-> Maybe [Target] -> Parser (Maybe [Target])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Target]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe (Sensitive Text) -> Maybe Text -> MaintenanceWindowTarget)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> MaintenanceWindowTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
Parser (Maybe Text -> MaintenanceWindowTarget)
-> Parser (Maybe Text) -> Parser MaintenanceWindowTarget
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
"WindowId")
)
instance Prelude.Hashable MaintenanceWindowTarget
instance Prelude.NFData MaintenanceWindowTarget