{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSM.Types.MaintenanceWindowTarget
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The target registered with the maintenance window.
--
-- /See:/ 'newMaintenanceWindowTarget' smart constructor.
data MaintenanceWindowTarget = MaintenanceWindowTarget'
  { -- | The type of target that is being registered with the maintenance window.
    MaintenanceWindowTarget -> Maybe MaintenanceWindowResourceType
resourceType :: Prelude.Maybe MaintenanceWindowResourceType,
    -- | A user-provided value that will be included in any Amazon CloudWatch
    -- Events events that are raised while running tasks for these targets in
    -- this maintenance window.
    MaintenanceWindowTarget -> Maybe (Sensitive Text)
ownerInformation :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The ID of the target.
    MaintenanceWindowTarget -> Maybe Text
windowTargetId :: Prelude.Maybe Prelude.Text,
    -- | The name for the maintenance window target.
    MaintenanceWindowTarget -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The targets, either instances or tags.
    --
    -- Specify instances using the following format:
    --
    -- @Key=instanceids,Values=\<instanceid1>,\<instanceid2>@
    --
    -- Tags are specified using the following format:
    --
    -- @Key=\<tag name>,Values=\<tag value>@.
    MaintenanceWindowTarget -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | A description for the target.
    MaintenanceWindowTarget -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The ID of the maintenance window to register the target with.
    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)

-- |
-- Create a value of 'MaintenanceWindowTarget' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'resourceType', 'maintenanceWindowTarget_resourceType' - The type of target that is being registered with the maintenance window.
--
-- 'ownerInformation', 'maintenanceWindowTarget_ownerInformation' - A user-provided value that will be included in any Amazon CloudWatch
-- Events events that are raised while running tasks for these targets in
-- this maintenance window.
--
-- 'windowTargetId', 'maintenanceWindowTarget_windowTargetId' - The ID of the target.
--
-- 'name', 'maintenanceWindowTarget_name' - The name for the maintenance window target.
--
-- 'targets', 'maintenanceWindowTarget_targets' - The targets, either instances or tags.
--
-- Specify instances using the following format:
--
-- @Key=instanceids,Values=\<instanceid1>,\<instanceid2>@
--
-- Tags are specified using the following format:
--
-- @Key=\<tag name>,Values=\<tag value>@.
--
-- 'description', 'maintenanceWindowTarget_description' - A description for the target.
--
-- 'windowId', 'maintenanceWindowTarget_windowId' - The ID of the maintenance window to register the target with.
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
    }

-- | The type of target that is being registered with the maintenance window.
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)

-- | A user-provided value that will be included in any Amazon CloudWatch
-- Events events that are raised while running tasks for these targets in
-- this maintenance window.
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

-- | The ID of the target.
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)

-- | The name for the maintenance window target.
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)

-- | The targets, either instances or tags.
--
-- Specify instances using the following format:
--
-- @Key=instanceids,Values=\<instanceid1>,\<instanceid2>@
--
-- Tags are specified using the following format:
--
-- @Key=\<tag name>,Values=\<tag value>@.
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

-- | A description for the target.
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

-- | The ID of the maintenance window to register the target with.
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