{-# 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.VulnerabilityVendor where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VulnerabilityVendor = VulnerabilityVendor'
{
VulnerabilityVendor -> Maybe Text
vendorSeverity :: Prelude.Maybe Prelude.Text,
VulnerabilityVendor -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
VulnerabilityVendor -> Maybe Text
vendorCreatedAt :: Prelude.Maybe Prelude.Text,
VulnerabilityVendor -> Maybe Text
vendorUpdatedAt :: Prelude.Maybe Prelude.Text,
VulnerabilityVendor -> Text
name :: Prelude.Text
}
deriving (VulnerabilityVendor -> VulnerabilityVendor -> Bool
(VulnerabilityVendor -> VulnerabilityVendor -> Bool)
-> (VulnerabilityVendor -> VulnerabilityVendor -> Bool)
-> Eq VulnerabilityVendor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VulnerabilityVendor -> VulnerabilityVendor -> Bool
$c/= :: VulnerabilityVendor -> VulnerabilityVendor -> Bool
== :: VulnerabilityVendor -> VulnerabilityVendor -> Bool
$c== :: VulnerabilityVendor -> VulnerabilityVendor -> Bool
Prelude.Eq, ReadPrec [VulnerabilityVendor]
ReadPrec VulnerabilityVendor
Int -> ReadS VulnerabilityVendor
ReadS [VulnerabilityVendor]
(Int -> ReadS VulnerabilityVendor)
-> ReadS [VulnerabilityVendor]
-> ReadPrec VulnerabilityVendor
-> ReadPrec [VulnerabilityVendor]
-> Read VulnerabilityVendor
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VulnerabilityVendor]
$creadListPrec :: ReadPrec [VulnerabilityVendor]
readPrec :: ReadPrec VulnerabilityVendor
$creadPrec :: ReadPrec VulnerabilityVendor
readList :: ReadS [VulnerabilityVendor]
$creadList :: ReadS [VulnerabilityVendor]
readsPrec :: Int -> ReadS VulnerabilityVendor
$creadsPrec :: Int -> ReadS VulnerabilityVendor
Prelude.Read, Int -> VulnerabilityVendor -> ShowS
[VulnerabilityVendor] -> ShowS
VulnerabilityVendor -> String
(Int -> VulnerabilityVendor -> ShowS)
-> (VulnerabilityVendor -> String)
-> ([VulnerabilityVendor] -> ShowS)
-> Show VulnerabilityVendor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VulnerabilityVendor] -> ShowS
$cshowList :: [VulnerabilityVendor] -> ShowS
show :: VulnerabilityVendor -> String
$cshow :: VulnerabilityVendor -> String
showsPrec :: Int -> VulnerabilityVendor -> ShowS
$cshowsPrec :: Int -> VulnerabilityVendor -> ShowS
Prelude.Show, (forall x. VulnerabilityVendor -> Rep VulnerabilityVendor x)
-> (forall x. Rep VulnerabilityVendor x -> VulnerabilityVendor)
-> Generic VulnerabilityVendor
forall x. Rep VulnerabilityVendor x -> VulnerabilityVendor
forall x. VulnerabilityVendor -> Rep VulnerabilityVendor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VulnerabilityVendor x -> VulnerabilityVendor
$cfrom :: forall x. VulnerabilityVendor -> Rep VulnerabilityVendor x
Prelude.Generic)
newVulnerabilityVendor ::
Prelude.Text ->
VulnerabilityVendor
newVulnerabilityVendor :: Text -> VulnerabilityVendor
newVulnerabilityVendor Text
pName_ =
VulnerabilityVendor' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> VulnerabilityVendor
VulnerabilityVendor'
{ $sel:vendorSeverity:VulnerabilityVendor' :: Maybe Text
vendorSeverity =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:url:VulnerabilityVendor' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:vendorCreatedAt:VulnerabilityVendor' :: Maybe Text
vendorCreatedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:vendorUpdatedAt:VulnerabilityVendor' :: Maybe Text
vendorUpdatedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:VulnerabilityVendor' :: Text
name = Text
pName_
}
vulnerabilityVendor_vendorSeverity :: Lens.Lens' VulnerabilityVendor (Prelude.Maybe Prelude.Text)
vulnerabilityVendor_vendorSeverity :: (Maybe Text -> f (Maybe Text))
-> VulnerabilityVendor -> f VulnerabilityVendor
vulnerabilityVendor_vendorSeverity = (VulnerabilityVendor -> Maybe Text)
-> (VulnerabilityVendor -> Maybe Text -> VulnerabilityVendor)
-> Lens
VulnerabilityVendor VulnerabilityVendor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VulnerabilityVendor' {Maybe Text
vendorSeverity :: Maybe Text
$sel:vendorSeverity:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
vendorSeverity} -> Maybe Text
vendorSeverity) (\s :: VulnerabilityVendor
s@VulnerabilityVendor' {} Maybe Text
a -> VulnerabilityVendor
s {$sel:vendorSeverity:VulnerabilityVendor' :: Maybe Text
vendorSeverity = Maybe Text
a} :: VulnerabilityVendor)
vulnerabilityVendor_url :: Lens.Lens' VulnerabilityVendor (Prelude.Maybe Prelude.Text)
vulnerabilityVendor_url :: (Maybe Text -> f (Maybe Text))
-> VulnerabilityVendor -> f VulnerabilityVendor
vulnerabilityVendor_url = (VulnerabilityVendor -> Maybe Text)
-> (VulnerabilityVendor -> Maybe Text -> VulnerabilityVendor)
-> Lens
VulnerabilityVendor VulnerabilityVendor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VulnerabilityVendor' {Maybe Text
url :: Maybe Text
$sel:url:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
url} -> Maybe Text
url) (\s :: VulnerabilityVendor
s@VulnerabilityVendor' {} Maybe Text
a -> VulnerabilityVendor
s {$sel:url:VulnerabilityVendor' :: Maybe Text
url = Maybe Text
a} :: VulnerabilityVendor)
vulnerabilityVendor_vendorCreatedAt :: Lens.Lens' VulnerabilityVendor (Prelude.Maybe Prelude.Text)
vulnerabilityVendor_vendorCreatedAt :: (Maybe Text -> f (Maybe Text))
-> VulnerabilityVendor -> f VulnerabilityVendor
vulnerabilityVendor_vendorCreatedAt = (VulnerabilityVendor -> Maybe Text)
-> (VulnerabilityVendor -> Maybe Text -> VulnerabilityVendor)
-> Lens
VulnerabilityVendor VulnerabilityVendor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VulnerabilityVendor' {Maybe Text
vendorCreatedAt :: Maybe Text
$sel:vendorCreatedAt:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
vendorCreatedAt} -> Maybe Text
vendorCreatedAt) (\s :: VulnerabilityVendor
s@VulnerabilityVendor' {} Maybe Text
a -> VulnerabilityVendor
s {$sel:vendorCreatedAt:VulnerabilityVendor' :: Maybe Text
vendorCreatedAt = Maybe Text
a} :: VulnerabilityVendor)
vulnerabilityVendor_vendorUpdatedAt :: Lens.Lens' VulnerabilityVendor (Prelude.Maybe Prelude.Text)
vulnerabilityVendor_vendorUpdatedAt :: (Maybe Text -> f (Maybe Text))
-> VulnerabilityVendor -> f VulnerabilityVendor
vulnerabilityVendor_vendorUpdatedAt = (VulnerabilityVendor -> Maybe Text)
-> (VulnerabilityVendor -> Maybe Text -> VulnerabilityVendor)
-> Lens
VulnerabilityVendor VulnerabilityVendor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VulnerabilityVendor' {Maybe Text
vendorUpdatedAt :: Maybe Text
$sel:vendorUpdatedAt:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
vendorUpdatedAt} -> Maybe Text
vendorUpdatedAt) (\s :: VulnerabilityVendor
s@VulnerabilityVendor' {} Maybe Text
a -> VulnerabilityVendor
s {$sel:vendorUpdatedAt:VulnerabilityVendor' :: Maybe Text
vendorUpdatedAt = Maybe Text
a} :: VulnerabilityVendor)
vulnerabilityVendor_name :: Lens.Lens' VulnerabilityVendor Prelude.Text
vulnerabilityVendor_name :: (Text -> f Text) -> VulnerabilityVendor -> f VulnerabilityVendor
vulnerabilityVendor_name = (VulnerabilityVendor -> Text)
-> (VulnerabilityVendor -> Text -> VulnerabilityVendor)
-> Lens VulnerabilityVendor VulnerabilityVendor Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VulnerabilityVendor' {Text
name :: Text
$sel:name:VulnerabilityVendor' :: VulnerabilityVendor -> Text
name} -> Text
name) (\s :: VulnerabilityVendor
s@VulnerabilityVendor' {} Text
a -> VulnerabilityVendor
s {$sel:name:VulnerabilityVendor' :: Text
name = Text
a} :: VulnerabilityVendor)
instance Core.FromJSON VulnerabilityVendor where
parseJSON :: Value -> Parser VulnerabilityVendor
parseJSON =
String
-> (Object -> Parser VulnerabilityVendor)
-> Value
-> Parser VulnerabilityVendor
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VulnerabilityVendor"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> VulnerabilityVendor
VulnerabilityVendor'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> VulnerabilityVendor)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Text -> VulnerabilityVendor)
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
"VendorSeverity")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Text -> VulnerabilityVendor)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Text -> VulnerabilityVendor)
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
"Url")
Parser (Maybe Text -> Maybe Text -> Text -> VulnerabilityVendor)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> VulnerabilityVendor)
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
"VendorCreatedAt")
Parser (Maybe Text -> Text -> VulnerabilityVendor)
-> Parser (Maybe Text) -> Parser (Text -> VulnerabilityVendor)
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
"VendorUpdatedAt")
Parser (Text -> VulnerabilityVendor)
-> Parser Text -> Parser VulnerabilityVendor
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
)
instance Prelude.Hashable VulnerabilityVendor
instance Prelude.NFData VulnerabilityVendor
instance Core.ToJSON VulnerabilityVendor where
toJSON :: VulnerabilityVendor -> Value
toJSON VulnerabilityVendor' {Maybe Text
Text
name :: Text
vendorUpdatedAt :: Maybe Text
vendorCreatedAt :: Maybe Text
url :: Maybe Text
vendorSeverity :: Maybe Text
$sel:name:VulnerabilityVendor' :: VulnerabilityVendor -> Text
$sel:vendorUpdatedAt:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
$sel:vendorCreatedAt:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
$sel:url:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
$sel:vendorSeverity:VulnerabilityVendor' :: VulnerabilityVendor -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"VendorSeverity" 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
vendorSeverity,
(Text
"Url" 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
url,
(Text
"VendorCreatedAt" 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
vendorCreatedAt,
(Text
"VendorUpdatedAt" 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
vendorUpdatedAt,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)