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

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

-- |
-- Module      : Amazonka.Inspector2.Types.LambdaLayerAggregationResponse
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Inspector2.Types.LambdaLayerAggregationResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector2.Types.SeverityCounts
import qualified Amazonka.Prelude as Prelude

-- | A response that contains the results of an AWS Lambda function layer
-- finding aggregation.
--
-- /See:/ 'newLambdaLayerAggregationResponse' smart constructor.
data LambdaLayerAggregationResponse = LambdaLayerAggregationResponse'
  { LambdaLayerAggregationResponse -> Maybe SeverityCounts
severityCounts :: Prelude.Maybe SeverityCounts,
    -- | The account ID of the AWS Lambda function layer.
    LambdaLayerAggregationResponse -> Text
accountId :: Prelude.Text,
    -- | The names of the AWS Lambda functions associated with the layers.
    LambdaLayerAggregationResponse -> Text
functionName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the AWS Lambda function layer.
    LambdaLayerAggregationResponse -> Text
layerArn :: Prelude.Text,
    -- | The Resource ID of the AWS Lambda function layer.
    LambdaLayerAggregationResponse -> Text
resourceId :: Prelude.Text
  }
  deriving (LambdaLayerAggregationResponse
-> LambdaLayerAggregationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaLayerAggregationResponse
-> LambdaLayerAggregationResponse -> Bool
$c/= :: LambdaLayerAggregationResponse
-> LambdaLayerAggregationResponse -> Bool
== :: LambdaLayerAggregationResponse
-> LambdaLayerAggregationResponse -> Bool
$c== :: LambdaLayerAggregationResponse
-> LambdaLayerAggregationResponse -> Bool
Prelude.Eq, ReadPrec [LambdaLayerAggregationResponse]
ReadPrec LambdaLayerAggregationResponse
Int -> ReadS LambdaLayerAggregationResponse
ReadS [LambdaLayerAggregationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaLayerAggregationResponse]
$creadListPrec :: ReadPrec [LambdaLayerAggregationResponse]
readPrec :: ReadPrec LambdaLayerAggregationResponse
$creadPrec :: ReadPrec LambdaLayerAggregationResponse
readList :: ReadS [LambdaLayerAggregationResponse]
$creadList :: ReadS [LambdaLayerAggregationResponse]
readsPrec :: Int -> ReadS LambdaLayerAggregationResponse
$creadsPrec :: Int -> ReadS LambdaLayerAggregationResponse
Prelude.Read, Int -> LambdaLayerAggregationResponse -> ShowS
[LambdaLayerAggregationResponse] -> ShowS
LambdaLayerAggregationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaLayerAggregationResponse] -> ShowS
$cshowList :: [LambdaLayerAggregationResponse] -> ShowS
show :: LambdaLayerAggregationResponse -> String
$cshow :: LambdaLayerAggregationResponse -> String
showsPrec :: Int -> LambdaLayerAggregationResponse -> ShowS
$cshowsPrec :: Int -> LambdaLayerAggregationResponse -> ShowS
Prelude.Show, forall x.
Rep LambdaLayerAggregationResponse x
-> LambdaLayerAggregationResponse
forall x.
LambdaLayerAggregationResponse
-> Rep LambdaLayerAggregationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LambdaLayerAggregationResponse x
-> LambdaLayerAggregationResponse
$cfrom :: forall x.
LambdaLayerAggregationResponse
-> Rep LambdaLayerAggregationResponse x
Prelude.Generic)

-- |
-- Create a value of 'LambdaLayerAggregationResponse' 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:
--
-- 'severityCounts', 'lambdaLayerAggregationResponse_severityCounts' - Undocumented member.
--
-- 'accountId', 'lambdaLayerAggregationResponse_accountId' - The account ID of the AWS Lambda function layer.
--
-- 'functionName', 'lambdaLayerAggregationResponse_functionName' - The names of the AWS Lambda functions associated with the layers.
--
-- 'layerArn', 'lambdaLayerAggregationResponse_layerArn' - The Amazon Resource Name (ARN) of the AWS Lambda function layer.
--
-- 'resourceId', 'lambdaLayerAggregationResponse_resourceId' - The Resource ID of the AWS Lambda function layer.
newLambdaLayerAggregationResponse ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'functionName'
  Prelude.Text ->
  -- | 'layerArn'
  Prelude.Text ->
  -- | 'resourceId'
  Prelude.Text ->
  LambdaLayerAggregationResponse
newLambdaLayerAggregationResponse :: Text -> Text -> Text -> Text -> LambdaLayerAggregationResponse
newLambdaLayerAggregationResponse
  Text
pAccountId_
  Text
pFunctionName_
  Text
pLayerArn_
  Text
pResourceId_ =
    LambdaLayerAggregationResponse'
      { $sel:severityCounts:LambdaLayerAggregationResponse' :: Maybe SeverityCounts
severityCounts =
          forall a. Maybe a
Prelude.Nothing,
        $sel:accountId:LambdaLayerAggregationResponse' :: Text
accountId = Text
pAccountId_,
        $sel:functionName:LambdaLayerAggregationResponse' :: Text
functionName = Text
pFunctionName_,
        $sel:layerArn:LambdaLayerAggregationResponse' :: Text
layerArn = Text
pLayerArn_,
        $sel:resourceId:LambdaLayerAggregationResponse' :: Text
resourceId = Text
pResourceId_
      }

-- | Undocumented member.
lambdaLayerAggregationResponse_severityCounts :: Lens.Lens' LambdaLayerAggregationResponse (Prelude.Maybe SeverityCounts)
lambdaLayerAggregationResponse_severityCounts :: Lens' LambdaLayerAggregationResponse (Maybe SeverityCounts)
lambdaLayerAggregationResponse_severityCounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaLayerAggregationResponse' {Maybe SeverityCounts
severityCounts :: Maybe SeverityCounts
$sel:severityCounts:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Maybe SeverityCounts
severityCounts} -> Maybe SeverityCounts
severityCounts) (\s :: LambdaLayerAggregationResponse
s@LambdaLayerAggregationResponse' {} Maybe SeverityCounts
a -> LambdaLayerAggregationResponse
s {$sel:severityCounts:LambdaLayerAggregationResponse' :: Maybe SeverityCounts
severityCounts = Maybe SeverityCounts
a} :: LambdaLayerAggregationResponse)

-- | The account ID of the AWS Lambda function layer.
lambdaLayerAggregationResponse_accountId :: Lens.Lens' LambdaLayerAggregationResponse Prelude.Text
lambdaLayerAggregationResponse_accountId :: Lens' LambdaLayerAggregationResponse Text
lambdaLayerAggregationResponse_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaLayerAggregationResponse' {Text
accountId :: Text
$sel:accountId:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
accountId} -> Text
accountId) (\s :: LambdaLayerAggregationResponse
s@LambdaLayerAggregationResponse' {} Text
a -> LambdaLayerAggregationResponse
s {$sel:accountId:LambdaLayerAggregationResponse' :: Text
accountId = Text
a} :: LambdaLayerAggregationResponse)

-- | The names of the AWS Lambda functions associated with the layers.
lambdaLayerAggregationResponse_functionName :: Lens.Lens' LambdaLayerAggregationResponse Prelude.Text
lambdaLayerAggregationResponse_functionName :: Lens' LambdaLayerAggregationResponse Text
lambdaLayerAggregationResponse_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaLayerAggregationResponse' {Text
functionName :: Text
$sel:functionName:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
functionName} -> Text
functionName) (\s :: LambdaLayerAggregationResponse
s@LambdaLayerAggregationResponse' {} Text
a -> LambdaLayerAggregationResponse
s {$sel:functionName:LambdaLayerAggregationResponse' :: Text
functionName = Text
a} :: LambdaLayerAggregationResponse)

-- | The Amazon Resource Name (ARN) of the AWS Lambda function layer.
lambdaLayerAggregationResponse_layerArn :: Lens.Lens' LambdaLayerAggregationResponse Prelude.Text
lambdaLayerAggregationResponse_layerArn :: Lens' LambdaLayerAggregationResponse Text
lambdaLayerAggregationResponse_layerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaLayerAggregationResponse' {Text
layerArn :: Text
$sel:layerArn:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
layerArn} -> Text
layerArn) (\s :: LambdaLayerAggregationResponse
s@LambdaLayerAggregationResponse' {} Text
a -> LambdaLayerAggregationResponse
s {$sel:layerArn:LambdaLayerAggregationResponse' :: Text
layerArn = Text
a} :: LambdaLayerAggregationResponse)

-- | The Resource ID of the AWS Lambda function layer.
lambdaLayerAggregationResponse_resourceId :: Lens.Lens' LambdaLayerAggregationResponse Prelude.Text
lambdaLayerAggregationResponse_resourceId :: Lens' LambdaLayerAggregationResponse Text
lambdaLayerAggregationResponse_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaLayerAggregationResponse' {Text
resourceId :: Text
$sel:resourceId:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
resourceId} -> Text
resourceId) (\s :: LambdaLayerAggregationResponse
s@LambdaLayerAggregationResponse' {} Text
a -> LambdaLayerAggregationResponse
s {$sel:resourceId:LambdaLayerAggregationResponse' :: Text
resourceId = Text
a} :: LambdaLayerAggregationResponse)

instance Data.FromJSON LambdaLayerAggregationResponse where
  parseJSON :: Value -> Parser LambdaLayerAggregationResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LambdaLayerAggregationResponse"
      ( \Object
x ->
          Maybe SeverityCounts
-> Text -> Text -> Text -> Text -> LambdaLayerAggregationResponse
LambdaLayerAggregationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"severityCounts")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"accountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"functionName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"layerArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"resourceId")
      )

instance
  Prelude.Hashable
    LambdaLayerAggregationResponse
  where
  hashWithSalt :: Int -> LambdaLayerAggregationResponse -> Int
hashWithSalt
    Int
_salt
    LambdaLayerAggregationResponse' {Maybe SeverityCounts
Text
resourceId :: Text
layerArn :: Text
functionName :: Text
accountId :: Text
severityCounts :: Maybe SeverityCounts
$sel:resourceId:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:layerArn:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:functionName:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:accountId:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:severityCounts:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Maybe SeverityCounts
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SeverityCounts
severityCounts
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
layerArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId

instance
  Prelude.NFData
    LambdaLayerAggregationResponse
  where
  rnf :: LambdaLayerAggregationResponse -> ()
rnf LambdaLayerAggregationResponse' {Maybe SeverityCounts
Text
resourceId :: Text
layerArn :: Text
functionName :: Text
accountId :: Text
severityCounts :: Maybe SeverityCounts
$sel:resourceId:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:layerArn:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:functionName:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:accountId:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Text
$sel:severityCounts:LambdaLayerAggregationResponse' :: LambdaLayerAggregationResponse -> Maybe SeverityCounts
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SeverityCounts
severityCounts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
layerArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId