{-# 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.CreatePatchBaseline
-- 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)
--
-- Creates a patch baseline.
--
-- For information about valid key-value pairs in @PatchFilters@ for each
-- supported operating system type, see PatchFilter.
module Amazonka.SSM.CreatePatchBaseline
  ( -- * Creating a Request
    CreatePatchBaseline (..),
    newCreatePatchBaseline,

    -- * Request Lenses
    createPatchBaseline_approvalRules,
    createPatchBaseline_clientToken,
    createPatchBaseline_operatingSystem,
    createPatchBaseline_globalFilters,
    createPatchBaseline_approvedPatchesComplianceLevel,
    createPatchBaseline_rejectedPatchesAction,
    createPatchBaseline_approvedPatches,
    createPatchBaseline_approvedPatchesEnableNonSecurity,
    createPatchBaseline_rejectedPatches,
    createPatchBaseline_sources,
    createPatchBaseline_description,
    createPatchBaseline_tags,
    createPatchBaseline_name,

    -- * Destructuring the Response
    CreatePatchBaselineResponse (..),
    newCreatePatchBaselineResponse,

    -- * Response Lenses
    createPatchBaselineResponse_baselineId,
    createPatchBaselineResponse_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:/ 'newCreatePatchBaseline' smart constructor.
data CreatePatchBaseline = CreatePatchBaseline'
  { -- | A set of rules used to include patches in the baseline.
    CreatePatchBaseline -> Maybe PatchRuleGroup
approvalRules :: Prelude.Maybe PatchRuleGroup,
    -- | User-provided idempotency token.
    CreatePatchBaseline -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Defines the operating system the patch baseline applies to. The default
    -- value is @WINDOWS@.
    CreatePatchBaseline -> Maybe OperatingSystem
operatingSystem :: Prelude.Maybe OperatingSystem,
    -- | A set of global filters used to include patches in the baseline.
    CreatePatchBaseline -> 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. The default value is @UNSPECIFIED@.
    CreatePatchBaseline -> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel :: Prelude.Maybe PatchComplianceLevel,
    -- | The action for Patch Manager to take on patches included in the
    -- @RejectedPackages@ list.
    --
    -- -   __@ALLOW_AS_DEPENDENCY@__ : A package in the @Rejected@ patches list
    --     is installed only if it is a dependency of another package. It is
    --     considered compliant with the patch baseline, and its status is
    --     reported as @InstalledOther@. This is the default action if no
    --     option is specified.
    --
    -- -   __@BLOCK@__ : Packages in the @RejectedPatches@ list, and packages
    --     that include them as dependencies, aren\'t installed under any
    --     circumstances. If a package was installed before it was added to the
    --     Rejected patches list, it is considered non-compliant with the patch
    --     baseline, and its status is reported as @InstalledRejected@.
    CreatePatchBaseline -> 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/.
    CreatePatchBaseline -> 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.
    CreatePatchBaseline -> 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/.
    CreatePatchBaseline -> 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.
    CreatePatchBaseline -> Maybe [PatchSource]
sources :: Prelude.Maybe [PatchSource],
    -- | A description of the patch baseline.
    CreatePatchBaseline -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Optional metadata that you assign to a resource. Tags enable you to
    -- categorize a resource in different ways, such as by purpose, owner, or
    -- environment. For example, you might want to tag a patch baseline to
    -- identify the severity level of patches it specifies and the operating
    -- system family it applies to. In this case, you could specify the
    -- following key-value pairs:
    --
    -- -   @Key=PatchSeverity,Value=Critical@
    --
    -- -   @Key=OS,Value=Windows@
    --
    -- To add tags to an existing patch baseline, use the AddTagsToResource
    -- operation.
    CreatePatchBaseline -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the patch baseline.
    CreatePatchBaseline -> Text
name :: Prelude.Text
  }
  deriving (CreatePatchBaseline -> CreatePatchBaseline -> Bool
(CreatePatchBaseline -> CreatePatchBaseline -> Bool)
-> (CreatePatchBaseline -> CreatePatchBaseline -> Bool)
-> Eq CreatePatchBaseline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePatchBaseline -> CreatePatchBaseline -> Bool
$c/= :: CreatePatchBaseline -> CreatePatchBaseline -> Bool
== :: CreatePatchBaseline -> CreatePatchBaseline -> Bool
$c== :: CreatePatchBaseline -> CreatePatchBaseline -> Bool
Prelude.Eq, Int -> CreatePatchBaseline -> ShowS
[CreatePatchBaseline] -> ShowS
CreatePatchBaseline -> String
(Int -> CreatePatchBaseline -> ShowS)
-> (CreatePatchBaseline -> String)
-> ([CreatePatchBaseline] -> ShowS)
-> Show CreatePatchBaseline
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePatchBaseline] -> ShowS
$cshowList :: [CreatePatchBaseline] -> ShowS
show :: CreatePatchBaseline -> String
$cshow :: CreatePatchBaseline -> String
showsPrec :: Int -> CreatePatchBaseline -> ShowS
$cshowsPrec :: Int -> CreatePatchBaseline -> ShowS
Prelude.Show, (forall x. CreatePatchBaseline -> Rep CreatePatchBaseline x)
-> (forall x. Rep CreatePatchBaseline x -> CreatePatchBaseline)
-> Generic CreatePatchBaseline
forall x. Rep CreatePatchBaseline x -> CreatePatchBaseline
forall x. CreatePatchBaseline -> Rep CreatePatchBaseline x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePatchBaseline x -> CreatePatchBaseline
$cfrom :: forall x. CreatePatchBaseline -> Rep CreatePatchBaseline x
Prelude.Generic)

-- |
-- Create a value of 'CreatePatchBaseline' 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', 'createPatchBaseline_approvalRules' - A set of rules used to include patches in the baseline.
--
-- 'clientToken', 'createPatchBaseline_clientToken' - User-provided idempotency token.
--
-- 'operatingSystem', 'createPatchBaseline_operatingSystem' - Defines the operating system the patch baseline applies to. The default
-- value is @WINDOWS@.
--
-- 'globalFilters', 'createPatchBaseline_globalFilters' - A set of global filters used to include patches in the baseline.
--
-- 'approvedPatchesComplianceLevel', 'createPatchBaseline_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. The default value is @UNSPECIFIED@.
--
-- 'rejectedPatchesAction', 'createPatchBaseline_rejectedPatchesAction' - The action for Patch Manager to take on patches included in the
-- @RejectedPackages@ list.
--
-- -   __@ALLOW_AS_DEPENDENCY@__ : A package in the @Rejected@ patches list
--     is installed only if it is a dependency of another package. It is
--     considered compliant with the patch baseline, and its status is
--     reported as @InstalledOther@. This is the default action if no
--     option is specified.
--
-- -   __@BLOCK@__ : Packages in the @RejectedPatches@ list, and packages
--     that include them as dependencies, aren\'t installed under any
--     circumstances. If a package was installed before it was added to the
--     Rejected patches list, it is considered non-compliant with the patch
--     baseline, and its status is reported as @InstalledRejected@.
--
-- 'approvedPatches', 'createPatchBaseline_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', 'createPatchBaseline_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', 'createPatchBaseline_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', 'createPatchBaseline_sources' - Information about the patches to use to update the instances, including
-- target operating systems and source repositories. Applies to Linux
-- instances only.
--
-- 'description', 'createPatchBaseline_description' - A description of the patch baseline.
--
-- 'tags', 'createPatchBaseline_tags' - Optional metadata that you assign to a resource. Tags enable you to
-- categorize a resource in different ways, such as by purpose, owner, or
-- environment. For example, you might want to tag a patch baseline to
-- identify the severity level of patches it specifies and the operating
-- system family it applies to. In this case, you could specify the
-- following key-value pairs:
--
-- -   @Key=PatchSeverity,Value=Critical@
--
-- -   @Key=OS,Value=Windows@
--
-- To add tags to an existing patch baseline, use the AddTagsToResource
-- operation.
--
-- 'name', 'createPatchBaseline_name' - The name of the patch baseline.
newCreatePatchBaseline ::
  -- | 'name'
  Prelude.Text ->
  CreatePatchBaseline
newCreatePatchBaseline :: Text -> CreatePatchBaseline
newCreatePatchBaseline Text
pName_ =
  CreatePatchBaseline' :: Maybe PatchRuleGroup
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe PatchFilterGroup
-> Maybe PatchComplianceLevel
-> Maybe PatchAction
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe [PatchSource]
-> Maybe Text
-> Maybe [Tag]
-> Text
-> CreatePatchBaseline
CreatePatchBaseline'
    { $sel:approvalRules:CreatePatchBaseline' :: Maybe PatchRuleGroup
approvalRules =
        Maybe PatchRuleGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:CreatePatchBaseline' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operatingSystem:CreatePatchBaseline' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
forall a. Maybe a
Prelude.Nothing,
      $sel:globalFilters:CreatePatchBaseline' :: Maybe PatchFilterGroup
globalFilters = Maybe PatchFilterGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatchesComplianceLevel:CreatePatchBaseline' :: Maybe PatchComplianceLevel
approvedPatchesComplianceLevel = Maybe PatchComplianceLevel
forall a. Maybe a
Prelude.Nothing,
      $sel:rejectedPatchesAction:CreatePatchBaseline' :: Maybe PatchAction
rejectedPatchesAction = Maybe PatchAction
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatches:CreatePatchBaseline' :: Maybe [Text]
approvedPatches = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatchesEnableNonSecurity:CreatePatchBaseline' :: Maybe Bool
approvedPatchesEnableNonSecurity = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:rejectedPatches:CreatePatchBaseline' :: Maybe [Text]
rejectedPatches = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:sources:CreatePatchBaseline' :: Maybe [PatchSource]
sources = Maybe [PatchSource]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreatePatchBaseline' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreatePatchBaseline' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreatePatchBaseline' :: Text
name = Text
pName_
    }

-- | A set of rules used to include patches in the baseline.
createPatchBaseline_approvalRules :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe PatchRuleGroup)
createPatchBaseline_approvalRules :: (Maybe PatchRuleGroup -> f (Maybe PatchRuleGroup))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_approvalRules = (CreatePatchBaseline -> Maybe PatchRuleGroup)
-> (CreatePatchBaseline
    -> Maybe PatchRuleGroup -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline
     CreatePatchBaseline
     (Maybe PatchRuleGroup)
     (Maybe PatchRuleGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe PatchRuleGroup
approvalRules :: Maybe PatchRuleGroup
$sel:approvalRules:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe PatchRuleGroup
approvalRules} -> Maybe PatchRuleGroup
approvalRules) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe PatchRuleGroup
a -> CreatePatchBaseline
s {$sel:approvalRules:CreatePatchBaseline' :: Maybe PatchRuleGroup
approvalRules = Maybe PatchRuleGroup
a} :: CreatePatchBaseline)

-- | User-provided idempotency token.
createPatchBaseline_clientToken :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe Prelude.Text)
createPatchBaseline_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_clientToken = (CreatePatchBaseline -> Maybe Text)
-> (CreatePatchBaseline -> Maybe Text -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline CreatePatchBaseline (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe Text
a -> CreatePatchBaseline
s {$sel:clientToken:CreatePatchBaseline' :: Maybe Text
clientToken = Maybe Text
a} :: CreatePatchBaseline)

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

-- | A set of global filters used to include patches in the baseline.
createPatchBaseline_globalFilters :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe PatchFilterGroup)
createPatchBaseline_globalFilters :: (Maybe PatchFilterGroup -> f (Maybe PatchFilterGroup))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_globalFilters = (CreatePatchBaseline -> Maybe PatchFilterGroup)
-> (CreatePatchBaseline
    -> Maybe PatchFilterGroup -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline
     CreatePatchBaseline
     (Maybe PatchFilterGroup)
     (Maybe PatchFilterGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe PatchFilterGroup
globalFilters :: Maybe PatchFilterGroup
$sel:globalFilters:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe PatchFilterGroup
globalFilters} -> Maybe PatchFilterGroup
globalFilters) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe PatchFilterGroup
a -> CreatePatchBaseline
s {$sel:globalFilters:CreatePatchBaseline' :: Maybe PatchFilterGroup
globalFilters = Maybe PatchFilterGroup
a} :: CreatePatchBaseline)

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

-- | The action for Patch Manager to take on patches included in the
-- @RejectedPackages@ list.
--
-- -   __@ALLOW_AS_DEPENDENCY@__ : A package in the @Rejected@ patches list
--     is installed only if it is a dependency of another package. It is
--     considered compliant with the patch baseline, and its status is
--     reported as @InstalledOther@. This is the default action if no
--     option is specified.
--
-- -   __@BLOCK@__ : Packages in the @RejectedPatches@ list, and packages
--     that include them as dependencies, aren\'t installed under any
--     circumstances. If a package was installed before it was added to the
--     Rejected patches list, it is considered non-compliant with the patch
--     baseline, and its status is reported as @InstalledRejected@.
createPatchBaseline_rejectedPatchesAction :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe PatchAction)
createPatchBaseline_rejectedPatchesAction :: (Maybe PatchAction -> f (Maybe PatchAction))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_rejectedPatchesAction = (CreatePatchBaseline -> Maybe PatchAction)
-> (CreatePatchBaseline
    -> Maybe PatchAction -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline
     CreatePatchBaseline
     (Maybe PatchAction)
     (Maybe PatchAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe PatchAction
rejectedPatchesAction :: Maybe PatchAction
$sel:rejectedPatchesAction:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe PatchAction
rejectedPatchesAction} -> Maybe PatchAction
rejectedPatchesAction) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe PatchAction
a -> CreatePatchBaseline
s {$sel:rejectedPatchesAction:CreatePatchBaseline' :: Maybe PatchAction
rejectedPatchesAction = Maybe PatchAction
a} :: CreatePatchBaseline)

-- | 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/.
createPatchBaseline_approvedPatches :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe [Prelude.Text])
createPatchBaseline_approvedPatches :: (Maybe [Text] -> f (Maybe [Text]))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_approvedPatches = (CreatePatchBaseline -> Maybe [Text])
-> (CreatePatchBaseline -> Maybe [Text] -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline
     CreatePatchBaseline
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe [Text]
approvedPatches :: Maybe [Text]
$sel:approvedPatches:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [Text]
approvedPatches} -> Maybe [Text]
approvedPatches) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe [Text]
a -> CreatePatchBaseline
s {$sel:approvedPatches:CreatePatchBaseline' :: Maybe [Text]
approvedPatches = Maybe [Text]
a} :: CreatePatchBaseline) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreatePatchBaseline -> f CreatePatchBaseline)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreatePatchBaseline
-> f CreatePatchBaseline
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.
createPatchBaseline_approvedPatchesEnableNonSecurity :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe Prelude.Bool)
createPatchBaseline_approvedPatchesEnableNonSecurity :: (Maybe Bool -> f (Maybe Bool))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_approvedPatchesEnableNonSecurity = (CreatePatchBaseline -> Maybe Bool)
-> (CreatePatchBaseline -> Maybe Bool -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline CreatePatchBaseline (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe Bool
approvedPatchesEnableNonSecurity :: Maybe Bool
$sel:approvedPatchesEnableNonSecurity:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe Bool
approvedPatchesEnableNonSecurity} -> Maybe Bool
approvedPatchesEnableNonSecurity) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe Bool
a -> CreatePatchBaseline
s {$sel:approvedPatchesEnableNonSecurity:CreatePatchBaseline' :: Maybe Bool
approvedPatchesEnableNonSecurity = Maybe Bool
a} :: CreatePatchBaseline)

-- | 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/.
createPatchBaseline_rejectedPatches :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe [Prelude.Text])
createPatchBaseline_rejectedPatches :: (Maybe [Text] -> f (Maybe [Text]))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_rejectedPatches = (CreatePatchBaseline -> Maybe [Text])
-> (CreatePatchBaseline -> Maybe [Text] -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline
     CreatePatchBaseline
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe [Text]
rejectedPatches :: Maybe [Text]
$sel:rejectedPatches:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [Text]
rejectedPatches} -> Maybe [Text]
rejectedPatches) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe [Text]
a -> CreatePatchBaseline
s {$sel:rejectedPatches:CreatePatchBaseline' :: Maybe [Text]
rejectedPatches = Maybe [Text]
a} :: CreatePatchBaseline) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreatePatchBaseline -> f CreatePatchBaseline)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreatePatchBaseline
-> f CreatePatchBaseline
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.
createPatchBaseline_sources :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe [PatchSource])
createPatchBaseline_sources :: (Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_sources = (CreatePatchBaseline -> Maybe [PatchSource])
-> (CreatePatchBaseline
    -> Maybe [PatchSource] -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline
     CreatePatchBaseline
     (Maybe [PatchSource])
     (Maybe [PatchSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe [PatchSource]
sources :: Maybe [PatchSource]
$sel:sources:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [PatchSource]
sources} -> Maybe [PatchSource]
sources) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe [PatchSource]
a -> CreatePatchBaseline
s {$sel:sources:CreatePatchBaseline' :: Maybe [PatchSource]
sources = Maybe [PatchSource]
a} :: CreatePatchBaseline) ((Maybe [PatchSource] -> f (Maybe [PatchSource]))
 -> CreatePatchBaseline -> f CreatePatchBaseline)
-> ((Maybe [PatchSource] -> f (Maybe [PatchSource]))
    -> Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> (Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> CreatePatchBaseline
-> f CreatePatchBaseline
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

-- | A description of the patch baseline.
createPatchBaseline_description :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe Prelude.Text)
createPatchBaseline_description :: (Maybe Text -> f (Maybe Text))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_description = (CreatePatchBaseline -> Maybe Text)
-> (CreatePatchBaseline -> Maybe Text -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline CreatePatchBaseline (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe Text
description :: Maybe Text
$sel:description:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe Text
description} -> Maybe Text
description) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe Text
a -> CreatePatchBaseline
s {$sel:description:CreatePatchBaseline' :: Maybe Text
description = Maybe Text
a} :: CreatePatchBaseline)

-- | Optional metadata that you assign to a resource. Tags enable you to
-- categorize a resource in different ways, such as by purpose, owner, or
-- environment. For example, you might want to tag a patch baseline to
-- identify the severity level of patches it specifies and the operating
-- system family it applies to. In this case, you could specify the
-- following key-value pairs:
--
-- -   @Key=PatchSeverity,Value=Critical@
--
-- -   @Key=OS,Value=Windows@
--
-- To add tags to an existing patch baseline, use the AddTagsToResource
-- operation.
createPatchBaseline_tags :: Lens.Lens' CreatePatchBaseline (Prelude.Maybe [Tag])
createPatchBaseline_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreatePatchBaseline -> f CreatePatchBaseline
createPatchBaseline_tags = (CreatePatchBaseline -> Maybe [Tag])
-> (CreatePatchBaseline -> Maybe [Tag] -> CreatePatchBaseline)
-> Lens
     CreatePatchBaseline CreatePatchBaseline (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePatchBaseline' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreatePatchBaseline
s@CreatePatchBaseline' {} Maybe [Tag]
a -> CreatePatchBaseline
s {$sel:tags:CreatePatchBaseline' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreatePatchBaseline) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreatePatchBaseline -> f CreatePatchBaseline)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreatePatchBaseline
-> f CreatePatchBaseline
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData CreatePatchBaseline

instance Core.ToHeaders CreatePatchBaseline where
  toHeaders :: CreatePatchBaseline -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreatePatchBaseline -> 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.CreatePatchBaseline" ::
                          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 CreatePatchBaseline where
  toJSON :: CreatePatchBaseline -> Value
toJSON CreatePatchBaseline' {Maybe Bool
Maybe [Text]
Maybe [PatchSource]
Maybe [Tag]
Maybe Text
Maybe OperatingSystem
Maybe PatchAction
Maybe PatchComplianceLevel
Maybe PatchFilterGroup
Maybe PatchRuleGroup
Text
name :: Text
tags :: Maybe [Tag]
description :: Maybe Text
sources :: Maybe [PatchSource]
rejectedPatches :: Maybe [Text]
approvedPatchesEnableNonSecurity :: Maybe Bool
approvedPatches :: Maybe [Text]
rejectedPatchesAction :: Maybe PatchAction
approvedPatchesComplianceLevel :: Maybe PatchComplianceLevel
globalFilters :: Maybe PatchFilterGroup
operatingSystem :: Maybe OperatingSystem
clientToken :: Maybe Text
approvalRules :: Maybe PatchRuleGroup
$sel:name:CreatePatchBaseline' :: CreatePatchBaseline -> Text
$sel:tags:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [Tag]
$sel:description:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe Text
$sel:sources:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [PatchSource]
$sel:rejectedPatches:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [Text]
$sel:approvedPatchesEnableNonSecurity:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe Bool
$sel:approvedPatches:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe [Text]
$sel:rejectedPatchesAction:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe PatchAction
$sel:approvedPatchesComplianceLevel:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe PatchComplianceLevel
$sel:globalFilters:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe PatchFilterGroup
$sel:operatingSystem:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe OperatingSystem
$sel:clientToken:CreatePatchBaseline' :: CreatePatchBaseline -> Maybe Text
$sel:approvalRules:CreatePatchBaseline' :: CreatePatchBaseline -> 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
"ClientToken" 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
clientToken,
            (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,
            (Text
"Description" 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
description,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newCreatePatchBaselineResponse' smart constructor.
data CreatePatchBaselineResponse = CreatePatchBaselineResponse'
  { -- | The ID of the created patch baseline.
    CreatePatchBaselineResponse -> Maybe Text
baselineId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreatePatchBaselineResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreatePatchBaselineResponse -> CreatePatchBaselineResponse -> Bool
(CreatePatchBaselineResponse
 -> CreatePatchBaselineResponse -> Bool)
-> (CreatePatchBaselineResponse
    -> CreatePatchBaselineResponse -> Bool)
-> Eq CreatePatchBaselineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePatchBaselineResponse -> CreatePatchBaselineResponse -> Bool
$c/= :: CreatePatchBaselineResponse -> CreatePatchBaselineResponse -> Bool
== :: CreatePatchBaselineResponse -> CreatePatchBaselineResponse -> Bool
$c== :: CreatePatchBaselineResponse -> CreatePatchBaselineResponse -> Bool
Prelude.Eq, ReadPrec [CreatePatchBaselineResponse]
ReadPrec CreatePatchBaselineResponse
Int -> ReadS CreatePatchBaselineResponse
ReadS [CreatePatchBaselineResponse]
(Int -> ReadS CreatePatchBaselineResponse)
-> ReadS [CreatePatchBaselineResponse]
-> ReadPrec CreatePatchBaselineResponse
-> ReadPrec [CreatePatchBaselineResponse]
-> Read CreatePatchBaselineResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePatchBaselineResponse]
$creadListPrec :: ReadPrec [CreatePatchBaselineResponse]
readPrec :: ReadPrec CreatePatchBaselineResponse
$creadPrec :: ReadPrec CreatePatchBaselineResponse
readList :: ReadS [CreatePatchBaselineResponse]
$creadList :: ReadS [CreatePatchBaselineResponse]
readsPrec :: Int -> ReadS CreatePatchBaselineResponse
$creadsPrec :: Int -> ReadS CreatePatchBaselineResponse
Prelude.Read, Int -> CreatePatchBaselineResponse -> ShowS
[CreatePatchBaselineResponse] -> ShowS
CreatePatchBaselineResponse -> String
(Int -> CreatePatchBaselineResponse -> ShowS)
-> (CreatePatchBaselineResponse -> String)
-> ([CreatePatchBaselineResponse] -> ShowS)
-> Show CreatePatchBaselineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePatchBaselineResponse] -> ShowS
$cshowList :: [CreatePatchBaselineResponse] -> ShowS
show :: CreatePatchBaselineResponse -> String
$cshow :: CreatePatchBaselineResponse -> String
showsPrec :: Int -> CreatePatchBaselineResponse -> ShowS
$cshowsPrec :: Int -> CreatePatchBaselineResponse -> ShowS
Prelude.Show, (forall x.
 CreatePatchBaselineResponse -> Rep CreatePatchBaselineResponse x)
-> (forall x.
    Rep CreatePatchBaselineResponse x -> CreatePatchBaselineResponse)
-> Generic CreatePatchBaselineResponse
forall x.
Rep CreatePatchBaselineResponse x -> CreatePatchBaselineResponse
forall x.
CreatePatchBaselineResponse -> Rep CreatePatchBaselineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePatchBaselineResponse x -> CreatePatchBaselineResponse
$cfrom :: forall x.
CreatePatchBaselineResponse -> Rep CreatePatchBaselineResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreatePatchBaselineResponse' 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:
--
-- 'baselineId', 'createPatchBaselineResponse_baselineId' - The ID of the created patch baseline.
--
-- 'httpStatus', 'createPatchBaselineResponse_httpStatus' - The response's http status code.
newCreatePatchBaselineResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreatePatchBaselineResponse
newCreatePatchBaselineResponse :: Int -> CreatePatchBaselineResponse
newCreatePatchBaselineResponse Int
pHttpStatus_ =
  CreatePatchBaselineResponse' :: Maybe Text -> Int -> CreatePatchBaselineResponse
CreatePatchBaselineResponse'
    { $sel:baselineId:CreatePatchBaselineResponse' :: Maybe Text
baselineId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreatePatchBaselineResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData CreatePatchBaselineResponse