{-# 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.GetPatchBaseline
-- 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)
--
-- Retrieves information about a patch baseline.
module Amazonka.SSM.GetPatchBaseline
  ( -- * Creating a Request
    GetPatchBaseline (..),
    newGetPatchBaseline,

    -- * Request Lenses
    getPatchBaseline_baselineId,

    -- * Destructuring the Response
    GetPatchBaselineResponse (..),
    newGetPatchBaselineResponse,

    -- * Response Lenses
    getPatchBaselineResponse_approvalRules,
    getPatchBaselineResponse_operatingSystem,
    getPatchBaselineResponse_globalFilters,
    getPatchBaselineResponse_approvedPatchesComplianceLevel,
    getPatchBaselineResponse_rejectedPatchesAction,
    getPatchBaselineResponse_approvedPatches,
    getPatchBaselineResponse_approvedPatchesEnableNonSecurity,
    getPatchBaselineResponse_rejectedPatches,
    getPatchBaselineResponse_sources,
    getPatchBaselineResponse_createdDate,
    getPatchBaselineResponse_name,
    getPatchBaselineResponse_patchGroups,
    getPatchBaselineResponse_modifiedDate,
    getPatchBaselineResponse_description,
    getPatchBaselineResponse_baselineId,
    getPatchBaselineResponse_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:/ 'newGetPatchBaseline' smart constructor.
data GetPatchBaseline = GetPatchBaseline'
  { -- | The ID of the patch baseline to retrieve.
    --
    -- To retrieve information about an Amazon Web Services managed patch
    -- baseline, specify the full Amazon Resource Name (ARN) of the baseline.
    -- For example, for the baseline @AWS-AmazonLinuxDefaultPatchBaseline@,
    -- specify
    -- @arn:aws:ssm:us-east-2:733109147000:patchbaseline\/pb-0e392de35e7c563b7@
    -- instead of @pb-0e392de35e7c563b7@.
    GetPatchBaseline -> Text
baselineId :: Prelude.Text
  }
  deriving (GetPatchBaseline -> GetPatchBaseline -> Bool
(GetPatchBaseline -> GetPatchBaseline -> Bool)
-> (GetPatchBaseline -> GetPatchBaseline -> Bool)
-> Eq GetPatchBaseline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPatchBaseline -> GetPatchBaseline -> Bool
$c/= :: GetPatchBaseline -> GetPatchBaseline -> Bool
== :: GetPatchBaseline -> GetPatchBaseline -> Bool
$c== :: GetPatchBaseline -> GetPatchBaseline -> Bool
Prelude.Eq, ReadPrec [GetPatchBaseline]
ReadPrec GetPatchBaseline
Int -> ReadS GetPatchBaseline
ReadS [GetPatchBaseline]
(Int -> ReadS GetPatchBaseline)
-> ReadS [GetPatchBaseline]
-> ReadPrec GetPatchBaseline
-> ReadPrec [GetPatchBaseline]
-> Read GetPatchBaseline
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPatchBaseline]
$creadListPrec :: ReadPrec [GetPatchBaseline]
readPrec :: ReadPrec GetPatchBaseline
$creadPrec :: ReadPrec GetPatchBaseline
readList :: ReadS [GetPatchBaseline]
$creadList :: ReadS [GetPatchBaseline]
readsPrec :: Int -> ReadS GetPatchBaseline
$creadsPrec :: Int -> ReadS GetPatchBaseline
Prelude.Read, Int -> GetPatchBaseline -> ShowS
[GetPatchBaseline] -> ShowS
GetPatchBaseline -> String
(Int -> GetPatchBaseline -> ShowS)
-> (GetPatchBaseline -> String)
-> ([GetPatchBaseline] -> ShowS)
-> Show GetPatchBaseline
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPatchBaseline] -> ShowS
$cshowList :: [GetPatchBaseline] -> ShowS
show :: GetPatchBaseline -> String
$cshow :: GetPatchBaseline -> String
showsPrec :: Int -> GetPatchBaseline -> ShowS
$cshowsPrec :: Int -> GetPatchBaseline -> ShowS
Prelude.Show, (forall x. GetPatchBaseline -> Rep GetPatchBaseline x)
-> (forall x. Rep GetPatchBaseline x -> GetPatchBaseline)
-> Generic GetPatchBaseline
forall x. Rep GetPatchBaseline x -> GetPatchBaseline
forall x. GetPatchBaseline -> Rep GetPatchBaseline x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetPatchBaseline x -> GetPatchBaseline
$cfrom :: forall x. GetPatchBaseline -> Rep GetPatchBaseline x
Prelude.Generic)

-- |
-- Create a value of 'GetPatchBaseline' 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', 'getPatchBaseline_baselineId' - The ID of the patch baseline to retrieve.
--
-- To retrieve information about an Amazon Web Services managed patch
-- baseline, specify the full Amazon Resource Name (ARN) of the baseline.
-- For example, for the baseline @AWS-AmazonLinuxDefaultPatchBaseline@,
-- specify
-- @arn:aws:ssm:us-east-2:733109147000:patchbaseline\/pb-0e392de35e7c563b7@
-- instead of @pb-0e392de35e7c563b7@.
newGetPatchBaseline ::
  -- | 'baselineId'
  Prelude.Text ->
  GetPatchBaseline
newGetPatchBaseline :: Text -> GetPatchBaseline
newGetPatchBaseline Text
pBaselineId_ =
  GetPatchBaseline' :: Text -> GetPatchBaseline
GetPatchBaseline' {$sel:baselineId:GetPatchBaseline' :: Text
baselineId = Text
pBaselineId_}

-- | The ID of the patch baseline to retrieve.
--
-- To retrieve information about an Amazon Web Services managed patch
-- baseline, specify the full Amazon Resource Name (ARN) of the baseline.
-- For example, for the baseline @AWS-AmazonLinuxDefaultPatchBaseline@,
-- specify
-- @arn:aws:ssm:us-east-2:733109147000:patchbaseline\/pb-0e392de35e7c563b7@
-- instead of @pb-0e392de35e7c563b7@.
getPatchBaseline_baselineId :: Lens.Lens' GetPatchBaseline Prelude.Text
getPatchBaseline_baselineId :: (Text -> f Text) -> GetPatchBaseline -> f GetPatchBaseline
getPatchBaseline_baselineId = (GetPatchBaseline -> Text)
-> (GetPatchBaseline -> Text -> GetPatchBaseline)
-> Lens GetPatchBaseline GetPatchBaseline Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaseline' {Text
baselineId :: Text
$sel:baselineId:GetPatchBaseline' :: GetPatchBaseline -> Text
baselineId} -> Text
baselineId) (\s :: GetPatchBaseline
s@GetPatchBaseline' {} Text
a -> GetPatchBaseline
s {$sel:baselineId:GetPatchBaseline' :: Text
baselineId = Text
a} :: GetPatchBaseline)

instance Core.AWSRequest GetPatchBaseline where
  type
    AWSResponse GetPatchBaseline =
      GetPatchBaselineResponse
  request :: GetPatchBaseline -> Request GetPatchBaseline
request = Service -> GetPatchBaseline -> Request GetPatchBaseline
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetPatchBaseline
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetPatchBaseline)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetPatchBaseline))
-> Logger
-> Service
-> Proxy GetPatchBaseline
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetPatchBaseline)))
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 PatchRuleGroup
-> Maybe OperatingSystem
-> Maybe PatchFilterGroup
-> Maybe PatchComplianceLevel
-> Maybe PatchAction
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe [PatchSource]
-> Maybe POSIX
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> GetPatchBaselineResponse
GetPatchBaselineResponse'
            (Maybe PatchRuleGroup
 -> Maybe OperatingSystem
 -> Maybe PatchFilterGroup
 -> Maybe PatchComplianceLevel
 -> Maybe PatchAction
 -> Maybe [Text]
 -> Maybe Bool
 -> Maybe [Text]
 -> Maybe [PatchSource]
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetPatchBaselineResponse)
-> Either String (Maybe PatchRuleGroup)
-> Either
     String
     (Maybe OperatingSystem
      -> Maybe PatchFilterGroup
      -> Maybe PatchComplianceLevel
      -> Maybe PatchAction
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe PatchRuleGroup)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApprovalRules")
            Either
  String
  (Maybe OperatingSystem
   -> Maybe PatchFilterGroup
   -> Maybe PatchComplianceLevel
   -> Maybe PatchAction
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe OperatingSystem)
-> Either
     String
     (Maybe PatchFilterGroup
      -> Maybe PatchComplianceLevel
      -> Maybe PatchAction
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe OperatingSystem)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"OperatingSystem")
            Either
  String
  (Maybe PatchFilterGroup
   -> Maybe PatchComplianceLevel
   -> Maybe PatchAction
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe PatchFilterGroup)
-> Either
     String
     (Maybe PatchComplianceLevel
      -> Maybe PatchAction
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PatchFilterGroup)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GlobalFilters")
            Either
  String
  (Maybe PatchComplianceLevel
   -> Maybe PatchAction
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe PatchComplianceLevel)
-> Either
     String
     (Maybe PatchAction
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PatchComplianceLevel)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApprovedPatchesComplianceLevel")
            Either
  String
  (Maybe PatchAction
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe PatchAction)
-> Either
     String
     (Maybe [Text]
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PatchAction)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RejectedPatchesAction")
            Either
  String
  (Maybe [Text]
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Bool
      -> Maybe [Text]
      -> Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApprovedPatches"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Bool
   -> Maybe [Text]
   -> Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [Text]
      -> Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApprovedPatchesEnableNonSecurity")
            Either
  String
  (Maybe [Text]
   -> Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe [PatchSource]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RejectedPatches"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [PatchSource]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe [PatchSource])
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [PatchSource]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Sources" Either String (Maybe (Maybe [PatchSource]))
-> Maybe [PatchSource] -> Either String (Maybe [PatchSource])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PatchSource]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedDate")
            Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
            Either
  String
  (Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetPatchBaselineResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> Int -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PatchGroups" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> Int -> GetPatchBaselineResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ModifiedDate")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> GetPatchBaselineResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either String (Maybe Text -> Int -> GetPatchBaselineResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetPatchBaselineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BaselineId")
            Either String (Int -> GetPatchBaselineResponse)
-> Either String Int -> Either String GetPatchBaselineResponse
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 GetPatchBaseline

instance Prelude.NFData GetPatchBaseline

instance Core.ToHeaders GetPatchBaseline where
  toHeaders :: GetPatchBaseline -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetPatchBaseline -> 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.GetPatchBaseline" :: 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 GetPatchBaseline where
  toJSON :: GetPatchBaseline -> Value
toJSON GetPatchBaseline' {Text
baselineId :: Text
$sel:baselineId:GetPatchBaseline' :: GetPatchBaseline -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BaselineId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
baselineId)]
      )

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

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

-- | /See:/ 'newGetPatchBaselineResponse' smart constructor.
data GetPatchBaselineResponse = GetPatchBaselineResponse'
  { -- | A set of rules used to include patches in the baseline.
    GetPatchBaselineResponse -> Maybe PatchRuleGroup
approvalRules :: Prelude.Maybe PatchRuleGroup,
    -- | Returns the operating system specified for the patch baseline.
    GetPatchBaselineResponse -> Maybe OperatingSystem
operatingSystem :: Prelude.Maybe OperatingSystem,
    -- | A set of global filters used to exclude patches from the baseline.
    GetPatchBaselineResponse -> Maybe PatchFilterGroup
globalFilters :: Prelude.Maybe PatchFilterGroup,
    -- | Returns the specified compliance severity level for approved patches in
    -- the patch baseline.
    GetPatchBaselineResponse -> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel :: Prelude.Maybe PatchComplianceLevel,
    -- | The action specified to take on patches included in the
    -- @RejectedPatches@ 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.
    GetPatchBaselineResponse -> Maybe PatchAction
rejectedPatchesAction :: Prelude.Maybe PatchAction,
    -- | A list of explicitly approved patches for the baseline.
    GetPatchBaselineResponse -> 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.
    GetPatchBaselineResponse -> Maybe Bool
approvedPatchesEnableNonSecurity :: Prelude.Maybe Prelude.Bool,
    -- | A list of explicitly rejected patches for the baseline.
    GetPatchBaselineResponse -> 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.
    GetPatchBaselineResponse -> Maybe [PatchSource]
sources :: Prelude.Maybe [PatchSource],
    -- | The date the patch baseline was created.
    GetPatchBaselineResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the patch baseline.
    GetPatchBaselineResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Patch groups included in the patch baseline.
    GetPatchBaselineResponse -> Maybe [Text]
patchGroups :: Prelude.Maybe [Prelude.Text],
    -- | The date the patch baseline was last modified.
    GetPatchBaselineResponse -> Maybe POSIX
modifiedDate :: Prelude.Maybe Core.POSIX,
    -- | A description of the patch baseline.
    GetPatchBaselineResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of the retrieved patch baseline.
    GetPatchBaselineResponse -> Maybe Text
baselineId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetPatchBaselineResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetPatchBaselineResponse -> GetPatchBaselineResponse -> Bool
(GetPatchBaselineResponse -> GetPatchBaselineResponse -> Bool)
-> (GetPatchBaselineResponse -> GetPatchBaselineResponse -> Bool)
-> Eq GetPatchBaselineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPatchBaselineResponse -> GetPatchBaselineResponse -> Bool
$c/= :: GetPatchBaselineResponse -> GetPatchBaselineResponse -> Bool
== :: GetPatchBaselineResponse -> GetPatchBaselineResponse -> Bool
$c== :: GetPatchBaselineResponse -> GetPatchBaselineResponse -> Bool
Prelude.Eq, Int -> GetPatchBaselineResponse -> ShowS
[GetPatchBaselineResponse] -> ShowS
GetPatchBaselineResponse -> String
(Int -> GetPatchBaselineResponse -> ShowS)
-> (GetPatchBaselineResponse -> String)
-> ([GetPatchBaselineResponse] -> ShowS)
-> Show GetPatchBaselineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPatchBaselineResponse] -> ShowS
$cshowList :: [GetPatchBaselineResponse] -> ShowS
show :: GetPatchBaselineResponse -> String
$cshow :: GetPatchBaselineResponse -> String
showsPrec :: Int -> GetPatchBaselineResponse -> ShowS
$cshowsPrec :: Int -> GetPatchBaselineResponse -> ShowS
Prelude.Show, (forall x.
 GetPatchBaselineResponse -> Rep GetPatchBaselineResponse x)
-> (forall x.
    Rep GetPatchBaselineResponse x -> GetPatchBaselineResponse)
-> Generic GetPatchBaselineResponse
forall x.
Rep GetPatchBaselineResponse x -> GetPatchBaselineResponse
forall x.
GetPatchBaselineResponse -> Rep GetPatchBaselineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPatchBaselineResponse x -> GetPatchBaselineResponse
$cfrom :: forall x.
GetPatchBaselineResponse -> Rep GetPatchBaselineResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetPatchBaselineResponse' 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', 'getPatchBaselineResponse_approvalRules' - A set of rules used to include patches in the baseline.
--
-- 'operatingSystem', 'getPatchBaselineResponse_operatingSystem' - Returns the operating system specified for the patch baseline.
--
-- 'globalFilters', 'getPatchBaselineResponse_globalFilters' - A set of global filters used to exclude patches from the baseline.
--
-- 'approvedPatchesComplianceLevel', 'getPatchBaselineResponse_approvedPatchesComplianceLevel' - Returns the specified compliance severity level for approved patches in
-- the patch baseline.
--
-- 'rejectedPatchesAction', 'getPatchBaselineResponse_rejectedPatchesAction' - The action specified to take on patches included in the
-- @RejectedPatches@ 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', 'getPatchBaselineResponse_approvedPatches' - A list of explicitly approved patches for the baseline.
--
-- 'approvedPatchesEnableNonSecurity', 'getPatchBaselineResponse_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', 'getPatchBaselineResponse_rejectedPatches' - A list of explicitly rejected patches for the baseline.
--
-- 'sources', 'getPatchBaselineResponse_sources' - Information about the patches to use to update the instances, including
-- target operating systems and source repositories. Applies to Linux
-- instances only.
--
-- 'createdDate', 'getPatchBaselineResponse_createdDate' - The date the patch baseline was created.
--
-- 'name', 'getPatchBaselineResponse_name' - The name of the patch baseline.
--
-- 'patchGroups', 'getPatchBaselineResponse_patchGroups' - Patch groups included in the patch baseline.
--
-- 'modifiedDate', 'getPatchBaselineResponse_modifiedDate' - The date the patch baseline was last modified.
--
-- 'description', 'getPatchBaselineResponse_description' - A description of the patch baseline.
--
-- 'baselineId', 'getPatchBaselineResponse_baselineId' - The ID of the retrieved patch baseline.
--
-- 'httpStatus', 'getPatchBaselineResponse_httpStatus' - The response's http status code.
newGetPatchBaselineResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetPatchBaselineResponse
newGetPatchBaselineResponse :: Int -> GetPatchBaselineResponse
newGetPatchBaselineResponse Int
pHttpStatus_ =
  GetPatchBaselineResponse' :: Maybe PatchRuleGroup
-> Maybe OperatingSystem
-> Maybe PatchFilterGroup
-> Maybe PatchComplianceLevel
-> Maybe PatchAction
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe [PatchSource]
-> Maybe POSIX
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> GetPatchBaselineResponse
GetPatchBaselineResponse'
    { $sel:approvalRules:GetPatchBaselineResponse' :: Maybe PatchRuleGroup
approvalRules =
        Maybe PatchRuleGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:operatingSystem:GetPatchBaselineResponse' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
forall a. Maybe a
Prelude.Nothing,
      $sel:globalFilters:GetPatchBaselineResponse' :: Maybe PatchFilterGroup
globalFilters = Maybe PatchFilterGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatchesComplianceLevel:GetPatchBaselineResponse' :: Maybe PatchComplianceLevel
approvedPatchesComplianceLevel = Maybe PatchComplianceLevel
forall a. Maybe a
Prelude.Nothing,
      $sel:rejectedPatchesAction:GetPatchBaselineResponse' :: Maybe PatchAction
rejectedPatchesAction = Maybe PatchAction
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatches:GetPatchBaselineResponse' :: Maybe [Text]
approvedPatches = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:approvedPatchesEnableNonSecurity:GetPatchBaselineResponse' :: Maybe Bool
approvedPatchesEnableNonSecurity =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:rejectedPatches:GetPatchBaselineResponse' :: Maybe [Text]
rejectedPatches = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:sources:GetPatchBaselineResponse' :: Maybe [PatchSource]
sources = Maybe [PatchSource]
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:GetPatchBaselineResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetPatchBaselineResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:patchGroups:GetPatchBaselineResponse' :: Maybe [Text]
patchGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:modifiedDate:GetPatchBaselineResponse' :: Maybe POSIX
modifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:GetPatchBaselineResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:baselineId:GetPatchBaselineResponse' :: Maybe Text
baselineId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetPatchBaselineResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Returns the operating system specified for the patch baseline.
getPatchBaselineResponse_operatingSystem :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe OperatingSystem)
getPatchBaselineResponse_operatingSystem :: (Maybe OperatingSystem -> f (Maybe OperatingSystem))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_operatingSystem = (GetPatchBaselineResponse -> Maybe OperatingSystem)
-> (GetPatchBaselineResponse
    -> Maybe OperatingSystem -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe OperatingSystem)
     (Maybe OperatingSystem)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
$sel:operatingSystem:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe OperatingSystem
operatingSystem} -> Maybe OperatingSystem
operatingSystem) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe OperatingSystem
a -> GetPatchBaselineResponse
s {$sel:operatingSystem:GetPatchBaselineResponse' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
a} :: GetPatchBaselineResponse)

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

-- | Returns the specified compliance severity level for approved patches in
-- the patch baseline.
getPatchBaselineResponse_approvedPatchesComplianceLevel :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe PatchComplianceLevel)
getPatchBaselineResponse_approvedPatchesComplianceLevel :: (Maybe PatchComplianceLevel -> f (Maybe PatchComplianceLevel))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_approvedPatchesComplianceLevel = (GetPatchBaselineResponse -> Maybe PatchComplianceLevel)
-> (GetPatchBaselineResponse
    -> Maybe PatchComplianceLevel -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe PatchComplianceLevel)
     (Maybe PatchComplianceLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe PatchComplianceLevel
approvedPatchesComplianceLevel :: Maybe PatchComplianceLevel
$sel:approvedPatchesComplianceLevel:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel} -> Maybe PatchComplianceLevel
approvedPatchesComplianceLevel) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe PatchComplianceLevel
a -> GetPatchBaselineResponse
s {$sel:approvedPatchesComplianceLevel:GetPatchBaselineResponse' :: Maybe PatchComplianceLevel
approvedPatchesComplianceLevel = Maybe PatchComplianceLevel
a} :: GetPatchBaselineResponse)

-- | The action specified to take on patches included in the
-- @RejectedPatches@ 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.
getPatchBaselineResponse_rejectedPatchesAction :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe PatchAction)
getPatchBaselineResponse_rejectedPatchesAction :: (Maybe PatchAction -> f (Maybe PatchAction))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_rejectedPatchesAction = (GetPatchBaselineResponse -> Maybe PatchAction)
-> (GetPatchBaselineResponse
    -> Maybe PatchAction -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe PatchAction)
     (Maybe PatchAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe PatchAction
rejectedPatchesAction :: Maybe PatchAction
$sel:rejectedPatchesAction:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe PatchAction
rejectedPatchesAction} -> Maybe PatchAction
rejectedPatchesAction) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe PatchAction
a -> GetPatchBaselineResponse
s {$sel:rejectedPatchesAction:GetPatchBaselineResponse' :: Maybe PatchAction
rejectedPatchesAction = Maybe PatchAction
a} :: GetPatchBaselineResponse)

-- | A list of explicitly approved patches for the baseline.
getPatchBaselineResponse_approvedPatches :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe [Prelude.Text])
getPatchBaselineResponse_approvedPatches :: (Maybe [Text] -> f (Maybe [Text]))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_approvedPatches = (GetPatchBaselineResponse -> Maybe [Text])
-> (GetPatchBaselineResponse
    -> Maybe [Text] -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe [Text]
approvedPatches :: Maybe [Text]
$sel:approvedPatches:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe [Text]
approvedPatches} -> Maybe [Text]
approvedPatches) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe [Text]
a -> GetPatchBaselineResponse
s {$sel:approvedPatches:GetPatchBaselineResponse' :: Maybe [Text]
approvedPatches = Maybe [Text]
a} :: GetPatchBaselineResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetPatchBaselineResponse -> f GetPatchBaselineResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetPatchBaselineResponse
-> f GetPatchBaselineResponse
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.
getPatchBaselineResponse_approvedPatchesEnableNonSecurity :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe Prelude.Bool)
getPatchBaselineResponse_approvedPatchesEnableNonSecurity :: (Maybe Bool -> f (Maybe Bool))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_approvedPatchesEnableNonSecurity = (GetPatchBaselineResponse -> Maybe Bool)
-> (GetPatchBaselineResponse
    -> Maybe Bool -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe Bool
approvedPatchesEnableNonSecurity :: Maybe Bool
$sel:approvedPatchesEnableNonSecurity:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe Bool
approvedPatchesEnableNonSecurity} -> Maybe Bool
approvedPatchesEnableNonSecurity) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe Bool
a -> GetPatchBaselineResponse
s {$sel:approvedPatchesEnableNonSecurity:GetPatchBaselineResponse' :: Maybe Bool
approvedPatchesEnableNonSecurity = Maybe Bool
a} :: GetPatchBaselineResponse)

-- | A list of explicitly rejected patches for the baseline.
getPatchBaselineResponse_rejectedPatches :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe [Prelude.Text])
getPatchBaselineResponse_rejectedPatches :: (Maybe [Text] -> f (Maybe [Text]))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_rejectedPatches = (GetPatchBaselineResponse -> Maybe [Text])
-> (GetPatchBaselineResponse
    -> Maybe [Text] -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe [Text]
rejectedPatches :: Maybe [Text]
$sel:rejectedPatches:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe [Text]
rejectedPatches} -> Maybe [Text]
rejectedPatches) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe [Text]
a -> GetPatchBaselineResponse
s {$sel:rejectedPatches:GetPatchBaselineResponse' :: Maybe [Text]
rejectedPatches = Maybe [Text]
a} :: GetPatchBaselineResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetPatchBaselineResponse -> f GetPatchBaselineResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetPatchBaselineResponse
-> f GetPatchBaselineResponse
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.
getPatchBaselineResponse_sources :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe [PatchSource])
getPatchBaselineResponse_sources :: (Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_sources = (GetPatchBaselineResponse -> Maybe [PatchSource])
-> (GetPatchBaselineResponse
    -> Maybe [PatchSource] -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe [PatchSource])
     (Maybe [PatchSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe [PatchSource]
sources :: Maybe [PatchSource]
$sel:sources:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe [PatchSource]
sources} -> Maybe [PatchSource]
sources) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe [PatchSource]
a -> GetPatchBaselineResponse
s {$sel:sources:GetPatchBaselineResponse' :: Maybe [PatchSource]
sources = Maybe [PatchSource]
a} :: GetPatchBaselineResponse) ((Maybe [PatchSource] -> f (Maybe [PatchSource]))
 -> GetPatchBaselineResponse -> f GetPatchBaselineResponse)
-> ((Maybe [PatchSource] -> f (Maybe [PatchSource]))
    -> Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> (Maybe [PatchSource] -> f (Maybe [PatchSource]))
-> GetPatchBaselineResponse
-> f GetPatchBaselineResponse
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

-- | The date the patch baseline was created.
getPatchBaselineResponse_createdDate :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe Prelude.UTCTime)
getPatchBaselineResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_createdDate = (GetPatchBaselineResponse -> Maybe POSIX)
-> (GetPatchBaselineResponse
    -> Maybe POSIX -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe POSIX
a -> GetPatchBaselineResponse
s {$sel:createdDate:GetPatchBaselineResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: GetPatchBaselineResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetPatchBaselineResponse -> f GetPatchBaselineResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetPatchBaselineResponse
-> f GetPatchBaselineResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | Patch groups included in the patch baseline.
getPatchBaselineResponse_patchGroups :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe [Prelude.Text])
getPatchBaselineResponse_patchGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_patchGroups = (GetPatchBaselineResponse -> Maybe [Text])
-> (GetPatchBaselineResponse
    -> Maybe [Text] -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe [Text]
patchGroups :: Maybe [Text]
$sel:patchGroups:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe [Text]
patchGroups} -> Maybe [Text]
patchGroups) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe [Text]
a -> GetPatchBaselineResponse
s {$sel:patchGroups:GetPatchBaselineResponse' :: Maybe [Text]
patchGroups = Maybe [Text]
a} :: GetPatchBaselineResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetPatchBaselineResponse -> f GetPatchBaselineResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetPatchBaselineResponse
-> f GetPatchBaselineResponse
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

-- | The date the patch baseline was last modified.
getPatchBaselineResponse_modifiedDate :: Lens.Lens' GetPatchBaselineResponse (Prelude.Maybe Prelude.UTCTime)
getPatchBaselineResponse_modifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetPatchBaselineResponse -> f GetPatchBaselineResponse
getPatchBaselineResponse_modifiedDate = (GetPatchBaselineResponse -> Maybe POSIX)
-> (GetPatchBaselineResponse
    -> Maybe POSIX -> GetPatchBaselineResponse)
-> Lens
     GetPatchBaselineResponse
     GetPatchBaselineResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPatchBaselineResponse' {Maybe POSIX
modifiedDate :: Maybe POSIX
$sel:modifiedDate:GetPatchBaselineResponse' :: GetPatchBaselineResponse -> Maybe POSIX
modifiedDate} -> Maybe POSIX
modifiedDate) (\s :: GetPatchBaselineResponse
s@GetPatchBaselineResponse' {} Maybe POSIX
a -> GetPatchBaselineResponse
s {$sel:modifiedDate:GetPatchBaselineResponse' :: Maybe POSIX
modifiedDate = Maybe POSIX
a} :: GetPatchBaselineResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetPatchBaselineResponse -> f GetPatchBaselineResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetPatchBaselineResponse
-> f GetPatchBaselineResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

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

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

instance Prelude.NFData GetPatchBaselineResponse