{-# 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.PatchBaselineIdentity
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSM.Types.PatchBaselineIdentity 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 Amazonka.SSM.Types.OperatingSystem

-- | Defines the basic information about a patch baseline.
--
-- /See:/ 'newPatchBaselineIdentity' smart constructor.
data PatchBaselineIdentity = PatchBaselineIdentity'
  { -- | The description of the patch baseline.
    PatchBaselineIdentity -> Maybe Text
baselineDescription :: Prelude.Maybe Prelude.Text,
    -- | The ID of the patch baseline.
    PatchBaselineIdentity -> Maybe Text
baselineId :: Prelude.Maybe Prelude.Text,
    -- | The name of the patch baseline.
    PatchBaselineIdentity -> Maybe Text
baselineName :: Prelude.Maybe Prelude.Text,
    -- | Whether this is the default baseline. Amazon Web Services Systems
    -- Manager supports creating multiple default patch baselines. For example,
    -- you can create a default patch baseline for each operating system.
    PatchBaselineIdentity -> Maybe Bool
defaultBaseline :: Prelude.Maybe Prelude.Bool,
    -- | Defines the operating system the patch baseline applies to. The default
    -- value is @WINDOWS@.
    PatchBaselineIdentity -> Maybe OperatingSystem
operatingSystem :: Prelude.Maybe OperatingSystem
  }
  deriving (PatchBaselineIdentity -> PatchBaselineIdentity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PatchBaselineIdentity -> PatchBaselineIdentity -> Bool
$c/= :: PatchBaselineIdentity -> PatchBaselineIdentity -> Bool
== :: PatchBaselineIdentity -> PatchBaselineIdentity -> Bool
$c== :: PatchBaselineIdentity -> PatchBaselineIdentity -> Bool
Prelude.Eq, ReadPrec [PatchBaselineIdentity]
ReadPrec PatchBaselineIdentity
Int -> ReadS PatchBaselineIdentity
ReadS [PatchBaselineIdentity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PatchBaselineIdentity]
$creadListPrec :: ReadPrec [PatchBaselineIdentity]
readPrec :: ReadPrec PatchBaselineIdentity
$creadPrec :: ReadPrec PatchBaselineIdentity
readList :: ReadS [PatchBaselineIdentity]
$creadList :: ReadS [PatchBaselineIdentity]
readsPrec :: Int -> ReadS PatchBaselineIdentity
$creadsPrec :: Int -> ReadS PatchBaselineIdentity
Prelude.Read, Int -> PatchBaselineIdentity -> ShowS
[PatchBaselineIdentity] -> ShowS
PatchBaselineIdentity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PatchBaselineIdentity] -> ShowS
$cshowList :: [PatchBaselineIdentity] -> ShowS
show :: PatchBaselineIdentity -> String
$cshow :: PatchBaselineIdentity -> String
showsPrec :: Int -> PatchBaselineIdentity -> ShowS
$cshowsPrec :: Int -> PatchBaselineIdentity -> ShowS
Prelude.Show, forall x. Rep PatchBaselineIdentity x -> PatchBaselineIdentity
forall x. PatchBaselineIdentity -> Rep PatchBaselineIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PatchBaselineIdentity x -> PatchBaselineIdentity
$cfrom :: forall x. PatchBaselineIdentity -> Rep PatchBaselineIdentity x
Prelude.Generic)

-- |
-- Create a value of 'PatchBaselineIdentity' 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:
--
-- 'baselineDescription', 'patchBaselineIdentity_baselineDescription' - The description of the patch baseline.
--
-- 'baselineId', 'patchBaselineIdentity_baselineId' - The ID of the patch baseline.
--
-- 'baselineName', 'patchBaselineIdentity_baselineName' - The name of the patch baseline.
--
-- 'defaultBaseline', 'patchBaselineIdentity_defaultBaseline' - Whether this is the default baseline. Amazon Web Services Systems
-- Manager supports creating multiple default patch baselines. For example,
-- you can create a default patch baseline for each operating system.
--
-- 'operatingSystem', 'patchBaselineIdentity_operatingSystem' - Defines the operating system the patch baseline applies to. The default
-- value is @WINDOWS@.
newPatchBaselineIdentity ::
  PatchBaselineIdentity
newPatchBaselineIdentity :: PatchBaselineIdentity
newPatchBaselineIdentity =
  PatchBaselineIdentity'
    { $sel:baselineDescription:PatchBaselineIdentity' :: Maybe Text
baselineDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:baselineId:PatchBaselineIdentity' :: Maybe Text
baselineId = forall a. Maybe a
Prelude.Nothing,
      $sel:baselineName:PatchBaselineIdentity' :: Maybe Text
baselineName = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultBaseline:PatchBaselineIdentity' :: Maybe Bool
defaultBaseline = forall a. Maybe a
Prelude.Nothing,
      $sel:operatingSystem:PatchBaselineIdentity' :: Maybe OperatingSystem
operatingSystem = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the patch baseline.
patchBaselineIdentity_baselineDescription :: Lens.Lens' PatchBaselineIdentity (Prelude.Maybe Prelude.Text)
patchBaselineIdentity_baselineDescription :: Lens' PatchBaselineIdentity (Maybe Text)
patchBaselineIdentity_baselineDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchBaselineIdentity' {Maybe Text
baselineDescription :: Maybe Text
$sel:baselineDescription:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
baselineDescription} -> Maybe Text
baselineDescription) (\s :: PatchBaselineIdentity
s@PatchBaselineIdentity' {} Maybe Text
a -> PatchBaselineIdentity
s {$sel:baselineDescription:PatchBaselineIdentity' :: Maybe Text
baselineDescription = Maybe Text
a} :: PatchBaselineIdentity)

-- | The ID of the patch baseline.
patchBaselineIdentity_baselineId :: Lens.Lens' PatchBaselineIdentity (Prelude.Maybe Prelude.Text)
patchBaselineIdentity_baselineId :: Lens' PatchBaselineIdentity (Maybe Text)
patchBaselineIdentity_baselineId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchBaselineIdentity' {Maybe Text
baselineId :: Maybe Text
$sel:baselineId:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
baselineId} -> Maybe Text
baselineId) (\s :: PatchBaselineIdentity
s@PatchBaselineIdentity' {} Maybe Text
a -> PatchBaselineIdentity
s {$sel:baselineId:PatchBaselineIdentity' :: Maybe Text
baselineId = Maybe Text
a} :: PatchBaselineIdentity)

-- | The name of the patch baseline.
patchBaselineIdentity_baselineName :: Lens.Lens' PatchBaselineIdentity (Prelude.Maybe Prelude.Text)
patchBaselineIdentity_baselineName :: Lens' PatchBaselineIdentity (Maybe Text)
patchBaselineIdentity_baselineName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchBaselineIdentity' {Maybe Text
baselineName :: Maybe Text
$sel:baselineName:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
baselineName} -> Maybe Text
baselineName) (\s :: PatchBaselineIdentity
s@PatchBaselineIdentity' {} Maybe Text
a -> PatchBaselineIdentity
s {$sel:baselineName:PatchBaselineIdentity' :: Maybe Text
baselineName = Maybe Text
a} :: PatchBaselineIdentity)

-- | Whether this is the default baseline. Amazon Web Services Systems
-- Manager supports creating multiple default patch baselines. For example,
-- you can create a default patch baseline for each operating system.
patchBaselineIdentity_defaultBaseline :: Lens.Lens' PatchBaselineIdentity (Prelude.Maybe Prelude.Bool)
patchBaselineIdentity_defaultBaseline :: Lens' PatchBaselineIdentity (Maybe Bool)
patchBaselineIdentity_defaultBaseline = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchBaselineIdentity' {Maybe Bool
defaultBaseline :: Maybe Bool
$sel:defaultBaseline:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Bool
defaultBaseline} -> Maybe Bool
defaultBaseline) (\s :: PatchBaselineIdentity
s@PatchBaselineIdentity' {} Maybe Bool
a -> PatchBaselineIdentity
s {$sel:defaultBaseline:PatchBaselineIdentity' :: Maybe Bool
defaultBaseline = Maybe Bool
a} :: PatchBaselineIdentity)

-- | Defines the operating system the patch baseline applies to. The default
-- value is @WINDOWS@.
patchBaselineIdentity_operatingSystem :: Lens.Lens' PatchBaselineIdentity (Prelude.Maybe OperatingSystem)
patchBaselineIdentity_operatingSystem :: Lens' PatchBaselineIdentity (Maybe OperatingSystem)
patchBaselineIdentity_operatingSystem = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchBaselineIdentity' {Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
$sel:operatingSystem:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe OperatingSystem
operatingSystem} -> Maybe OperatingSystem
operatingSystem) (\s :: PatchBaselineIdentity
s@PatchBaselineIdentity' {} Maybe OperatingSystem
a -> PatchBaselineIdentity
s {$sel:operatingSystem:PatchBaselineIdentity' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
a} :: PatchBaselineIdentity)

instance Data.FromJSON PatchBaselineIdentity where
  parseJSON :: Value -> Parser PatchBaselineIdentity
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PatchBaselineIdentity"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe OperatingSystem
-> PatchBaselineIdentity
PatchBaselineIdentity'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BaselineDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BaselineId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BaselineName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DefaultBaseline")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OperatingSystem")
      )

instance Prelude.Hashable PatchBaselineIdentity where
  hashWithSalt :: Int -> PatchBaselineIdentity -> Int
hashWithSalt Int
_salt PatchBaselineIdentity' {Maybe Bool
Maybe Text
Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
defaultBaseline :: Maybe Bool
baselineName :: Maybe Text
baselineId :: Maybe Text
baselineDescription :: Maybe Text
$sel:operatingSystem:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe OperatingSystem
$sel:defaultBaseline:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Bool
$sel:baselineName:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
$sel:baselineId:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
$sel:baselineDescription:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
baselineDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
baselineId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
baselineName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
defaultBaseline
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OperatingSystem
operatingSystem

instance Prelude.NFData PatchBaselineIdentity where
  rnf :: PatchBaselineIdentity -> ()
rnf PatchBaselineIdentity' {Maybe Bool
Maybe Text
Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
defaultBaseline :: Maybe Bool
baselineName :: Maybe Text
baselineId :: Maybe Text
baselineDescription :: Maybe Text
$sel:operatingSystem:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe OperatingSystem
$sel:defaultBaseline:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Bool
$sel:baselineName:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
$sel:baselineId:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
$sel:baselineDescription:PatchBaselineIdentity' :: PatchBaselineIdentity -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
baselineDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
baselineId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
baselineName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
defaultBaseline
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OperatingSystem
operatingSystem