{-# 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.DeregisterTargetFromMaintenanceWindow
-- 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)
--
-- Removes a target from a maintenance window.
module Amazonka.SSM.DeregisterTargetFromMaintenanceWindow
  ( -- * Creating a Request
    DeregisterTargetFromMaintenanceWindow (..),
    newDeregisterTargetFromMaintenanceWindow,

    -- * Request Lenses
    deregisterTargetFromMaintenanceWindow_safe,
    deregisterTargetFromMaintenanceWindow_windowId,
    deregisterTargetFromMaintenanceWindow_windowTargetId,

    -- * Destructuring the Response
    DeregisterTargetFromMaintenanceWindowResponse (..),
    newDeregisterTargetFromMaintenanceWindowResponse,

    -- * Response Lenses
    deregisterTargetFromMaintenanceWindowResponse_windowTargetId,
    deregisterTargetFromMaintenanceWindowResponse_windowId,
    deregisterTargetFromMaintenanceWindowResponse_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:/ 'newDeregisterTargetFromMaintenanceWindow' smart constructor.
data DeregisterTargetFromMaintenanceWindow = DeregisterTargetFromMaintenanceWindow'
  { -- | The system checks if the target is being referenced by a task. If the
    -- target is being referenced, the system returns an error and doesn\'t
    -- deregister the target from the maintenance window.
    DeregisterTargetFromMaintenanceWindow -> Maybe Bool
safe :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the maintenance window the target should be removed from.
    DeregisterTargetFromMaintenanceWindow -> Text
windowId :: Prelude.Text,
    -- | The ID of the target definition to remove.
    DeregisterTargetFromMaintenanceWindow -> Text
windowTargetId :: Prelude.Text
  }
  deriving (DeregisterTargetFromMaintenanceWindow
-> DeregisterTargetFromMaintenanceWindow -> Bool
(DeregisterTargetFromMaintenanceWindow
 -> DeregisterTargetFromMaintenanceWindow -> Bool)
-> (DeregisterTargetFromMaintenanceWindow
    -> DeregisterTargetFromMaintenanceWindow -> Bool)
-> Eq DeregisterTargetFromMaintenanceWindow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterTargetFromMaintenanceWindow
-> DeregisterTargetFromMaintenanceWindow -> Bool
$c/= :: DeregisterTargetFromMaintenanceWindow
-> DeregisterTargetFromMaintenanceWindow -> Bool
== :: DeregisterTargetFromMaintenanceWindow
-> DeregisterTargetFromMaintenanceWindow -> Bool
$c== :: DeregisterTargetFromMaintenanceWindow
-> DeregisterTargetFromMaintenanceWindow -> Bool
Prelude.Eq, ReadPrec [DeregisterTargetFromMaintenanceWindow]
ReadPrec DeregisterTargetFromMaintenanceWindow
Int -> ReadS DeregisterTargetFromMaintenanceWindow
ReadS [DeregisterTargetFromMaintenanceWindow]
(Int -> ReadS DeregisterTargetFromMaintenanceWindow)
-> ReadS [DeregisterTargetFromMaintenanceWindow]
-> ReadPrec DeregisterTargetFromMaintenanceWindow
-> ReadPrec [DeregisterTargetFromMaintenanceWindow]
-> Read DeregisterTargetFromMaintenanceWindow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterTargetFromMaintenanceWindow]
$creadListPrec :: ReadPrec [DeregisterTargetFromMaintenanceWindow]
readPrec :: ReadPrec DeregisterTargetFromMaintenanceWindow
$creadPrec :: ReadPrec DeregisterTargetFromMaintenanceWindow
readList :: ReadS [DeregisterTargetFromMaintenanceWindow]
$creadList :: ReadS [DeregisterTargetFromMaintenanceWindow]
readsPrec :: Int -> ReadS DeregisterTargetFromMaintenanceWindow
$creadsPrec :: Int -> ReadS DeregisterTargetFromMaintenanceWindow
Prelude.Read, Int -> DeregisterTargetFromMaintenanceWindow -> ShowS
[DeregisterTargetFromMaintenanceWindow] -> ShowS
DeregisterTargetFromMaintenanceWindow -> String
(Int -> DeregisterTargetFromMaintenanceWindow -> ShowS)
-> (DeregisterTargetFromMaintenanceWindow -> String)
-> ([DeregisterTargetFromMaintenanceWindow] -> ShowS)
-> Show DeregisterTargetFromMaintenanceWindow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterTargetFromMaintenanceWindow] -> ShowS
$cshowList :: [DeregisterTargetFromMaintenanceWindow] -> ShowS
show :: DeregisterTargetFromMaintenanceWindow -> String
$cshow :: DeregisterTargetFromMaintenanceWindow -> String
showsPrec :: Int -> DeregisterTargetFromMaintenanceWindow -> ShowS
$cshowsPrec :: Int -> DeregisterTargetFromMaintenanceWindow -> ShowS
Prelude.Show, (forall x.
 DeregisterTargetFromMaintenanceWindow
 -> Rep DeregisterTargetFromMaintenanceWindow x)
-> (forall x.
    Rep DeregisterTargetFromMaintenanceWindow x
    -> DeregisterTargetFromMaintenanceWindow)
-> Generic DeregisterTargetFromMaintenanceWindow
forall x.
Rep DeregisterTargetFromMaintenanceWindow x
-> DeregisterTargetFromMaintenanceWindow
forall x.
DeregisterTargetFromMaintenanceWindow
-> Rep DeregisterTargetFromMaintenanceWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterTargetFromMaintenanceWindow x
-> DeregisterTargetFromMaintenanceWindow
$cfrom :: forall x.
DeregisterTargetFromMaintenanceWindow
-> Rep DeregisterTargetFromMaintenanceWindow x
Prelude.Generic)

-- |
-- Create a value of 'DeregisterTargetFromMaintenanceWindow' 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:
--
-- 'safe', 'deregisterTargetFromMaintenanceWindow_safe' - The system checks if the target is being referenced by a task. If the
-- target is being referenced, the system returns an error and doesn\'t
-- deregister the target from the maintenance window.
--
-- 'windowId', 'deregisterTargetFromMaintenanceWindow_windowId' - The ID of the maintenance window the target should be removed from.
--
-- 'windowTargetId', 'deregisterTargetFromMaintenanceWindow_windowTargetId' - The ID of the target definition to remove.
newDeregisterTargetFromMaintenanceWindow ::
  -- | 'windowId'
  Prelude.Text ->
  -- | 'windowTargetId'
  Prelude.Text ->
  DeregisterTargetFromMaintenanceWindow
newDeregisterTargetFromMaintenanceWindow :: Text -> Text -> DeregisterTargetFromMaintenanceWindow
newDeregisterTargetFromMaintenanceWindow
  Text
pWindowId_
  Text
pWindowTargetId_ =
    DeregisterTargetFromMaintenanceWindow' :: Maybe Bool -> Text -> Text -> DeregisterTargetFromMaintenanceWindow
DeregisterTargetFromMaintenanceWindow'
      { $sel:safe:DeregisterTargetFromMaintenanceWindow' :: Maybe Bool
safe =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:windowId:DeregisterTargetFromMaintenanceWindow' :: Text
windowId = Text
pWindowId_,
        $sel:windowTargetId:DeregisterTargetFromMaintenanceWindow' :: Text
windowTargetId = Text
pWindowTargetId_
      }

-- | The system checks if the target is being referenced by a task. If the
-- target is being referenced, the system returns an error and doesn\'t
-- deregister the target from the maintenance window.
deregisterTargetFromMaintenanceWindow_safe :: Lens.Lens' DeregisterTargetFromMaintenanceWindow (Prelude.Maybe Prelude.Bool)
deregisterTargetFromMaintenanceWindow_safe :: (Maybe Bool -> f (Maybe Bool))
-> DeregisterTargetFromMaintenanceWindow
-> f DeregisterTargetFromMaintenanceWindow
deregisterTargetFromMaintenanceWindow_safe = (DeregisterTargetFromMaintenanceWindow -> Maybe Bool)
-> (DeregisterTargetFromMaintenanceWindow
    -> Maybe Bool -> DeregisterTargetFromMaintenanceWindow)
-> Lens
     DeregisterTargetFromMaintenanceWindow
     DeregisterTargetFromMaintenanceWindow
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTargetFromMaintenanceWindow' {Maybe Bool
safe :: Maybe Bool
$sel:safe:DeregisterTargetFromMaintenanceWindow' :: DeregisterTargetFromMaintenanceWindow -> Maybe Bool
safe} -> Maybe Bool
safe) (\s :: DeregisterTargetFromMaintenanceWindow
s@DeregisterTargetFromMaintenanceWindow' {} Maybe Bool
a -> DeregisterTargetFromMaintenanceWindow
s {$sel:safe:DeregisterTargetFromMaintenanceWindow' :: Maybe Bool
safe = Maybe Bool
a} :: DeregisterTargetFromMaintenanceWindow)

-- | The ID of the maintenance window the target should be removed from.
deregisterTargetFromMaintenanceWindow_windowId :: Lens.Lens' DeregisterTargetFromMaintenanceWindow Prelude.Text
deregisterTargetFromMaintenanceWindow_windowId :: (Text -> f Text)
-> DeregisterTargetFromMaintenanceWindow
-> f DeregisterTargetFromMaintenanceWindow
deregisterTargetFromMaintenanceWindow_windowId = (DeregisterTargetFromMaintenanceWindow -> Text)
-> (DeregisterTargetFromMaintenanceWindow
    -> Text -> DeregisterTargetFromMaintenanceWindow)
-> Lens
     DeregisterTargetFromMaintenanceWindow
     DeregisterTargetFromMaintenanceWindow
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTargetFromMaintenanceWindow' {Text
windowId :: Text
$sel:windowId:DeregisterTargetFromMaintenanceWindow' :: DeregisterTargetFromMaintenanceWindow -> Text
windowId} -> Text
windowId) (\s :: DeregisterTargetFromMaintenanceWindow
s@DeregisterTargetFromMaintenanceWindow' {} Text
a -> DeregisterTargetFromMaintenanceWindow
s {$sel:windowId:DeregisterTargetFromMaintenanceWindow' :: Text
windowId = Text
a} :: DeregisterTargetFromMaintenanceWindow)

-- | The ID of the target definition to remove.
deregisterTargetFromMaintenanceWindow_windowTargetId :: Lens.Lens' DeregisterTargetFromMaintenanceWindow Prelude.Text
deregisterTargetFromMaintenanceWindow_windowTargetId :: (Text -> f Text)
-> DeregisterTargetFromMaintenanceWindow
-> f DeregisterTargetFromMaintenanceWindow
deregisterTargetFromMaintenanceWindow_windowTargetId = (DeregisterTargetFromMaintenanceWindow -> Text)
-> (DeregisterTargetFromMaintenanceWindow
    -> Text -> DeregisterTargetFromMaintenanceWindow)
-> Lens
     DeregisterTargetFromMaintenanceWindow
     DeregisterTargetFromMaintenanceWindow
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTargetFromMaintenanceWindow' {Text
windowTargetId :: Text
$sel:windowTargetId:DeregisterTargetFromMaintenanceWindow' :: DeregisterTargetFromMaintenanceWindow -> Text
windowTargetId} -> Text
windowTargetId) (\s :: DeregisterTargetFromMaintenanceWindow
s@DeregisterTargetFromMaintenanceWindow' {} Text
a -> DeregisterTargetFromMaintenanceWindow
s {$sel:windowTargetId:DeregisterTargetFromMaintenanceWindow' :: Text
windowTargetId = Text
a} :: DeregisterTargetFromMaintenanceWindow)

instance
  Core.AWSRequest
    DeregisterTargetFromMaintenanceWindow
  where
  type
    AWSResponse
      DeregisterTargetFromMaintenanceWindow =
      DeregisterTargetFromMaintenanceWindowResponse
  request :: DeregisterTargetFromMaintenanceWindow
-> Request DeregisterTargetFromMaintenanceWindow
request = Service
-> DeregisterTargetFromMaintenanceWindow
-> Request DeregisterTargetFromMaintenanceWindow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeregisterTargetFromMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeregisterTargetFromMaintenanceWindow)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse DeregisterTargetFromMaintenanceWindow))
-> Logger
-> Service
-> Proxy DeregisterTargetFromMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeregisterTargetFromMaintenanceWindow)))
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 Text
-> Maybe Text
-> Int
-> DeregisterTargetFromMaintenanceWindowResponse
DeregisterTargetFromMaintenanceWindowResponse'
            (Maybe Text
 -> Maybe Text
 -> Int
 -> DeregisterTargetFromMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int -> DeregisterTargetFromMaintenanceWindowResponse)
forall (f :: * -> *) a b. Functor 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
   -> Int -> DeregisterTargetFromMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> DeregisterTargetFromMaintenanceWindowResponse)
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 -> DeregisterTargetFromMaintenanceWindowResponse)
-> Either String Int
-> Either String DeregisterTargetFromMaintenanceWindowResponse
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
    DeregisterTargetFromMaintenanceWindow

instance
  Prelude.NFData
    DeregisterTargetFromMaintenanceWindow

instance
  Core.ToHeaders
    DeregisterTargetFromMaintenanceWindow
  where
  toHeaders :: DeregisterTargetFromMaintenanceWindow -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DeregisterTargetFromMaintenanceWindow -> 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.DeregisterTargetFromMaintenanceWindow" ::
                          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
    DeregisterTargetFromMaintenanceWindow
  where
  toJSON :: DeregisterTargetFromMaintenanceWindow -> Value
toJSON DeregisterTargetFromMaintenanceWindow' {Maybe Bool
Text
windowTargetId :: Text
windowId :: Text
safe :: Maybe Bool
$sel:windowTargetId:DeregisterTargetFromMaintenanceWindow' :: DeregisterTargetFromMaintenanceWindow -> Text
$sel:windowId:DeregisterTargetFromMaintenanceWindow' :: DeregisterTargetFromMaintenanceWindow -> Text
$sel:safe:DeregisterTargetFromMaintenanceWindow' :: DeregisterTargetFromMaintenanceWindow -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Safe" 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
safe,
            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
    DeregisterTargetFromMaintenanceWindow
  where
  toPath :: DeregisterTargetFromMaintenanceWindow -> ByteString
toPath = ByteString -> DeregisterTargetFromMaintenanceWindow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDeregisterTargetFromMaintenanceWindowResponse' smart constructor.
data DeregisterTargetFromMaintenanceWindowResponse = DeregisterTargetFromMaintenanceWindowResponse'
  { -- | The ID of the removed target definition.
    DeregisterTargetFromMaintenanceWindowResponse -> Maybe Text
windowTargetId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the maintenance window the target was removed from.
    DeregisterTargetFromMaintenanceWindowResponse -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DeregisterTargetFromMaintenanceWindowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeregisterTargetFromMaintenanceWindowResponse
-> DeregisterTargetFromMaintenanceWindowResponse -> Bool
(DeregisterTargetFromMaintenanceWindowResponse
 -> DeregisterTargetFromMaintenanceWindowResponse -> Bool)
-> (DeregisterTargetFromMaintenanceWindowResponse
    -> DeregisterTargetFromMaintenanceWindowResponse -> Bool)
-> Eq DeregisterTargetFromMaintenanceWindowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterTargetFromMaintenanceWindowResponse
-> DeregisterTargetFromMaintenanceWindowResponse -> Bool
$c/= :: DeregisterTargetFromMaintenanceWindowResponse
-> DeregisterTargetFromMaintenanceWindowResponse -> Bool
== :: DeregisterTargetFromMaintenanceWindowResponse
-> DeregisterTargetFromMaintenanceWindowResponse -> Bool
$c== :: DeregisterTargetFromMaintenanceWindowResponse
-> DeregisterTargetFromMaintenanceWindowResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterTargetFromMaintenanceWindowResponse]
ReadPrec DeregisterTargetFromMaintenanceWindowResponse
Int -> ReadS DeregisterTargetFromMaintenanceWindowResponse
ReadS [DeregisterTargetFromMaintenanceWindowResponse]
(Int -> ReadS DeregisterTargetFromMaintenanceWindowResponse)
-> ReadS [DeregisterTargetFromMaintenanceWindowResponse]
-> ReadPrec DeregisterTargetFromMaintenanceWindowResponse
-> ReadPrec [DeregisterTargetFromMaintenanceWindowResponse]
-> Read DeregisterTargetFromMaintenanceWindowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterTargetFromMaintenanceWindowResponse]
$creadListPrec :: ReadPrec [DeregisterTargetFromMaintenanceWindowResponse]
readPrec :: ReadPrec DeregisterTargetFromMaintenanceWindowResponse
$creadPrec :: ReadPrec DeregisterTargetFromMaintenanceWindowResponse
readList :: ReadS [DeregisterTargetFromMaintenanceWindowResponse]
$creadList :: ReadS [DeregisterTargetFromMaintenanceWindowResponse]
readsPrec :: Int -> ReadS DeregisterTargetFromMaintenanceWindowResponse
$creadsPrec :: Int -> ReadS DeregisterTargetFromMaintenanceWindowResponse
Prelude.Read, Int -> DeregisterTargetFromMaintenanceWindowResponse -> ShowS
[DeregisterTargetFromMaintenanceWindowResponse] -> ShowS
DeregisterTargetFromMaintenanceWindowResponse -> String
(Int -> DeregisterTargetFromMaintenanceWindowResponse -> ShowS)
-> (DeregisterTargetFromMaintenanceWindowResponse -> String)
-> ([DeregisterTargetFromMaintenanceWindowResponse] -> ShowS)
-> Show DeregisterTargetFromMaintenanceWindowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterTargetFromMaintenanceWindowResponse] -> ShowS
$cshowList :: [DeregisterTargetFromMaintenanceWindowResponse] -> ShowS
show :: DeregisterTargetFromMaintenanceWindowResponse -> String
$cshow :: DeregisterTargetFromMaintenanceWindowResponse -> String
showsPrec :: Int -> DeregisterTargetFromMaintenanceWindowResponse -> ShowS
$cshowsPrec :: Int -> DeregisterTargetFromMaintenanceWindowResponse -> ShowS
Prelude.Show, (forall x.
 DeregisterTargetFromMaintenanceWindowResponse
 -> Rep DeregisterTargetFromMaintenanceWindowResponse x)
-> (forall x.
    Rep DeregisterTargetFromMaintenanceWindowResponse x
    -> DeregisterTargetFromMaintenanceWindowResponse)
-> Generic DeregisterTargetFromMaintenanceWindowResponse
forall x.
Rep DeregisterTargetFromMaintenanceWindowResponse x
-> DeregisterTargetFromMaintenanceWindowResponse
forall x.
DeregisterTargetFromMaintenanceWindowResponse
-> Rep DeregisterTargetFromMaintenanceWindowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterTargetFromMaintenanceWindowResponse x
-> DeregisterTargetFromMaintenanceWindowResponse
$cfrom :: forall x.
DeregisterTargetFromMaintenanceWindowResponse
-> Rep DeregisterTargetFromMaintenanceWindowResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeregisterTargetFromMaintenanceWindowResponse' 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:
--
-- 'windowTargetId', 'deregisterTargetFromMaintenanceWindowResponse_windowTargetId' - The ID of the removed target definition.
--
-- 'windowId', 'deregisterTargetFromMaintenanceWindowResponse_windowId' - The ID of the maintenance window the target was removed from.
--
-- 'httpStatus', 'deregisterTargetFromMaintenanceWindowResponse_httpStatus' - The response's http status code.
newDeregisterTargetFromMaintenanceWindowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeregisterTargetFromMaintenanceWindowResponse
newDeregisterTargetFromMaintenanceWindowResponse :: Int -> DeregisterTargetFromMaintenanceWindowResponse
newDeregisterTargetFromMaintenanceWindowResponse
  Int
pHttpStatus_ =
    DeregisterTargetFromMaintenanceWindowResponse' :: Maybe Text
-> Maybe Text
-> Int
-> DeregisterTargetFromMaintenanceWindowResponse
DeregisterTargetFromMaintenanceWindowResponse'
      { $sel:windowTargetId:DeregisterTargetFromMaintenanceWindowResponse' :: Maybe Text
windowTargetId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:windowId:DeregisterTargetFromMaintenanceWindowResponse' :: Maybe Text
windowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DeregisterTargetFromMaintenanceWindowResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The ID of the removed target definition.
deregisterTargetFromMaintenanceWindowResponse_windowTargetId :: Lens.Lens' DeregisterTargetFromMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
deregisterTargetFromMaintenanceWindowResponse_windowTargetId :: (Maybe Text -> f (Maybe Text))
-> DeregisterTargetFromMaintenanceWindowResponse
-> f DeregisterTargetFromMaintenanceWindowResponse
deregisterTargetFromMaintenanceWindowResponse_windowTargetId = (DeregisterTargetFromMaintenanceWindowResponse -> Maybe Text)
-> (DeregisterTargetFromMaintenanceWindowResponse
    -> Maybe Text -> DeregisterTargetFromMaintenanceWindowResponse)
-> Lens
     DeregisterTargetFromMaintenanceWindowResponse
     DeregisterTargetFromMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTargetFromMaintenanceWindowResponse' {Maybe Text
windowTargetId :: Maybe Text
$sel:windowTargetId:DeregisterTargetFromMaintenanceWindowResponse' :: DeregisterTargetFromMaintenanceWindowResponse -> Maybe Text
windowTargetId} -> Maybe Text
windowTargetId) (\s :: DeregisterTargetFromMaintenanceWindowResponse
s@DeregisterTargetFromMaintenanceWindowResponse' {} Maybe Text
a -> DeregisterTargetFromMaintenanceWindowResponse
s {$sel:windowTargetId:DeregisterTargetFromMaintenanceWindowResponse' :: Maybe Text
windowTargetId = Maybe Text
a} :: DeregisterTargetFromMaintenanceWindowResponse)

-- | The ID of the maintenance window the target was removed from.
deregisterTargetFromMaintenanceWindowResponse_windowId :: Lens.Lens' DeregisterTargetFromMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
deregisterTargetFromMaintenanceWindowResponse_windowId :: (Maybe Text -> f (Maybe Text))
-> DeregisterTargetFromMaintenanceWindowResponse
-> f DeregisterTargetFromMaintenanceWindowResponse
deregisterTargetFromMaintenanceWindowResponse_windowId = (DeregisterTargetFromMaintenanceWindowResponse -> Maybe Text)
-> (DeregisterTargetFromMaintenanceWindowResponse
    -> Maybe Text -> DeregisterTargetFromMaintenanceWindowResponse)
-> Lens
     DeregisterTargetFromMaintenanceWindowResponse
     DeregisterTargetFromMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTargetFromMaintenanceWindowResponse' {Maybe Text
windowId :: Maybe Text
$sel:windowId:DeregisterTargetFromMaintenanceWindowResponse' :: DeregisterTargetFromMaintenanceWindowResponse -> Maybe Text
windowId} -> Maybe Text
windowId) (\s :: DeregisterTargetFromMaintenanceWindowResponse
s@DeregisterTargetFromMaintenanceWindowResponse' {} Maybe Text
a -> DeregisterTargetFromMaintenanceWindowResponse
s {$sel:windowId:DeregisterTargetFromMaintenanceWindowResponse' :: Maybe Text
windowId = Maybe Text
a} :: DeregisterTargetFromMaintenanceWindowResponse)

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

instance
  Prelude.NFData
    DeregisterTargetFromMaintenanceWindowResponse