{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The maintenance window to which the specified target belongs.
--
-- /See:/ 'newMaintenanceWindowIdentityForTarget' smart constructor.
data MaintenanceWindowIdentityForTarget = MaintenanceWindowIdentityForTarget'
  { -- | The name of the maintenance window.
    MaintenanceWindowIdentityForTarget -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the maintenance window.
    MaintenanceWindowIdentityForTarget -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text
  }
  deriving (MaintenanceWindowIdentityForTarget
-> MaintenanceWindowIdentityForTarget -> Bool
(MaintenanceWindowIdentityForTarget
 -> MaintenanceWindowIdentityForTarget -> Bool)
-> (MaintenanceWindowIdentityForTarget
    -> MaintenanceWindowIdentityForTarget -> Bool)
-> Eq MaintenanceWindowIdentityForTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceWindowIdentityForTarget
-> MaintenanceWindowIdentityForTarget -> Bool
$c/= :: MaintenanceWindowIdentityForTarget
-> MaintenanceWindowIdentityForTarget -> Bool
== :: MaintenanceWindowIdentityForTarget
-> MaintenanceWindowIdentityForTarget -> Bool
$c== :: MaintenanceWindowIdentityForTarget
-> MaintenanceWindowIdentityForTarget -> Bool
Prelude.Eq, ReadPrec [MaintenanceWindowIdentityForTarget]
ReadPrec MaintenanceWindowIdentityForTarget
Int -> ReadS MaintenanceWindowIdentityForTarget
ReadS [MaintenanceWindowIdentityForTarget]
(Int -> ReadS MaintenanceWindowIdentityForTarget)
-> ReadS [MaintenanceWindowIdentityForTarget]
-> ReadPrec MaintenanceWindowIdentityForTarget
-> ReadPrec [MaintenanceWindowIdentityForTarget]
-> Read MaintenanceWindowIdentityForTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MaintenanceWindowIdentityForTarget]
$creadListPrec :: ReadPrec [MaintenanceWindowIdentityForTarget]
readPrec :: ReadPrec MaintenanceWindowIdentityForTarget
$creadPrec :: ReadPrec MaintenanceWindowIdentityForTarget
readList :: ReadS [MaintenanceWindowIdentityForTarget]
$creadList :: ReadS [MaintenanceWindowIdentityForTarget]
readsPrec :: Int -> ReadS MaintenanceWindowIdentityForTarget
$creadsPrec :: Int -> ReadS MaintenanceWindowIdentityForTarget
Prelude.Read, Int -> MaintenanceWindowIdentityForTarget -> ShowS
[MaintenanceWindowIdentityForTarget] -> ShowS
MaintenanceWindowIdentityForTarget -> String
(Int -> MaintenanceWindowIdentityForTarget -> ShowS)
-> (MaintenanceWindowIdentityForTarget -> String)
-> ([MaintenanceWindowIdentityForTarget] -> ShowS)
-> Show MaintenanceWindowIdentityForTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceWindowIdentityForTarget] -> ShowS
$cshowList :: [MaintenanceWindowIdentityForTarget] -> ShowS
show :: MaintenanceWindowIdentityForTarget -> String
$cshow :: MaintenanceWindowIdentityForTarget -> String
showsPrec :: Int -> MaintenanceWindowIdentityForTarget -> ShowS
$cshowsPrec :: Int -> MaintenanceWindowIdentityForTarget -> ShowS
Prelude.Show, (forall x.
 MaintenanceWindowIdentityForTarget
 -> Rep MaintenanceWindowIdentityForTarget x)
-> (forall x.
    Rep MaintenanceWindowIdentityForTarget x
    -> MaintenanceWindowIdentityForTarget)
-> Generic MaintenanceWindowIdentityForTarget
forall x.
Rep MaintenanceWindowIdentityForTarget x
-> MaintenanceWindowIdentityForTarget
forall x.
MaintenanceWindowIdentityForTarget
-> Rep MaintenanceWindowIdentityForTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MaintenanceWindowIdentityForTarget x
-> MaintenanceWindowIdentityForTarget
$cfrom :: forall x.
MaintenanceWindowIdentityForTarget
-> Rep MaintenanceWindowIdentityForTarget x
Prelude.Generic)

-- |
-- Create a value of 'MaintenanceWindowIdentityForTarget' 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:
--
-- 'name', 'maintenanceWindowIdentityForTarget_name' - The name of the maintenance window.
--
-- 'windowId', 'maintenanceWindowIdentityForTarget_windowId' - The ID of the maintenance window.
newMaintenanceWindowIdentityForTarget ::
  MaintenanceWindowIdentityForTarget
newMaintenanceWindowIdentityForTarget :: MaintenanceWindowIdentityForTarget
newMaintenanceWindowIdentityForTarget =
  MaintenanceWindowIdentityForTarget' :: Maybe Text -> Maybe Text -> MaintenanceWindowIdentityForTarget
MaintenanceWindowIdentityForTarget'
    { $sel:name:MaintenanceWindowIdentityForTarget' :: Maybe Text
name =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:windowId:MaintenanceWindowIdentityForTarget' :: Maybe Text
windowId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the maintenance window.
maintenanceWindowIdentityForTarget_name :: Lens.Lens' MaintenanceWindowIdentityForTarget (Prelude.Maybe Prelude.Text)
maintenanceWindowIdentityForTarget_name :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowIdentityForTarget
-> f MaintenanceWindowIdentityForTarget
maintenanceWindowIdentityForTarget_name = (MaintenanceWindowIdentityForTarget -> Maybe Text)
-> (MaintenanceWindowIdentityForTarget
    -> Maybe Text -> MaintenanceWindowIdentityForTarget)
-> Lens
     MaintenanceWindowIdentityForTarget
     MaintenanceWindowIdentityForTarget
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowIdentityForTarget' {Maybe Text
name :: Maybe Text
$sel:name:MaintenanceWindowIdentityForTarget' :: MaintenanceWindowIdentityForTarget -> Maybe Text
name} -> Maybe Text
name) (\s :: MaintenanceWindowIdentityForTarget
s@MaintenanceWindowIdentityForTarget' {} Maybe Text
a -> MaintenanceWindowIdentityForTarget
s {$sel:name:MaintenanceWindowIdentityForTarget' :: Maybe Text
name = Maybe Text
a} :: MaintenanceWindowIdentityForTarget)

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

instance
  Core.FromJSON
    MaintenanceWindowIdentityForTarget
  where
  parseJSON :: Value -> Parser MaintenanceWindowIdentityForTarget
parseJSON =
    String
-> (Object -> Parser MaintenanceWindowIdentityForTarget)
-> Value
-> Parser MaintenanceWindowIdentityForTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MaintenanceWindowIdentityForTarget"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> MaintenanceWindowIdentityForTarget
MaintenanceWindowIdentityForTarget'
            (Maybe Text -> Maybe Text -> MaintenanceWindowIdentityForTarget)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> MaintenanceWindowIdentityForTarget)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> MaintenanceWindowIdentityForTarget)
-> Parser (Maybe Text) -> Parser MaintenanceWindowIdentityForTarget
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WindowId")
      )

instance
  Prelude.Hashable
    MaintenanceWindowIdentityForTarget

instance
  Prelude.NFData
    MaintenanceWindowIdentityForTarget