{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_description,
    updateMaintenanceWindowTarget_name,
    updateMaintenanceWindowTarget_ownerInformation,
    updateMaintenanceWindowTarget_replace,
    updateMaintenanceWindowTarget_targets,
    updateMaintenanceWindowTarget_windowId,
    updateMaintenanceWindowTarget_windowTargetId,

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | An optional description for the update.
    UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | A name for the update.
    UpdateMaintenanceWindowTarget -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | 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 (Data.Sensitive Prelude.Text),
    -- | 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,
    -- | The targets to add or replace.
    UpdateMaintenanceWindowTarget -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | 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
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
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.
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:
--
-- 'description', 'updateMaintenanceWindowTarget_description' - An optional description for the update.
--
-- 'name', 'updateMaintenanceWindowTarget_name' - A name for the update.
--
-- '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.
--
-- '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.
--
-- 'targets', 'updateMaintenanceWindowTarget_targets' - The targets to add or replace.
--
-- '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'
      { $sel:description:UpdateMaintenanceWindowTarget' :: Maybe (Sensitive Text)
description =
          forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateMaintenanceWindowTarget' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
        $sel:ownerInformation:UpdateMaintenanceWindowTarget' :: Maybe (Sensitive Text)
ownerInformation = forall a. Maybe a
Prelude.Nothing,
        $sel:replace:UpdateMaintenanceWindowTarget' :: Maybe Bool
replace = forall a. Maybe a
Prelude.Nothing,
        $sel:targets:UpdateMaintenanceWindowTarget' :: Maybe [Target]
targets = forall a. Maybe a
Prelude.Nothing,
        $sel:windowId:UpdateMaintenanceWindowTarget' :: Text
windowId = Text
pWindowId_,
        $sel:windowTargetId:UpdateMaintenanceWindowTarget' :: Text
windowTargetId = Text
pWindowTargetId_
      }

-- | An optional description for the update.
updateMaintenanceWindowTarget_description :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTarget_description :: Lens' UpdateMaintenanceWindowTarget (Maybe Text)
updateMaintenanceWindowTarget_description = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | A name for the update.
updateMaintenanceWindowTarget_name :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTarget_name :: Lens' UpdateMaintenanceWindowTarget (Maybe Text)
updateMaintenanceWindowTarget_name = 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)

-- | 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 :: Lens' UpdateMaintenanceWindowTarget (Maybe Text)
updateMaintenanceWindowTarget_ownerInformation = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | 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 :: Lens' UpdateMaintenanceWindowTarget (Maybe Bool)
updateMaintenanceWindowTarget_replace = 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)

-- | The targets to add or replace.
updateMaintenanceWindowTarget_targets :: Lens.Lens' UpdateMaintenanceWindowTarget (Prelude.Maybe [Target])
updateMaintenanceWindowTarget_targets :: Lens' UpdateMaintenanceWindowTarget (Maybe [Target])
updateMaintenanceWindowTarget_targets = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maintenance window ID with which to modify the target.
updateMaintenanceWindowTarget_windowId :: Lens.Lens' UpdateMaintenanceWindowTarget Prelude.Text
updateMaintenanceWindowTarget_windowId :: Lens' UpdateMaintenanceWindowTarget Text
updateMaintenanceWindowTarget_windowId = 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 :: Lens' UpdateMaintenanceWindowTarget Text
updateMaintenanceWindowTarget_windowTargetId = 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 :: (Service -> Service)
-> UpdateMaintenanceWindowTarget
-> Request UpdateMaintenanceWindowTarget
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateMaintenanceWindowTarget
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateMaintenanceWindowTarget)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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 (Sensitive Text)
-> Maybe [Target]
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateMaintenanceWindowTargetResponse
UpdateMaintenanceWindowTargetResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"OwnerInformation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Targets" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"WindowId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"WindowTargetId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateMaintenanceWindowTarget
  where
  hashWithSalt :: Int -> UpdateMaintenanceWindowTarget -> Int
hashWithSalt Int
_salt UpdateMaintenanceWindowTarget' {Maybe Bool
Maybe [Target]
Maybe Text
Maybe (Sensitive Text)
Text
windowTargetId :: Text
windowId :: Text
targets :: Maybe [Target]
replace :: Maybe Bool
ownerInformation :: Maybe (Sensitive Text)
name :: Maybe Text
description :: Maybe (Sensitive Text)
$sel:windowTargetId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
$sel:windowId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
$sel:targets:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe [Target]
$sel:replace:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Bool
$sel:ownerInformation:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
$sel:name:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Text
$sel:description:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
ownerInformation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
replace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Target]
targets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
windowId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
windowTargetId

instance Prelude.NFData UpdateMaintenanceWindowTarget where
  rnf :: UpdateMaintenanceWindowTarget -> ()
rnf UpdateMaintenanceWindowTarget' {Maybe Bool
Maybe [Target]
Maybe Text
Maybe (Sensitive Text)
Text
windowTargetId :: Text
windowId :: Text
targets :: Maybe [Target]
replace :: Maybe Bool
ownerInformation :: Maybe (Sensitive Text)
name :: Maybe Text
description :: Maybe (Sensitive Text)
$sel:windowTargetId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
$sel:windowId:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Text
$sel:targets:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe [Target]
$sel:replace:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Bool
$sel:ownerInformation:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
$sel:name:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe Text
$sel:description:UpdateMaintenanceWindowTarget' :: UpdateMaintenanceWindowTarget -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
ownerInformation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
replace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Target]
targets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
windowId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
windowTargetId

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

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

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

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

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

-- | The updated description.
updateMaintenanceWindowTargetResponse_description :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_description :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
updateMaintenanceWindowTargetResponse_description = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The updated name.
updateMaintenanceWindowTargetResponse_name :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_name :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
updateMaintenanceWindowTargetResponse_name = 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 owner.
updateMaintenanceWindowTargetResponse_ownerInformation :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_ownerInformation :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
updateMaintenanceWindowTargetResponse_ownerInformation = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The updated targets.
updateMaintenanceWindowTargetResponse_targets :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe [Target])
updateMaintenanceWindowTargetResponse_targets :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe [Target])
updateMaintenanceWindowTargetResponse_targets = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maintenance window ID specified in the update request.
updateMaintenanceWindowTargetResponse_windowId :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_windowId :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
updateMaintenanceWindowTargetResponse_windowId = 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 target ID specified in the update request.
updateMaintenanceWindowTargetResponse_windowTargetId :: Lens.Lens' UpdateMaintenanceWindowTargetResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowTargetResponse_windowTargetId :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
updateMaintenanceWindowTargetResponse_windowTargetId = 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 response's http status code.
updateMaintenanceWindowTargetResponse_httpStatus :: Lens.Lens' UpdateMaintenanceWindowTargetResponse Prelude.Int
updateMaintenanceWindowTargetResponse_httpStatus :: Lens' UpdateMaintenanceWindowTargetResponse Int
updateMaintenanceWindowTargetResponse_httpStatus = 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
  where
  rnf :: UpdateMaintenanceWindowTargetResponse -> ()
rnf UpdateMaintenanceWindowTargetResponse' {Int
Maybe [Target]
Maybe Text
Maybe (Sensitive Text)
httpStatus :: Int
windowTargetId :: Maybe Text
windowId :: Maybe Text
targets :: Maybe [Target]
ownerInformation :: Maybe (Sensitive Text)
name :: Maybe Text
description :: Maybe (Sensitive Text)
$sel:httpStatus:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Int
$sel:windowTargetId:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe Text
$sel:windowId:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe Text
$sel:targets:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe [Target]
$sel:ownerInformation:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text)
$sel:name:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe Text
$sel:description:UpdateMaintenanceWindowTargetResponse' :: UpdateMaintenanceWindowTargetResponse -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
ownerInformation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Target]
targets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
windowId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
windowTargetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus