{-# 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.BaselineOverride
-- 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.BaselineOverride where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.OperatingSystem
import Amazonka.SSM.Types.PatchAction
import Amazonka.SSM.Types.PatchComplianceLevel
import Amazonka.SSM.Types.PatchFilterGroup
import Amazonka.SSM.Types.PatchRuleGroup
import Amazonka.SSM.Types.PatchSource

-- | Defines the basic information about a patch baseline override.
--
-- /See:/ 'newBaselineOverride' smart constructor.
data BaselineOverride = BaselineOverride'
  { BaselineOverride -> Maybe PatchRuleGroup
approvalRules :: Prelude.Maybe PatchRuleGroup,
    -- | The operating system rule used by the patch baseline override.
    BaselineOverride -> Maybe OperatingSystem
operatingSystem :: Prelude.Maybe OperatingSystem,
    BaselineOverride -> Maybe PatchFilterGroup
globalFilters :: Prelude.Maybe PatchFilterGroup,
    -- | Defines the compliance level for approved patches. When an approved
    -- patch is reported as missing, this value describes the severity of the
    -- compliance violation.
    BaselineOverride -> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel :: Prelude.Maybe PatchComplianceLevel,
    -- | The action for Patch Manager to take on patches included in the
    -- @RejectedPackages@ list. A patch can be allowed only if it is a
    -- dependency of another package, or blocked entirely along with packages
    -- that include it as a dependency.
    BaselineOverride -> Maybe PatchAction
rejectedPatchesAction :: Prelude.Maybe PatchAction,
    -- | A list of explicitly approved patches for the baseline.
    --
    -- For information about accepted formats for lists of approved patches and
    -- rejected patches, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html About package name formats for approved and rejected patch lists>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    BaselineOverride -> Maybe [Text]
approvedPatches :: Prelude.Maybe [Prelude.Text],
    -- | Indicates whether the list of approved patches includes non-security
    -- updates that should be applied to the instances. The default value is
    -- @false@. Applies to Linux instances only.
    BaselineOverride -> Maybe Bool
approvedPatchesEnableNonSecurity :: Prelude.Maybe Prelude.Bool,
    -- | A list of explicitly rejected patches for the baseline.
    --
    -- For information about accepted formats for lists of approved patches and
    -- rejected patches, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html About package name formats for approved and rejected patch lists>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    BaselineOverride -> Maybe [Text]
rejectedPatches :: Prelude.Maybe [Prelude.Text],
    -- | Information about the patches to use to update the instances, including
    -- target operating systems and source repositories. Applies to Linux
    -- instances only.
    BaselineOverride -> Maybe [PatchSource]
sources :: Prelude.Maybe [PatchSource]
  }
  deriving (BaselineOverride -> BaselineOverride -> Bool
(BaselineOverride -> BaselineOverride -> Bool)
-> (BaselineOverride -> BaselineOverride -> Bool)
-> Eq BaselineOverride
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BaselineOverride -> BaselineOverride -> Bool
$c/= :: BaselineOverride -> BaselineOverride -> Bool
== :: BaselineOverride -> BaselineOverride -> Bool
$c== :: BaselineOverride -> BaselineOverride -> Bool
Prelude.Eq, Int -> BaselineOverride -> ShowS
[BaselineOverride] -> ShowS
BaselineOverride -> String
(Int -> BaselineOverride -> ShowS)
-> (BaselineOverride -> String)
-> ([BaselineOverride] -> ShowS)
-> Show BaselineOverride
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BaselineOverride] -> ShowS
$cshowList :: [BaselineOverride] -> ShowS
show :: BaselineOverride -> String
$cshow :: BaselineOverride -> String
showsPrec :: Int -> BaselineOverride -> ShowS
$cshowsPrec :: Int -> BaselineOverride -> ShowS
Prelude.Show, (forall x. BaselineOverride -> Rep BaselineOverride x)
-> (forall x. Rep BaselineOverride x -> BaselineOverride)
-> Generic BaselineOverride
forall x. Rep BaselineOverride x -> BaselineOverride
forall x. BaselineOverride -> Rep BaselineOverride x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BaselineOverride x -> BaselineOverride
$cfrom :: forall x. BaselineOverride -> Rep BaselineOverride x
Prelude.Generic)

-- |
-- Create a value of 'BaselineOverride' 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:
--
-- 'approvalRules', 'baselineOverride_approvalRules' - Undocumented member.
--
-- 'operatingSystem', 'baselineOverride_operatingSystem' - The operating system rule used by the patch baseline override.
--
-- 'globalFilters', 'baselineOverride_globalFilters' - Undocumented member.
--
-- 'approvedPatchesComplianceLevel', 'baselineOverride_approvedPatchesComplianceLevel' - Defines the compliance level for approved patches. When an approved
-- patch is reported as missing, this value describes the severity of the
-- compliance violation.
--
-- 'rejectedPatchesAction', 'baselineOverride_rejectedPatchesAction' - The action for Patch Manager to take on patches included in the
-- @RejectedPackages@ list. A patch can be allowed only if it is a
-- dependency of another package, or blocked entirely along with packages
-- that include it as a dependency.
--
-- 'approvedPatches', 'baselineOverride_approvedPatches' - A list of explicitly approved patches for the baseline.
--
-- For information about accepted formats for lists of approved patches and
-- rejected patches, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html About package name formats for approved and rejected patch lists>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'approvedPatchesEnableNonSecurity', 'baselineOverride_approvedPatchesEnableNonSecurity' - Indicates whether the list of approved patches includes non-security
-- updates that should be applied to the instances. The default value is
-- @false@. Applies to Linux instances only.
--
-- 'rejectedPatches', 'baselineOverride_rejectedPatches' - A list of explicitly rejected patches for the baseline.
--
-- For information about accepted formats for lists of approved patches and
-- rejected patches, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html About package name formats for approved and rejected patch lists>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'sources', 'baselineOverride_sources' - Information about the patches to use to update the instances, including
-- target operating systems and source repositories. Applies to Linux
-- instances only.
newBaselineOverride ::
  BaselineOverride
newBaselineOverride :: BaselineOverride
newBaselineOverride =
  BaselineOverride' :: Maybe PatchRuleGroup
-> Maybe OperatingSystem
-> Maybe PatchFilterGroup
-> Maybe PatchComplianceLevel
-> Maybe PatchAction
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe [PatchSource]
-> BaselineOverride
BaselineOverride'
    { $sel:approvalRules:BaselineOverride' :: Maybe PatchRuleGroup
approvalRules = Maybe PatchRuleGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:operatingSystem:BaselineOverride' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
forall a. Maybe a
Prelude.Nothing,
      $sel:globalFilters:BaselineOverride' :: Maybe PatchFilterGroup
globalFilters = Maybe PatchFilterGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatchesComplianceLevel:BaselineOverride' :: Maybe PatchComplianceLevel
approvedPatchesComplianceLevel = Maybe PatchComplianceLevel
forall a. Maybe a
Prelude.Nothing,
      $sel:rejectedPatchesAction:BaselineOverride' :: Maybe PatchAction
rejectedPatchesAction = Maybe PatchAction
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatches:BaselineOverride' :: Maybe [Text]
approvedPatches = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatchesEnableNonSecurity:BaselineOverride' :: Maybe Bool
approvedPatchesEnableNonSecurity = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:rejectedPatches:BaselineOverride' :: Maybe [Text]
rejectedPatches = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:sources:BaselineOverride' :: Maybe [PatchSource]
sources = Maybe [PatchSource]
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
baselineOverride_approvalRules :: Lens.Lens' BaselineOverride (Prelude.Maybe PatchRuleGroup)
baselineOverride_approvalRules :: (Maybe PatchRuleGroup -> f (Maybe PatchRuleGroup))
-> BaselineOverride -> f BaselineOverride
baselineOverride_approvalRules = (BaselineOverride -> Maybe PatchRuleGroup)
-> (BaselineOverride -> Maybe PatchRuleGroup -> BaselineOverride)
-> Lens
     BaselineOverride
     BaselineOverride
     (Maybe PatchRuleGroup)
     (Maybe PatchRuleGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe PatchRuleGroup
approvalRules :: Maybe PatchRuleGroup
$sel:approvalRules:BaselineOverride' :: BaselineOverride -> Maybe PatchRuleGroup
approvalRules} -> Maybe PatchRuleGroup
approvalRules) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe PatchRuleGroup
a -> BaselineOverride
s {$sel:approvalRules:BaselineOverride' :: Maybe PatchRuleGroup
approvalRules = Maybe PatchRuleGroup
a} :: BaselineOverride)

-- | The operating system rule used by the patch baseline override.
baselineOverride_operatingSystem :: Lens.Lens' BaselineOverride (Prelude.Maybe OperatingSystem)
baselineOverride_operatingSystem :: (Maybe OperatingSystem -> f (Maybe OperatingSystem))
-> BaselineOverride -> f BaselineOverride
baselineOverride_operatingSystem = (BaselineOverride -> Maybe OperatingSystem)
-> (BaselineOverride -> Maybe OperatingSystem -> BaselineOverride)
-> Lens
     BaselineOverride
     BaselineOverride
     (Maybe OperatingSystem)
     (Maybe OperatingSystem)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
$sel:operatingSystem:BaselineOverride' :: BaselineOverride -> Maybe OperatingSystem
operatingSystem} -> Maybe OperatingSystem
operatingSystem) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe OperatingSystem
a -> BaselineOverride
s {$sel:operatingSystem:BaselineOverride' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
a} :: BaselineOverride)

-- | Undocumented member.
baselineOverride_globalFilters :: Lens.Lens' BaselineOverride (Prelude.Maybe PatchFilterGroup)
baselineOverride_globalFilters :: (Maybe PatchFilterGroup -> f (Maybe PatchFilterGroup))
-> BaselineOverride -> f BaselineOverride
baselineOverride_globalFilters = (BaselineOverride -> Maybe PatchFilterGroup)
-> (BaselineOverride -> Maybe PatchFilterGroup -> BaselineOverride)
-> Lens
     BaselineOverride
     BaselineOverride
     (Maybe PatchFilterGroup)
     (Maybe PatchFilterGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe PatchFilterGroup
globalFilters :: Maybe PatchFilterGroup
$sel:globalFilters:BaselineOverride' :: BaselineOverride -> Maybe PatchFilterGroup
globalFilters} -> Maybe PatchFilterGroup
globalFilters) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe PatchFilterGroup
a -> BaselineOverride
s {$sel:globalFilters:BaselineOverride' :: Maybe PatchFilterGroup
globalFilters = Maybe PatchFilterGroup
a} :: BaselineOverride)

-- | Defines the compliance level for approved patches. When an approved
-- patch is reported as missing, this value describes the severity of the
-- compliance violation.
baselineOverride_approvedPatchesComplianceLevel :: Lens.Lens' BaselineOverride (Prelude.Maybe PatchComplianceLevel)
baselineOverride_approvedPatchesComplianceLevel :: (Maybe PatchComplianceLevel -> f (Maybe PatchComplianceLevel))
-> BaselineOverride -> f BaselineOverride
baselineOverride_approvedPatchesComplianceLevel = (BaselineOverride -> Maybe PatchComplianceLevel)
-> (BaselineOverride
    -> Maybe PatchComplianceLevel -> BaselineOverride)
-> Lens
     BaselineOverride
     BaselineOverride
     (Maybe PatchComplianceLevel)
     (Maybe PatchComplianceLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe PatchComplianceLevel
approvedPatchesComplianceLevel :: Maybe PatchComplianceLevel
$sel:approvedPatchesComplianceLevel:BaselineOverride' :: BaselineOverride -> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel} -> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe PatchComplianceLevel
a -> BaselineOverride
s {$sel:approvedPatchesComplianceLevel:BaselineOverride' :: Maybe PatchComplianceLevel
approvedPatchesComplianceLevel = Maybe PatchComplianceLevel
a} :: BaselineOverride)

-- | The action for Patch Manager to take on patches included in the
-- @RejectedPackages@ list. A patch can be allowed only if it is a
-- dependency of another package, or blocked entirely along with packages
-- that include it as a dependency.
baselineOverride_rejectedPatchesAction :: Lens.Lens' BaselineOverride (Prelude.Maybe PatchAction)
baselineOverride_rejectedPatchesAction :: (Maybe PatchAction -> f (Maybe PatchAction))
-> BaselineOverride -> f BaselineOverride
baselineOverride_rejectedPatchesAction = (BaselineOverride -> Maybe PatchAction)
-> (BaselineOverride -> Maybe PatchAction -> BaselineOverride)
-> Lens
     BaselineOverride
     BaselineOverride
     (Maybe PatchAction)
     (Maybe PatchAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe PatchAction
rejectedPatchesAction :: Maybe PatchAction
$sel:rejectedPatchesAction:BaselineOverride' :: BaselineOverride -> Maybe PatchAction
rejectedPatchesAction} -> Maybe PatchAction
rejectedPatchesAction) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe PatchAction
a -> BaselineOverride
s {$sel:rejectedPatchesAction:BaselineOverride' :: Maybe PatchAction
rejectedPatchesAction = Maybe PatchAction
a} :: BaselineOverride)

-- | A list of explicitly approved patches for the baseline.
--
-- For information about accepted formats for lists of approved patches and
-- rejected patches, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html About package name formats for approved and rejected patch lists>
-- in the /Amazon Web Services Systems Manager User Guide/.
baselineOverride_approvedPatches :: Lens.Lens' BaselineOverride (Prelude.Maybe [Prelude.Text])
baselineOverride_approvedPatches :: (Maybe [Text] -> f (Maybe [Text]))
-> BaselineOverride -> f BaselineOverride
baselineOverride_approvedPatches = (BaselineOverride -> Maybe [Text])
-> (BaselineOverride -> Maybe [Text] -> BaselineOverride)
-> Lens
     BaselineOverride BaselineOverride (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe [Text]
approvedPatches :: Maybe [Text]
$sel:approvedPatches:BaselineOverride' :: BaselineOverride -> Maybe [Text]
approvedPatches} -> Maybe [Text]
approvedPatches) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe [Text]
a -> BaselineOverride
s {$sel:approvedPatches:BaselineOverride' :: Maybe [Text]
approvedPatches = Maybe [Text]
a} :: BaselineOverride) ((Maybe [Text] -> f (Maybe [Text]))
 -> BaselineOverride -> f BaselineOverride)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BaselineOverride
-> f BaselineOverride
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether the list of approved patches includes non-security
-- updates that should be applied to the instances. The default value is
-- @false@. Applies to Linux instances only.
baselineOverride_approvedPatchesEnableNonSecurity :: Lens.Lens' BaselineOverride (Prelude.Maybe Prelude.Bool)
baselineOverride_approvedPatchesEnableNonSecurity :: (Maybe Bool -> f (Maybe Bool))
-> BaselineOverride -> f BaselineOverride
baselineOverride_approvedPatchesEnableNonSecurity = (BaselineOverride -> Maybe Bool)
-> (BaselineOverride -> Maybe Bool -> BaselineOverride)
-> Lens BaselineOverride BaselineOverride (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe Bool
approvedPatchesEnableNonSecurity :: Maybe Bool
$sel:approvedPatchesEnableNonSecurity:BaselineOverride' :: BaselineOverride -> Maybe Bool
approvedPatchesEnableNonSecurity} -> Maybe Bool
approvedPatchesEnableNonSecurity) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe Bool
a -> BaselineOverride
s {$sel:approvedPatchesEnableNonSecurity:BaselineOverride' :: Maybe Bool
approvedPatchesEnableNonSecurity = Maybe Bool
a} :: BaselineOverride)

-- | A list of explicitly rejected patches for the baseline.
--
-- For information about accepted formats for lists of approved patches and
-- rejected patches, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html About package name formats for approved and rejected patch lists>
-- in the /Amazon Web Services Systems Manager User Guide/.
baselineOverride_rejectedPatches :: Lens.Lens' BaselineOverride (Prelude.Maybe [Prelude.Text])
baselineOverride_rejectedPatches :: (Maybe [Text] -> f (Maybe [Text]))
-> BaselineOverride -> f BaselineOverride
baselineOverride_rejectedPatches = (BaselineOverride -> Maybe [Text])
-> (BaselineOverride -> Maybe [Text] -> BaselineOverride)
-> Lens
     BaselineOverride BaselineOverride (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe [Text]
rejectedPatches :: Maybe [Text]
$sel:rejectedPatches:BaselineOverride' :: BaselineOverride -> Maybe [Text]
rejectedPatches} -> Maybe [Text]
rejectedPatches) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe [Text]
a -> BaselineOverride
s {$sel:rejectedPatches:BaselineOverride' :: Maybe [Text]
rejectedPatches = Maybe [Text]
a} :: BaselineOverride) ((Maybe [Text] -> f (Maybe [Text]))
 -> BaselineOverride -> f BaselineOverride)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BaselineOverride
-> f BaselineOverride
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the patches to use to update the instances, including
-- target operating systems and source repositories. Applies to Linux
-- instances only.
baselineOverride_sources :: Lens.Lens' BaselineOverride (Prelude.Maybe [PatchSource])
baselineOverride_sources :: (Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> BaselineOverride -> f BaselineOverride
baselineOverride_sources = (BaselineOverride -> Maybe [PatchSource])
-> (BaselineOverride -> Maybe [PatchSource] -> BaselineOverride)
-> Lens
     BaselineOverride
     BaselineOverride
     (Maybe [PatchSource])
     (Maybe [PatchSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaselineOverride' {Maybe [PatchSource]
sources :: Maybe [PatchSource]
$sel:sources:BaselineOverride' :: BaselineOverride -> Maybe [PatchSource]
sources} -> Maybe [PatchSource]
sources) (\s :: BaselineOverride
s@BaselineOverride' {} Maybe [PatchSource]
a -> BaselineOverride
s {$sel:sources:BaselineOverride' :: Maybe [PatchSource]
sources = Maybe [PatchSource]
a} :: BaselineOverride) ((Maybe [PatchSource] -> f (Maybe [PatchSource]))
 -> BaselineOverride -> f BaselineOverride)
-> ((Maybe [PatchSource] -> f (Maybe [PatchSource]))
    -> Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> (Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> BaselineOverride
-> f BaselineOverride
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [PatchSource] [PatchSource] [PatchSource] [PatchSource]
-> Iso
     (Maybe [PatchSource])
     (Maybe [PatchSource])
     (Maybe [PatchSource])
     (Maybe [PatchSource])
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 [PatchSource] [PatchSource] [PatchSource] [PatchSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable BaselineOverride

instance Prelude.NFData BaselineOverride

instance Core.ToJSON BaselineOverride where
  toJSON :: BaselineOverride -> Value
toJSON BaselineOverride' {Maybe Bool
Maybe [Text]
Maybe [PatchSource]
Maybe OperatingSystem
Maybe PatchAction
Maybe PatchComplianceLevel
Maybe PatchFilterGroup
Maybe PatchRuleGroup
sources :: Maybe [PatchSource]
rejectedPatches :: Maybe [Text]
approvedPatchesEnableNonSecurity :: Maybe Bool
approvedPatches :: Maybe [Text]
rejectedPatchesAction :: Maybe PatchAction
approvedPatchesComplianceLevel :: Maybe PatchComplianceLevel
globalFilters :: Maybe PatchFilterGroup
operatingSystem :: Maybe OperatingSystem
approvalRules :: Maybe PatchRuleGroup
$sel:sources:BaselineOverride' :: BaselineOverride -> Maybe [PatchSource]
$sel:rejectedPatches:BaselineOverride' :: BaselineOverride -> Maybe [Text]
$sel:approvedPatchesEnableNonSecurity:BaselineOverride' :: BaselineOverride -> Maybe Bool
$sel:approvedPatches:BaselineOverride' :: BaselineOverride -> Maybe [Text]
$sel:rejectedPatchesAction:BaselineOverride' :: BaselineOverride -> Maybe PatchAction
$sel:approvedPatchesComplianceLevel:BaselineOverride' :: BaselineOverride -> Maybe PatchComplianceLevel
$sel:globalFilters:BaselineOverride' :: BaselineOverride -> Maybe PatchFilterGroup
$sel:operatingSystem:BaselineOverride' :: BaselineOverride -> Maybe OperatingSystem
$sel:approvalRules:BaselineOverride' :: BaselineOverride -> Maybe PatchRuleGroup
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ApprovalRules" Text -> PatchRuleGroup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PatchRuleGroup -> Pair) -> Maybe PatchRuleGroup -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PatchRuleGroup
approvalRules,
            (Text
"OperatingSystem" Text -> OperatingSystem -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (OperatingSystem -> Pair) -> Maybe OperatingSystem -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OperatingSystem
operatingSystem,
            (Text
"GlobalFilters" Text -> PatchFilterGroup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PatchFilterGroup -> Pair) -> Maybe PatchFilterGroup -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PatchFilterGroup
globalFilters,
            (Text
"ApprovedPatchesComplianceLevel" Text -> PatchComplianceLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PatchComplianceLevel -> Pair)
-> Maybe PatchComplianceLevel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel,
            (Text
"RejectedPatchesAction" Text -> PatchAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PatchAction -> Pair) -> Maybe PatchAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PatchAction
rejectedPatchesAction,
            (Text
"ApprovedPatches" 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]
approvedPatches,
            (Text
"ApprovedPatchesEnableNonSecurity" 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
approvedPatchesEnableNonSecurity,
            (Text
"RejectedPatches" 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]
rejectedPatches,
            (Text
"Sources" Text -> [PatchSource] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([PatchSource] -> Pair) -> Maybe [PatchSource] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PatchSource]
sources
          ]
      )