{-# 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.Inspector.Types.InspectorServiceAttributes
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Inspector.Types.InspectorServiceAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This data type is used in the Finding data type.
--
-- /See:/ 'newInspectorServiceAttributes' smart constructor.
data InspectorServiceAttributes = InspectorServiceAttributes'
  { -- | The ARN of the rules package that is used to generate the finding.
    InspectorServiceAttributes -> Maybe Text
rulesPackageArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the assessment run during which the finding is generated.
    InspectorServiceAttributes -> Maybe Text
assessmentRunArn :: Prelude.Maybe Prelude.Text,
    -- | The schema version of this data type.
    InspectorServiceAttributes -> Natural
schemaVersion :: Prelude.Natural
  }
  deriving (InspectorServiceAttributes -> InspectorServiceAttributes -> Bool
(InspectorServiceAttributes -> InspectorServiceAttributes -> Bool)
-> (InspectorServiceAttributes
    -> InspectorServiceAttributes -> Bool)
-> Eq InspectorServiceAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InspectorServiceAttributes -> InspectorServiceAttributes -> Bool
$c/= :: InspectorServiceAttributes -> InspectorServiceAttributes -> Bool
== :: InspectorServiceAttributes -> InspectorServiceAttributes -> Bool
$c== :: InspectorServiceAttributes -> InspectorServiceAttributes -> Bool
Prelude.Eq, ReadPrec [InspectorServiceAttributes]
ReadPrec InspectorServiceAttributes
Int -> ReadS InspectorServiceAttributes
ReadS [InspectorServiceAttributes]
(Int -> ReadS InspectorServiceAttributes)
-> ReadS [InspectorServiceAttributes]
-> ReadPrec InspectorServiceAttributes
-> ReadPrec [InspectorServiceAttributes]
-> Read InspectorServiceAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InspectorServiceAttributes]
$creadListPrec :: ReadPrec [InspectorServiceAttributes]
readPrec :: ReadPrec InspectorServiceAttributes
$creadPrec :: ReadPrec InspectorServiceAttributes
readList :: ReadS [InspectorServiceAttributes]
$creadList :: ReadS [InspectorServiceAttributes]
readsPrec :: Int -> ReadS InspectorServiceAttributes
$creadsPrec :: Int -> ReadS InspectorServiceAttributes
Prelude.Read, Int -> InspectorServiceAttributes -> ShowS
[InspectorServiceAttributes] -> ShowS
InspectorServiceAttributes -> String
(Int -> InspectorServiceAttributes -> ShowS)
-> (InspectorServiceAttributes -> String)
-> ([InspectorServiceAttributes] -> ShowS)
-> Show InspectorServiceAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InspectorServiceAttributes] -> ShowS
$cshowList :: [InspectorServiceAttributes] -> ShowS
show :: InspectorServiceAttributes -> String
$cshow :: InspectorServiceAttributes -> String
showsPrec :: Int -> InspectorServiceAttributes -> ShowS
$cshowsPrec :: Int -> InspectorServiceAttributes -> ShowS
Prelude.Show, (forall x.
 InspectorServiceAttributes -> Rep InspectorServiceAttributes x)
-> (forall x.
    Rep InspectorServiceAttributes x -> InspectorServiceAttributes)
-> Generic InspectorServiceAttributes
forall x.
Rep InspectorServiceAttributes x -> InspectorServiceAttributes
forall x.
InspectorServiceAttributes -> Rep InspectorServiceAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InspectorServiceAttributes x -> InspectorServiceAttributes
$cfrom :: forall x.
InspectorServiceAttributes -> Rep InspectorServiceAttributes x
Prelude.Generic)

-- |
-- Create a value of 'InspectorServiceAttributes' 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:
--
-- 'rulesPackageArn', 'inspectorServiceAttributes_rulesPackageArn' - The ARN of the rules package that is used to generate the finding.
--
-- 'assessmentRunArn', 'inspectorServiceAttributes_assessmentRunArn' - The ARN of the assessment run during which the finding is generated.
--
-- 'schemaVersion', 'inspectorServiceAttributes_schemaVersion' - The schema version of this data type.
newInspectorServiceAttributes ::
  -- | 'schemaVersion'
  Prelude.Natural ->
  InspectorServiceAttributes
newInspectorServiceAttributes :: Natural -> InspectorServiceAttributes
newInspectorServiceAttributes Natural
pSchemaVersion_ =
  InspectorServiceAttributes' :: Maybe Text -> Maybe Text -> Natural -> InspectorServiceAttributes
InspectorServiceAttributes'
    { $sel:rulesPackageArn:InspectorServiceAttributes' :: Maybe Text
rulesPackageArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:assessmentRunArn:InspectorServiceAttributes' :: Maybe Text
assessmentRunArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersion:InspectorServiceAttributes' :: Natural
schemaVersion = Natural
pSchemaVersion_
    }

-- | The ARN of the rules package that is used to generate the finding.
inspectorServiceAttributes_rulesPackageArn :: Lens.Lens' InspectorServiceAttributes (Prelude.Maybe Prelude.Text)
inspectorServiceAttributes_rulesPackageArn :: (Maybe Text -> f (Maybe Text))
-> InspectorServiceAttributes -> f InspectorServiceAttributes
inspectorServiceAttributes_rulesPackageArn = (InspectorServiceAttributes -> Maybe Text)
-> (InspectorServiceAttributes
    -> Maybe Text -> InspectorServiceAttributes)
-> Lens
     InspectorServiceAttributes
     InspectorServiceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InspectorServiceAttributes' {Maybe Text
rulesPackageArn :: Maybe Text
$sel:rulesPackageArn:InspectorServiceAttributes' :: InspectorServiceAttributes -> Maybe Text
rulesPackageArn} -> Maybe Text
rulesPackageArn) (\s :: InspectorServiceAttributes
s@InspectorServiceAttributes' {} Maybe Text
a -> InspectorServiceAttributes
s {$sel:rulesPackageArn:InspectorServiceAttributes' :: Maybe Text
rulesPackageArn = Maybe Text
a} :: InspectorServiceAttributes)

-- | The ARN of the assessment run during which the finding is generated.
inspectorServiceAttributes_assessmentRunArn :: Lens.Lens' InspectorServiceAttributes (Prelude.Maybe Prelude.Text)
inspectorServiceAttributes_assessmentRunArn :: (Maybe Text -> f (Maybe Text))
-> InspectorServiceAttributes -> f InspectorServiceAttributes
inspectorServiceAttributes_assessmentRunArn = (InspectorServiceAttributes -> Maybe Text)
-> (InspectorServiceAttributes
    -> Maybe Text -> InspectorServiceAttributes)
-> Lens
     InspectorServiceAttributes
     InspectorServiceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InspectorServiceAttributes' {Maybe Text
assessmentRunArn :: Maybe Text
$sel:assessmentRunArn:InspectorServiceAttributes' :: InspectorServiceAttributes -> Maybe Text
assessmentRunArn} -> Maybe Text
assessmentRunArn) (\s :: InspectorServiceAttributes
s@InspectorServiceAttributes' {} Maybe Text
a -> InspectorServiceAttributes
s {$sel:assessmentRunArn:InspectorServiceAttributes' :: Maybe Text
assessmentRunArn = Maybe Text
a} :: InspectorServiceAttributes)

-- | The schema version of this data type.
inspectorServiceAttributes_schemaVersion :: Lens.Lens' InspectorServiceAttributes Prelude.Natural
inspectorServiceAttributes_schemaVersion :: (Natural -> f Natural)
-> InspectorServiceAttributes -> f InspectorServiceAttributes
inspectorServiceAttributes_schemaVersion = (InspectorServiceAttributes -> Natural)
-> (InspectorServiceAttributes
    -> Natural -> InspectorServiceAttributes)
-> Lens
     InspectorServiceAttributes
     InspectorServiceAttributes
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InspectorServiceAttributes' {Natural
schemaVersion :: Natural
$sel:schemaVersion:InspectorServiceAttributes' :: InspectorServiceAttributes -> Natural
schemaVersion} -> Natural
schemaVersion) (\s :: InspectorServiceAttributes
s@InspectorServiceAttributes' {} Natural
a -> InspectorServiceAttributes
s {$sel:schemaVersion:InspectorServiceAttributes' :: Natural
schemaVersion = Natural
a} :: InspectorServiceAttributes)

instance Core.FromJSON InspectorServiceAttributes where
  parseJSON :: Value -> Parser InspectorServiceAttributes
parseJSON =
    String
-> (Object -> Parser InspectorServiceAttributes)
-> Value
-> Parser InspectorServiceAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InspectorServiceAttributes"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Natural -> InspectorServiceAttributes
InspectorServiceAttributes'
            (Maybe Text -> Maybe Text -> Natural -> InspectorServiceAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Natural -> InspectorServiceAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rulesPackageArn")
            Parser (Maybe Text -> Natural -> InspectorServiceAttributes)
-> Parser (Maybe Text)
-> Parser (Natural -> InspectorServiceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"assessmentRunArn")
            Parser (Natural -> InspectorServiceAttributes)
-> Parser Natural -> Parser InspectorServiceAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"schemaVersion")
      )

instance Prelude.Hashable InspectorServiceAttributes

instance Prelude.NFData InspectorServiceAttributes