{-# 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 #-}
module Amazonka.SecurityHub.Types.SoftwarePackage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SoftwarePackage = SoftwarePackage'
{
SoftwarePackage -> Maybe Text
filePath :: Prelude.Maybe Prelude.Text,
SoftwarePackage -> Maybe Text
release :: Prelude.Maybe Prelude.Text,
SoftwarePackage -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SoftwarePackage -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
SoftwarePackage -> Maybe Text
architecture :: Prelude.Maybe Prelude.Text,
SoftwarePackage -> Maybe Text
packageManager :: Prelude.Maybe Prelude.Text,
SoftwarePackage -> Maybe Text
epoch :: Prelude.Maybe Prelude.Text
}
deriving (SoftwarePackage -> SoftwarePackage -> Bool
(SoftwarePackage -> SoftwarePackage -> Bool)
-> (SoftwarePackage -> SoftwarePackage -> Bool)
-> Eq SoftwarePackage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SoftwarePackage -> SoftwarePackage -> Bool
$c/= :: SoftwarePackage -> SoftwarePackage -> Bool
== :: SoftwarePackage -> SoftwarePackage -> Bool
$c== :: SoftwarePackage -> SoftwarePackage -> Bool
Prelude.Eq, ReadPrec [SoftwarePackage]
ReadPrec SoftwarePackage
Int -> ReadS SoftwarePackage
ReadS [SoftwarePackage]
(Int -> ReadS SoftwarePackage)
-> ReadS [SoftwarePackage]
-> ReadPrec SoftwarePackage
-> ReadPrec [SoftwarePackage]
-> Read SoftwarePackage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SoftwarePackage]
$creadListPrec :: ReadPrec [SoftwarePackage]
readPrec :: ReadPrec SoftwarePackage
$creadPrec :: ReadPrec SoftwarePackage
readList :: ReadS [SoftwarePackage]
$creadList :: ReadS [SoftwarePackage]
readsPrec :: Int -> ReadS SoftwarePackage
$creadsPrec :: Int -> ReadS SoftwarePackage
Prelude.Read, Int -> SoftwarePackage -> ShowS
[SoftwarePackage] -> ShowS
SoftwarePackage -> String
(Int -> SoftwarePackage -> ShowS)
-> (SoftwarePackage -> String)
-> ([SoftwarePackage] -> ShowS)
-> Show SoftwarePackage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SoftwarePackage] -> ShowS
$cshowList :: [SoftwarePackage] -> ShowS
show :: SoftwarePackage -> String
$cshow :: SoftwarePackage -> String
showsPrec :: Int -> SoftwarePackage -> ShowS
$cshowsPrec :: Int -> SoftwarePackage -> ShowS
Prelude.Show, (forall x. SoftwarePackage -> Rep SoftwarePackage x)
-> (forall x. Rep SoftwarePackage x -> SoftwarePackage)
-> Generic SoftwarePackage
forall x. Rep SoftwarePackage x -> SoftwarePackage
forall x. SoftwarePackage -> Rep SoftwarePackage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SoftwarePackage x -> SoftwarePackage
$cfrom :: forall x. SoftwarePackage -> Rep SoftwarePackage x
Prelude.Generic)
newSoftwarePackage ::
SoftwarePackage
newSoftwarePackage :: SoftwarePackage
newSoftwarePackage =
SoftwarePackage' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SoftwarePackage
SoftwarePackage'
{ $sel:filePath:SoftwarePackage' :: Maybe Text
filePath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:release:SoftwarePackage' :: Maybe Text
release = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:SoftwarePackage' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:SoftwarePackage' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:architecture:SoftwarePackage' :: Maybe Text
architecture = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:packageManager:SoftwarePackage' :: Maybe Text
packageManager = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:epoch:SoftwarePackage' :: Maybe Text
epoch = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
softwarePackage_filePath :: Lens.Lens' SoftwarePackage (Prelude.Maybe Prelude.Text)
softwarePackage_filePath :: (Maybe Text -> f (Maybe Text))
-> SoftwarePackage -> f SoftwarePackage
softwarePackage_filePath = (SoftwarePackage -> Maybe Text)
-> (SoftwarePackage -> Maybe Text -> SoftwarePackage)
-> Lens SoftwarePackage SoftwarePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwarePackage' {Maybe Text
filePath :: Maybe Text
$sel:filePath:SoftwarePackage' :: SoftwarePackage -> Maybe Text
filePath} -> Maybe Text
filePath) (\s :: SoftwarePackage
s@SoftwarePackage' {} Maybe Text
a -> SoftwarePackage
s {$sel:filePath:SoftwarePackage' :: Maybe Text
filePath = Maybe Text
a} :: SoftwarePackage)
softwarePackage_release :: Lens.Lens' SoftwarePackage (Prelude.Maybe Prelude.Text)
softwarePackage_release :: (Maybe Text -> f (Maybe Text))
-> SoftwarePackage -> f SoftwarePackage
softwarePackage_release = (SoftwarePackage -> Maybe Text)
-> (SoftwarePackage -> Maybe Text -> SoftwarePackage)
-> Lens SoftwarePackage SoftwarePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwarePackage' {Maybe Text
release :: Maybe Text
$sel:release:SoftwarePackage' :: SoftwarePackage -> Maybe Text
release} -> Maybe Text
release) (\s :: SoftwarePackage
s@SoftwarePackage' {} Maybe Text
a -> SoftwarePackage
s {$sel:release:SoftwarePackage' :: Maybe Text
release = Maybe Text
a} :: SoftwarePackage)
softwarePackage_name :: Lens.Lens' SoftwarePackage (Prelude.Maybe Prelude.Text)
softwarePackage_name :: (Maybe Text -> f (Maybe Text))
-> SoftwarePackage -> f SoftwarePackage
softwarePackage_name = (SoftwarePackage -> Maybe Text)
-> (SoftwarePackage -> Maybe Text -> SoftwarePackage)
-> Lens SoftwarePackage SoftwarePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwarePackage' {Maybe Text
name :: Maybe Text
$sel:name:SoftwarePackage' :: SoftwarePackage -> Maybe Text
name} -> Maybe Text
name) (\s :: SoftwarePackage
s@SoftwarePackage' {} Maybe Text
a -> SoftwarePackage
s {$sel:name:SoftwarePackage' :: Maybe Text
name = Maybe Text
a} :: SoftwarePackage)
softwarePackage_version :: Lens.Lens' SoftwarePackage (Prelude.Maybe Prelude.Text)
softwarePackage_version :: (Maybe Text -> f (Maybe Text))
-> SoftwarePackage -> f SoftwarePackage
softwarePackage_version = (SoftwarePackage -> Maybe Text)
-> (SoftwarePackage -> Maybe Text -> SoftwarePackage)
-> Lens SoftwarePackage SoftwarePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwarePackage' {Maybe Text
version :: Maybe Text
$sel:version:SoftwarePackage' :: SoftwarePackage -> Maybe Text
version} -> Maybe Text
version) (\s :: SoftwarePackage
s@SoftwarePackage' {} Maybe Text
a -> SoftwarePackage
s {$sel:version:SoftwarePackage' :: Maybe Text
version = Maybe Text
a} :: SoftwarePackage)
softwarePackage_architecture :: Lens.Lens' SoftwarePackage (Prelude.Maybe Prelude.Text)
softwarePackage_architecture :: (Maybe Text -> f (Maybe Text))
-> SoftwarePackage -> f SoftwarePackage
softwarePackage_architecture = (SoftwarePackage -> Maybe Text)
-> (SoftwarePackage -> Maybe Text -> SoftwarePackage)
-> Lens SoftwarePackage SoftwarePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwarePackage' {Maybe Text
architecture :: Maybe Text
$sel:architecture:SoftwarePackage' :: SoftwarePackage -> Maybe Text
architecture} -> Maybe Text
architecture) (\s :: SoftwarePackage
s@SoftwarePackage' {} Maybe Text
a -> SoftwarePackage
s {$sel:architecture:SoftwarePackage' :: Maybe Text
architecture = Maybe Text
a} :: SoftwarePackage)
softwarePackage_packageManager :: Lens.Lens' SoftwarePackage (Prelude.Maybe Prelude.Text)
softwarePackage_packageManager :: (Maybe Text -> f (Maybe Text))
-> SoftwarePackage -> f SoftwarePackage
softwarePackage_packageManager = (SoftwarePackage -> Maybe Text)
-> (SoftwarePackage -> Maybe Text -> SoftwarePackage)
-> Lens SoftwarePackage SoftwarePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwarePackage' {Maybe Text
packageManager :: Maybe Text
$sel:packageManager:SoftwarePackage' :: SoftwarePackage -> Maybe Text
packageManager} -> Maybe Text
packageManager) (\s :: SoftwarePackage
s@SoftwarePackage' {} Maybe Text
a -> SoftwarePackage
s {$sel:packageManager:SoftwarePackage' :: Maybe Text
packageManager = Maybe Text
a} :: SoftwarePackage)
softwarePackage_epoch :: Lens.Lens' SoftwarePackage (Prelude.Maybe Prelude.Text)
softwarePackage_epoch :: (Maybe Text -> f (Maybe Text))
-> SoftwarePackage -> f SoftwarePackage
softwarePackage_epoch = (SoftwarePackage -> Maybe Text)
-> (SoftwarePackage -> Maybe Text -> SoftwarePackage)
-> Lens SoftwarePackage SoftwarePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwarePackage' {Maybe Text
epoch :: Maybe Text
$sel:epoch:SoftwarePackage' :: SoftwarePackage -> Maybe Text
epoch} -> Maybe Text
epoch) (\s :: SoftwarePackage
s@SoftwarePackage' {} Maybe Text
a -> SoftwarePackage
s {$sel:epoch:SoftwarePackage' :: Maybe Text
epoch = Maybe Text
a} :: SoftwarePackage)
instance Core.FromJSON SoftwarePackage where
parseJSON :: Value -> Parser SoftwarePackage
parseJSON =
String
-> (Object -> Parser SoftwarePackage)
-> Value
-> Parser SoftwarePackage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SoftwarePackage"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SoftwarePackage
SoftwarePackage'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SoftwarePackage)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SoftwarePackage)
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
"FilePath")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SoftwarePackage)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SoftwarePackage)
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
"Release")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SoftwarePackage)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SoftwarePackage)
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
"Name")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SoftwarePackage)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> SoftwarePackage)
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
"Version")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> SoftwarePackage)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SoftwarePackage)
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
"Architecture")
Parser (Maybe Text -> Maybe Text -> SoftwarePackage)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SoftwarePackage)
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
"PackageManager")
Parser (Maybe Text -> SoftwarePackage)
-> Parser (Maybe Text) -> Parser SoftwarePackage
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
"Epoch")
)
instance Prelude.Hashable SoftwarePackage
instance Prelude.NFData SoftwarePackage
instance Core.ToJSON SoftwarePackage where
toJSON :: SoftwarePackage -> Value
toJSON SoftwarePackage' {Maybe Text
epoch :: Maybe Text
packageManager :: Maybe Text
architecture :: Maybe Text
version :: Maybe Text
name :: Maybe Text
release :: Maybe Text
filePath :: Maybe Text
$sel:epoch:SoftwarePackage' :: SoftwarePackage -> Maybe Text
$sel:packageManager:SoftwarePackage' :: SoftwarePackage -> Maybe Text
$sel:architecture:SoftwarePackage' :: SoftwarePackage -> Maybe Text
$sel:version:SoftwarePackage' :: SoftwarePackage -> Maybe Text
$sel:name:SoftwarePackage' :: SoftwarePackage -> Maybe Text
$sel:release:SoftwarePackage' :: SoftwarePackage -> Maybe Text
$sel:filePath:SoftwarePackage' :: SoftwarePackage -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FilePath" 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
filePath,
(Text
"Release" 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
release,
(Text
"Name" 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
name,
(Text
"Version" 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
version,
(Text
"Architecture" 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
architecture,
(Text
"PackageManager" 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
packageManager,
(Text
"Epoch" 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
epoch
]
)