{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateMaintenanceWindowTarget
-- 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)
--
-- Modifies the target of an existing maintenance window. You can change
-- the following:
--
-- -   Name
--
-- -   Description
--
-- -   Owner
--
-- -   IDs for an ID target
--
-- -   Tags for a Tag target
--
-- -   From any supported tag type to another. The three supported tag
--     types are ID target, Tag target, and resource group. For more
--     information, see Target.
--
-- If a parameter is null, then the corresponding field isn\'t modified.
module Amazonka.SSM.UpdateMaintenanceWindowTarget
  ( -- * Creating a Request
    UpdateMaintenanceWindowTarget (..),
    newUpdateMaintenanceWindowTarget,

    -- * Request Lenses
    updateMaintenanceWindowTarget_replace,
    updateMaintenanceWindowTarget_ownerInformation,
    updateMaintenanceWindowTarget_name,
    updateMaintenanceWindowTarget_targets,
    updateMaintenanceWindowTarget_description,
    updateMaintenanceWindowTarget_windowId,
    updateMaintenanceWindowTarget_windowTargetId,

    -- * Destructuring the Response
    UpdateMaintenanceWindowTargetResponse (..),
    newUpdateMaintenanceWindowTargetResponse,

    -- * Response Lenses
    updateMaintenanceWindowTargetResponse_ownerInformation,
    updateMaintenanceWindowTargetResponse_windowTargetId,
    updateMaintenanceWindowTargetResponse_name,
    updateMaintenanceWindowTargetResponse_targets,
    updateMaintenanceWindowTargetResponse_description,
    updateMaintenanceWindowTargetResponse_windowId,
    updateMaintenanceWindowTargetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types

-- | /See:/ 'newUpdateMaintenanceWindowTarget' smart constructor.
data UpdateMaintenanceWindowTarget = UpdateMaintenanceWindowTarget'
  { -- | If @True@, then all fields that are required by the
    -- RegisterTargetWithMaintenanceWindow operation are also required for this
    -- API request. Optional fields that aren\'t specified are set to null.
    UpdateMaintenanceWindowTarget -> Maybe Bool
replace :: Prelude.Maybe Prelude.Bool,
    -- | User-provided value that will be included in any Amazon CloudWatch
    -- Events events raised while running tasks for these targets in this
    -- maintenance window.
    UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
ownerInformation :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | A name for the update.
    UpdateMaintenanceWindowTarget -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The targets to add or replace.
    UpdateMaintenanceWindowTarget -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | An optional description for the update.
    UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The maintenance window ID with which to modify the target.
    UpdateMaintenanceWindowTarget -> Text
windowId :: Prelude.Text,
    -- | The target ID to modify.
    UpdateMaintenanceWindowTarget -> Text
windowTargetId :: Prelude.Text
  }
  deriving (UpdateMaintenanceWindowTarget
-> UpdateMaintenanceWindowTarget -> Bool
(UpdateMaintenanceWindowTarget
 -> UpdateMaintenanceWindowTarget -> Bool)
-> (UpdateMaintenanceWindowTarget
    -> UpdateMaintenanceWindowTarget -> Bool)
-> Eq UpdateMaintenanceWindowTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMaintenanceWindowTarget
-> UpdateMaintenanceWindowTarget -> Bool
$c/= :: UpdateMaintenanceWindowTarget
-> UpdateMaintenanceWindowTarget -> Bool
== :: UpdateMaintenanceWindowTarget
-> UpdateMaintenanceWindowTarget -> Bool
$c== :: UpdateMaintenanceWindowTarget
-> UpdateMaintenanceWindowTarget -> Bool
Prelude.Eq, Int -> UpdateMaintenanceWindowTarget -> ShowS
[UpdateMaintenanceWindowTarget] -> ShowS
UpdateMaintenanceWindowTarget -> String
(Int -> UpdateMaintenanceWindowTarget -> ShowS)
-> (UpdateMaintenanceWindowTarget -> String)
-> ([UpdateMaintenanceWindowTarget] -> ShowS)
-> Show UpdateMaintenanceWindowTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMaintenanceWindowTarget] -> ShowS
$cshowList :: [UpdateMaintenanceWindowTarget] -> ShowS
show :: UpdateMaintenanceWindowTarget -> String
$cshow :: UpdateMaintenanceWindowTarget -> String
showsPrec :: Int -> UpdateMaintenanceWindowTarget -> ShowS
$cshowsPrec :: Int -> UpdateMaintenanceWindowTarget -> ShowS
Prelude.Show, (forall x.
 UpdateMaintenanceWindowTarget
 -> Rep UpdateMaintenanceWindowTarget x)
-> (forall x.
    Rep UpdateMaintenanceWindowTarget x
    -> UpdateMaintenanceWindowTarget)
-> Generic UpdateMaintenanceWindowTarget
forall x.
Rep UpdateMaintenanceWindowTarget x
-> UpdateMaintenanceWindowTarget
forall x.
UpdateMaintenanceWindowTarget
-> Rep UpdateMaintenanceWindowTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateMaintenanceWindowTarget x
-> UpdateMaintenanceWindowTarget
$cfrom :: forall x.
UpdateMaintenanceWindowTarget
-> Rep UpdateMaintenanceWindowTarget x
Prelude.Generic)

-- |
-- Create a value of 'UpdateMaintenanceWindowTarget' 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:
--
-- 'replace', 'updateMaintenanceWindowTarget_replace' - If @True@, then all fields that are required by the
-- RegisterTargetWithMaintenanceWindow operation are also required for this
-- API request. Optional fields that aren\'t specified are set to null.
--
-- 'ownerInformation', 'updateMaintenanceWindowTarget_ownerInformation' - User-provided value that will be included in any Amazon CloudWatch
-- Events events raised while running tasks for these targets in this
-- maintenance window.
--
-- 'name', 'updateMaintenanceWindowTarget_name' - A name for the update.
--
-- 'targets', 'updateMaintenanceWindowTarget_targets' - The targets to add or replace.
--
-- 'description', 'updateMaintenanceWindowTarget_description' - An optional description for the update.
--
-- 'windowId', 'updateMaintenanceWindowTarget_windowId' - The maintenance window ID with which to modify the target.
--
-- 'windowTargetId', 'updateMaintenanceWindowTarget_windowTargetId' - The target ID to modify.
newUpdateMaintenanceWindowTarget ::
  -- | 'windowId'
  Prelude.Text ->
  -- | 'windowTargetId'
  Prelude.Text ->
  UpdateMaintenanceWindowTarget
newUpdateMaintenanceWindowTarget :: Text -> Text -> UpdateMaintenanceWindowTarget
newUpdateMaintenanceWindowTarget
  Text
pWindowId_
  Text
pWindowTargetId_ =
    UpdateMaintenanceWindowTarget' :: Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Text
-> Text
-> UpdateMaintenanceWindowTarget
UpdateMaintenanceWindowTarget'
      { $sel:replace:UpdateMaintenanceWindowTarget' :: Maybe Bool
replace =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:ownerInformation:UpdateMaintenanceWindowTarget' :: Maybe (Sensitive Text)
ownerInformation = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateMaintenanceWindowTarget' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:targets:UpdateMaintenanceWindowTarget' :: Maybe [Target]
targets = Maybe [Target]
forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateMaintenanceWindowTarget' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:windowId:UpdateMaintenanceWindowTarget' :: Text
windowId = Text
pWindowId_,
        $sel:windowTargetId:UpdateMaintenanceWindowTarget' :: Text
windowTargetId = Text
pWindowTargetId_
      }

-- | If @True@, then all fields that are required by the
-- RegisterTargetWithMaintenanceWindow operation are also required for this
-- API request. Optional fields that aren\'t specified are set to null.
updateMaintenanceWindowTarget_replace :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe Prelude.Bool)
updateMaintenanceWindowTarget_replace :: (Maybe Bool -> f (Maybe Bool))
-> UpdateMaintenanceWindowTarget -> f UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget_replace = (UpdateMaintenanceWindowTarget -> Maybe Bool)
-> (UpdateMaintenanceWindowTarget
    -> Maybe Bool -> UpdateMaintenanceWindowTarget)
-> Lens
     UpdateMaintenanceWindowTarget
     UpdateMaintenanceWindowTarget
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTarget' {Maybe Bool
replace :: Maybe Bool
$sel:replace:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Bool
replace} -> Maybe Bool
replace) (\s :: UpdateMaintenanceWindowTarget
s@UpdateMaintenanceWindowTarget' {} Maybe Bool
a -> UpdateMaintenanceWindowTarget
s {$sel:replace:UpdateMaintenanceWindowTarget' :: Maybe Bool
replace = Maybe Bool
a} :: UpdateMaintenanceWindowTarget)

-- | User-provided value that will be included in any Amazon CloudWatch
-- Events events raised while running tasks for these targets in this
-- maintenance window.
updateMaintenanceWindowTarget_ownerInformation :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTarget_ownerInformation :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTarget -> f UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget_ownerInformation = (UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text))
-> (UpdateMaintenanceWindowTarget
    -> Maybe (Sensitive Text) -> UpdateMaintenanceWindowTarget)
-> Lens
     UpdateMaintenanceWindowTarget
     UpdateMaintenanceWindowTarget
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTarget' {Maybe (Sensitive Text)
ownerInformation :: Maybe (Sensitive Text)
$sel:ownerInformation:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
ownerInformation} -> Maybe (Sensitive Text)
ownerInformation) (\s :: UpdateMaintenanceWindowTarget
s@UpdateMaintenanceWindowTarget' {} Maybe (Sensitive Text)
a -> UpdateMaintenanceWindowTarget
s {$sel:ownerInformation:UpdateMaintenanceWindowTarget' :: Maybe (Sensitive Text)
ownerInformation = Maybe (Sensitive Text)
a} :: UpdateMaintenanceWindowTarget) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateMaintenanceWindowTarget
 -> f UpdateMaintenanceWindowTarget)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTarget
-> f UpdateMaintenanceWindowTarget
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

-- | A name for the update.
updateMaintenanceWindowTarget_name :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTarget_name :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTarget -> f UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget_name = (UpdateMaintenanceWindowTarget -> Maybe Text)
-> (UpdateMaintenanceWindowTarget
    -> Maybe Text -> UpdateMaintenanceWindowTarget)
-> Lens
     UpdateMaintenanceWindowTarget
     UpdateMaintenanceWindowTarget
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTarget' {Maybe Text
name :: Maybe Text
$sel:name:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateMaintenanceWindowTarget
s@UpdateMaintenanceWindowTarget' {} Maybe Text
a -> UpdateMaintenanceWindowTarget
s {$sel:name:UpdateMaintenanceWindowTarget' :: Maybe Text
name = Maybe Text
a} :: UpdateMaintenanceWindowTarget)

-- | The targets to add or replace.
updateMaintenanceWindowTarget_targets :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe [Target])
updateMaintenanceWindowTarget_targets :: (Maybe [Target] -> f (Maybe [Target]))
-> UpdateMaintenanceWindowTarget -> f UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget_targets = (UpdateMaintenanceWindowTarget -> Maybe [Target])
-> (UpdateMaintenanceWindowTarget
    -> Maybe [Target] -> UpdateMaintenanceWindowTarget)
-> Lens
     UpdateMaintenanceWindowTarget
     UpdateMaintenanceWindowTarget
     (Maybe [Target])
     (Maybe [Target])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTarget' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: UpdateMaintenanceWindowTarget
s@UpdateMaintenanceWindowTarget' {} Maybe [Target]
a -> UpdateMaintenanceWindowTarget
s {$sel:targets:UpdateMaintenanceWindowTarget' :: Maybe [Target]
targets = Maybe [Target]
a} :: UpdateMaintenanceWindowTarget) ((Maybe [Target] -> f (Maybe [Target]))
 -> UpdateMaintenanceWindowTarget
 -> f UpdateMaintenanceWindowTarget)
-> ((Maybe [Target] -> f (Maybe [Target]))
    -> Maybe [Target] -> f (Maybe [Target]))
-> (Maybe [Target] -> f (Maybe [Target]))
-> UpdateMaintenanceWindowTarget
-> f UpdateMaintenanceWindowTarget
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

-- | An optional description for the update.
updateMaintenanceWindowTarget_description :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTarget_description :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTarget -> f UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget_description = (UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text))
-> (UpdateMaintenanceWindowTarget
    -> Maybe (Sensitive Text) -> UpdateMaintenanceWindowTarget)
-> Lens
     UpdateMaintenanceWindowTarget
     UpdateMaintenanceWindowTarget
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTarget' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateMaintenanceWindowTarget
s@UpdateMaintenanceWindowTarget' {} Maybe (Sensitive Text)
a -> UpdateMaintenanceWindowTarget
s {$sel:description:UpdateMaintenanceWindowTarget' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateMaintenanceWindowTarget) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateMaintenanceWindowTarget
 -> f UpdateMaintenanceWindowTarget)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTarget
-> f UpdateMaintenanceWindowTarget
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 maintenance window ID with which to modify the target.
updateMaintenanceWindowTarget_windowId :: Lens.Lens' UpdateMaintenanceWindowTarget Prelude.Text
updateMaintenanceWindowTarget_windowId :: (Text -> f Text)
-> UpdateMaintenanceWindowTarget -> f UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget_windowId = (UpdateMaintenanceWindowTarget -> Text)
-> (UpdateMaintenanceWindowTarget
    -> Text -> UpdateMaintenanceWindowTarget)
-> Lens
     UpdateMaintenanceWindowTarget
     UpdateMaintenanceWindowTarget
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTarget' {Text
windowId :: Text
$sel:windowId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
windowId} -> Text
windowId) (\s :: UpdateMaintenanceWindowTarget
s@UpdateMaintenanceWindowTarget' {} Text
a -> UpdateMaintenanceWindowTarget
s {$sel:windowId:UpdateMaintenanceWindowTarget' :: Text
windowId = Text
a} :: UpdateMaintenanceWindowTarget)

-- | The target ID to modify.
updateMaintenanceWindowTarget_windowTargetId :: Lens.Lens' UpdateMaintenanceWindowTarget Prelude.Text
updateMaintenanceWindowTarget_windowTargetId :: (Text -> f Text)
-> UpdateMaintenanceWindowTarget -> f UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget_windowTargetId = (UpdateMaintenanceWindowTarget -> Text)
-> (UpdateMaintenanceWindowTarget
    -> Text -> UpdateMaintenanceWindowTarget)
-> Lens
     UpdateMaintenanceWindowTarget
     UpdateMaintenanceWindowTarget
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTarget' {Text
windowTargetId :: Text
$sel:windowTargetId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
windowTargetId} -> Text
windowTargetId) (\s :: UpdateMaintenanceWindowTarget
s@UpdateMaintenanceWindowTarget' {} Text
a -> UpdateMaintenanceWindowTarget
s {$sel:windowTargetId:UpdateMaintenanceWindowTarget' :: Text
windowTargetId = Text
a} :: UpdateMaintenanceWindowTarget)

instance
  Core.AWSRequest
    UpdateMaintenanceWindowTarget
  where
  type
    AWSResponse UpdateMaintenanceWindowTarget =
      UpdateMaintenanceWindowTargetResponse
  request :: UpdateMaintenanceWindowTarget
-> Request UpdateMaintenanceWindowTarget
request = Service
-> UpdateMaintenanceWindowTarget
-> Request UpdateMaintenanceWindowTarget
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateMaintenanceWindowTarget
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateMaintenanceWindowTarget)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateMaintenanceWindowTarget))
-> Logger
-> Service
-> Proxy UpdateMaintenanceWindowTarget
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateMaintenanceWindowTarget)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> Int
-> UpdateMaintenanceWindowTargetResponse
UpdateMaintenanceWindowTargetResponse'
            (Maybe (Sensitive Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Target]
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> Int
 -> UpdateMaintenanceWindowTargetResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [Target]
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowTargetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"OwnerInformation")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [Target]
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowTargetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Target]
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowTargetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"WindowTargetId")
            Either
  String
  (Maybe Text
   -> Maybe [Target]
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowTargetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Target]
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowTargetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
            Either
  String
  (Maybe [Target]
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowTargetResponse)
-> Either String (Maybe [Target])
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe Text -> Int -> UpdateMaintenanceWindowTargetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Target]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Targets" Either String (Maybe (Maybe [Target]))
-> Maybe [Target] -> Either String (Maybe [Target])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Target]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe Text -> Int -> UpdateMaintenanceWindowTargetResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String (Maybe Text -> Int -> UpdateMaintenanceWindowTargetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either
  String (Maybe Text -> Int -> UpdateMaintenanceWindowTargetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateMaintenanceWindowTargetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"WindowId")
            Either String (Int -> UpdateMaintenanceWindowTargetResponse)
-> Either String Int
-> Either String UpdateMaintenanceWindowTargetResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateMaintenanceWindowTarget

instance Prelude.NFData UpdateMaintenanceWindowTarget

instance Core.ToHeaders UpdateMaintenanceWindowTarget where
  toHeaders :: UpdateMaintenanceWindowTarget -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateMaintenanceWindowTarget -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonSSM.UpdateMaintenanceWindowTarget" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateMaintenanceWindowTarget where
  toJSON :: UpdateMaintenanceWindowTarget -> Value
toJSON UpdateMaintenanceWindowTarget' {Maybe Bool
Maybe [Target]
Maybe Text
Maybe (Sensitive Text)
Text
windowTargetId :: Text
windowId :: Text
description :: Maybe (Sensitive Text)
targets :: Maybe [Target]
name :: Maybe Text
ownerInformation :: Maybe (Sensitive Text)
replace :: Maybe Bool
$sel:windowTargetId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
$sel:windowId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
$sel:description:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
$sel:targets:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe [Target]
$sel:name:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Text
$sel:ownerInformation:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
$sel:replace:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Replace" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
replace,
            (Text
"OwnerInformation" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
ownerInformation,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"Targets" Text -> [Target] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Target] -> Pair) -> Maybe [Target] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Target]
targets,
            (Text
"Description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WindowId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
windowId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"WindowTargetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
windowTargetId)
          ]
      )

instance Core.ToPath UpdateMaintenanceWindowTarget where
  toPath :: UpdateMaintenanceWindowTarget -> ByteString
toPath = ByteString -> UpdateMaintenanceWindowTarget -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery UpdateMaintenanceWindowTarget where
  toQuery :: UpdateMaintenanceWindowTarget -> QueryString
toQuery = QueryString -> UpdateMaintenanceWindowTarget -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateMaintenanceWindowTargetResponse' smart constructor.
data UpdateMaintenanceWindowTargetResponse = UpdateMaintenanceWindowTargetResponse'
  { -- | The updated owner.
    UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text)
ownerInformation :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The target ID specified in the update request.
    UpdateMaintenanceWindowTargetResponse -> Maybe Text
windowTargetId :: Prelude.Maybe Prelude.Text,
    -- | The updated name.
    UpdateMaintenanceWindowTargetResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The updated targets.
    UpdateMaintenanceWindowTargetResponse -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | The updated description.
    UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The maintenance window ID specified in the update request.
    UpdateMaintenanceWindowTargetResponse -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateMaintenanceWindowTargetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateMaintenanceWindowTargetResponse
-> UpdateMaintenanceWindowTargetResponse -> Bool
(UpdateMaintenanceWindowTargetResponse
 -> UpdateMaintenanceWindowTargetResponse -> Bool)
-> (UpdateMaintenanceWindowTargetResponse
    -> UpdateMaintenanceWindowTargetResponse -> Bool)
-> Eq UpdateMaintenanceWindowTargetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMaintenanceWindowTargetResponse
-> UpdateMaintenanceWindowTargetResponse -> Bool
$c/= :: UpdateMaintenanceWindowTargetResponse
-> UpdateMaintenanceWindowTargetResponse -> Bool
== :: UpdateMaintenanceWindowTargetResponse
-> UpdateMaintenanceWindowTargetResponse -> Bool
$c== :: UpdateMaintenanceWindowTargetResponse
-> UpdateMaintenanceWindowTargetResponse -> Bool
Prelude.Eq, Int -> UpdateMaintenanceWindowTargetResponse -> ShowS
[UpdateMaintenanceWindowTargetResponse] -> ShowS
UpdateMaintenanceWindowTargetResponse -> String
(Int -> UpdateMaintenanceWindowTargetResponse -> ShowS)
-> (UpdateMaintenanceWindowTargetResponse -> String)
-> ([UpdateMaintenanceWindowTargetResponse] -> ShowS)
-> Show UpdateMaintenanceWindowTargetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMaintenanceWindowTargetResponse] -> ShowS
$cshowList :: [UpdateMaintenanceWindowTargetResponse] -> ShowS
show :: UpdateMaintenanceWindowTargetResponse -> String
$cshow :: UpdateMaintenanceWindowTargetResponse -> String
showsPrec :: Int -> UpdateMaintenanceWindowTargetResponse -> ShowS
$cshowsPrec :: Int -> UpdateMaintenanceWindowTargetResponse -> ShowS
Prelude.Show, (forall x.
 UpdateMaintenanceWindowTargetResponse
 -> Rep UpdateMaintenanceWindowTargetResponse x)
-> (forall x.
    Rep UpdateMaintenanceWindowTargetResponse x
    -> UpdateMaintenanceWindowTargetResponse)
-> Generic UpdateMaintenanceWindowTargetResponse
forall x.
Rep UpdateMaintenanceWindowTargetResponse x
-> UpdateMaintenanceWindowTargetResponse
forall x.
UpdateMaintenanceWindowTargetResponse
-> Rep UpdateMaintenanceWindowTargetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateMaintenanceWindowTargetResponse x
-> UpdateMaintenanceWindowTargetResponse
$cfrom :: forall x.
UpdateMaintenanceWindowTargetResponse
-> Rep UpdateMaintenanceWindowTargetResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateMaintenanceWindowTargetResponse' 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:
--
-- 'ownerInformation', 'updateMaintenanceWindowTargetResponse_ownerInformation' - The updated owner.
--
-- 'windowTargetId', 'updateMaintenanceWindowTargetResponse_windowTargetId' - The target ID specified in the update request.
--
-- 'name', 'updateMaintenanceWindowTargetResponse_name' - The updated name.
--
-- 'targets', 'updateMaintenanceWindowTargetResponse_targets' - The updated targets.
--
-- 'description', 'updateMaintenanceWindowTargetResponse_description' - The updated description.
--
-- 'windowId', 'updateMaintenanceWindowTargetResponse_windowId' - The maintenance window ID specified in the update request.
--
-- 'httpStatus', 'updateMaintenanceWindowTargetResponse_httpStatus' - The response's http status code.
newUpdateMaintenanceWindowTargetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateMaintenanceWindowTargetResponse
newUpdateMaintenanceWindowTargetResponse :: Int -> UpdateMaintenanceWindowTargetResponse
newUpdateMaintenanceWindowTargetResponse Int
pHttpStatus_ =
  UpdateMaintenanceWindowTargetResponse' :: Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Target]
-> Maybe (Sensitive Text)
-> Maybe Text
-> Int
-> UpdateMaintenanceWindowTargetResponse
UpdateMaintenanceWindowTargetResponse'
    { $sel:ownerInformation:UpdateMaintenanceWindowTargetResponse' :: Maybe (Sensitive Text)
ownerInformation =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:windowTargetId:UpdateMaintenanceWindowTargetResponse' :: Maybe Text
windowTargetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateMaintenanceWindowTargetResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:UpdateMaintenanceWindowTargetResponse' :: Maybe [Target]
targets = Maybe [Target]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateMaintenanceWindowTargetResponse' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:windowId:UpdateMaintenanceWindowTargetResponse' :: Maybe Text
windowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateMaintenanceWindowTargetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The updated owner.
updateMaintenanceWindowTargetResponse_ownerInformation :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_ownerInformation :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse_ownerInformation = (UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text))
-> (UpdateMaintenanceWindowTargetResponse
    -> Maybe (Sensitive Text) -> UpdateMaintenanceWindowTargetResponse)
-> Lens
     UpdateMaintenanceWindowTargetResponse
     UpdateMaintenanceWindowTargetResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTargetResponse' {Maybe (Sensitive Text)
ownerInformation :: Maybe (Sensitive Text)
$sel:ownerInformation:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text)
ownerInformation} -> Maybe (Sensitive Text)
ownerInformation) (\s :: UpdateMaintenanceWindowTargetResponse
s@UpdateMaintenanceWindowTargetResponse' {} Maybe (Sensitive Text)
a -> UpdateMaintenanceWindowTargetResponse
s {$sel:ownerInformation:UpdateMaintenanceWindowTargetResponse' :: Maybe (Sensitive Text)
ownerInformation = Maybe (Sensitive Text)
a} :: UpdateMaintenanceWindowTargetResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateMaintenanceWindowTargetResponse
 -> f UpdateMaintenanceWindowTargetResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
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 target ID specified in the update request.
updateMaintenanceWindowTargetResponse_windowTargetId :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_windowTargetId :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse_windowTargetId = (UpdateMaintenanceWindowTargetResponse -> Maybe Text)
-> (UpdateMaintenanceWindowTargetResponse
    -> Maybe Text -> UpdateMaintenanceWindowTargetResponse)
-> Lens
     UpdateMaintenanceWindowTargetResponse
     UpdateMaintenanceWindowTargetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTargetResponse' {Maybe Text
windowTargetId :: Maybe Text
$sel:windowTargetId:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe Text
windowTargetId} -> Maybe Text
windowTargetId) (\s :: UpdateMaintenanceWindowTargetResponse
s@UpdateMaintenanceWindowTargetResponse' {} Maybe Text
a -> UpdateMaintenanceWindowTargetResponse
s {$sel:windowTargetId:UpdateMaintenanceWindowTargetResponse' :: Maybe Text
windowTargetId = Maybe Text
a} :: UpdateMaintenanceWindowTargetResponse)

-- | The updated name.
updateMaintenanceWindowTargetResponse_name :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse_name = (UpdateMaintenanceWindowTargetResponse -> Maybe Text)
-> (UpdateMaintenanceWindowTargetResponse
    -> Maybe Text -> UpdateMaintenanceWindowTargetResponse)
-> Lens
     UpdateMaintenanceWindowTargetResponse
     UpdateMaintenanceWindowTargetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTargetResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateMaintenanceWindowTargetResponse
s@UpdateMaintenanceWindowTargetResponse' {} Maybe Text
a -> UpdateMaintenanceWindowTargetResponse
s {$sel:name:UpdateMaintenanceWindowTargetResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateMaintenanceWindowTargetResponse)

-- | The updated targets.
updateMaintenanceWindowTargetResponse_targets :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe [Target])
updateMaintenanceWindowTargetResponse_targets :: (Maybe [Target] -> f (Maybe [Target]))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse_targets = (UpdateMaintenanceWindowTargetResponse -> Maybe [Target])
-> (UpdateMaintenanceWindowTargetResponse
    -> Maybe [Target] -> UpdateMaintenanceWindowTargetResponse)
-> Lens
     UpdateMaintenanceWindowTargetResponse
     UpdateMaintenanceWindowTargetResponse
     (Maybe [Target])
     (Maybe [Target])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTargetResponse' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: UpdateMaintenanceWindowTargetResponse
s@UpdateMaintenanceWindowTargetResponse' {} Maybe [Target]
a -> UpdateMaintenanceWindowTargetResponse
s {$sel:targets:UpdateMaintenanceWindowTargetResponse' :: Maybe [Target]
targets = Maybe [Target]
a} :: UpdateMaintenanceWindowTargetResponse) ((Maybe [Target] -> f (Maybe [Target]))
 -> UpdateMaintenanceWindowTargetResponse
 -> f UpdateMaintenanceWindowTargetResponse)
-> ((Maybe [Target] -> f (Maybe [Target]))
    -> Maybe [Target] -> f (Maybe [Target]))
-> (Maybe [Target] -> f (Maybe [Target]))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
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

-- | The updated description.
updateMaintenanceWindowTargetResponse_description :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_description :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse_description = (UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text))
-> (UpdateMaintenanceWindowTargetResponse
    -> Maybe (Sensitive Text) -> UpdateMaintenanceWindowTargetResponse)
-> Lens
     UpdateMaintenanceWindowTargetResponse
     UpdateMaintenanceWindowTargetResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTargetResponse' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateMaintenanceWindowTargetResponse
s@UpdateMaintenanceWindowTargetResponse' {} Maybe (Sensitive Text)
a -> UpdateMaintenanceWindowTargetResponse
s {$sel:description:UpdateMaintenanceWindowTargetResponse' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateMaintenanceWindowTargetResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateMaintenanceWindowTargetResponse
 -> f UpdateMaintenanceWindowTargetResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
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 maintenance window ID specified in the update request.
updateMaintenanceWindowTargetResponse_windowId :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_windowId :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse_windowId = (UpdateMaintenanceWindowTargetResponse -> Maybe Text)
-> (UpdateMaintenanceWindowTargetResponse
    -> Maybe Text -> UpdateMaintenanceWindowTargetResponse)
-> Lens
     UpdateMaintenanceWindowTargetResponse
     UpdateMaintenanceWindowTargetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTargetResponse' {Maybe Text
windowId :: Maybe Text
$sel:windowId:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe Text
windowId} -> Maybe Text
windowId) (\s :: UpdateMaintenanceWindowTargetResponse
s@UpdateMaintenanceWindowTargetResponse' {} Maybe Text
a -> UpdateMaintenanceWindowTargetResponse
s {$sel:windowId:UpdateMaintenanceWindowTargetResponse' :: Maybe Text
windowId = Maybe Text
a} :: UpdateMaintenanceWindowTargetResponse)

-- | The response's http status code.
updateMaintenanceWindowTargetResponse_httpStatus :: Lens.Lens' UpdateMaintenanceWindowTargetResponse Prelude.Int
updateMaintenanceWindowTargetResponse_httpStatus :: (Int -> f Int)
-> UpdateMaintenanceWindowTargetResponse
-> f UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse_httpStatus = (UpdateMaintenanceWindowTargetResponse -> Int)
-> (UpdateMaintenanceWindowTargetResponse
    -> Int -> UpdateMaintenanceWindowTargetResponse)
-> Lens
     UpdateMaintenanceWindowTargetResponse
     UpdateMaintenanceWindowTargetResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowTargetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateMaintenanceWindowTargetResponse
s@UpdateMaintenanceWindowTargetResponse' {} Int
a -> UpdateMaintenanceWindowTargetResponse
s {$sel:httpStatus:UpdateMaintenanceWindowTargetResponse' :: Int
httpStatus = Int
a} :: UpdateMaintenanceWindowTargetResponse)

instance
  Prelude.NFData
    UpdateMaintenanceWindowTargetResponse