{-# 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.CodeGuruReviewer.Types.RuleMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RuleMetadata = RuleMetadata'
{
RuleMetadata -> Maybe Text
longDescription :: Prelude.Maybe Prelude.Text,
RuleMetadata -> Maybe (NonEmpty Text)
ruleTags :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
RuleMetadata -> Maybe Text
ruleId :: Prelude.Maybe Prelude.Text,
RuleMetadata -> Maybe Text
ruleName :: Prelude.Maybe Prelude.Text,
RuleMetadata -> Maybe Text
shortDescription :: Prelude.Maybe Prelude.Text
}
deriving (RuleMetadata -> RuleMetadata -> Bool
(RuleMetadata -> RuleMetadata -> Bool)
-> (RuleMetadata -> RuleMetadata -> Bool) -> Eq RuleMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleMetadata -> RuleMetadata -> Bool
$c/= :: RuleMetadata -> RuleMetadata -> Bool
== :: RuleMetadata -> RuleMetadata -> Bool
$c== :: RuleMetadata -> RuleMetadata -> Bool
Prelude.Eq, ReadPrec [RuleMetadata]
ReadPrec RuleMetadata
Int -> ReadS RuleMetadata
ReadS [RuleMetadata]
(Int -> ReadS RuleMetadata)
-> ReadS [RuleMetadata]
-> ReadPrec RuleMetadata
-> ReadPrec [RuleMetadata]
-> Read RuleMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleMetadata]
$creadListPrec :: ReadPrec [RuleMetadata]
readPrec :: ReadPrec RuleMetadata
$creadPrec :: ReadPrec RuleMetadata
readList :: ReadS [RuleMetadata]
$creadList :: ReadS [RuleMetadata]
readsPrec :: Int -> ReadS RuleMetadata
$creadsPrec :: Int -> ReadS RuleMetadata
Prelude.Read, Int -> RuleMetadata -> ShowS
[RuleMetadata] -> ShowS
RuleMetadata -> String
(Int -> RuleMetadata -> ShowS)
-> (RuleMetadata -> String)
-> ([RuleMetadata] -> ShowS)
-> Show RuleMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleMetadata] -> ShowS
$cshowList :: [RuleMetadata] -> ShowS
show :: RuleMetadata -> String
$cshow :: RuleMetadata -> String
showsPrec :: Int -> RuleMetadata -> ShowS
$cshowsPrec :: Int -> RuleMetadata -> ShowS
Prelude.Show, (forall x. RuleMetadata -> Rep RuleMetadata x)
-> (forall x. Rep RuleMetadata x -> RuleMetadata)
-> Generic RuleMetadata
forall x. Rep RuleMetadata x -> RuleMetadata
forall x. RuleMetadata -> Rep RuleMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleMetadata x -> RuleMetadata
$cfrom :: forall x. RuleMetadata -> Rep RuleMetadata x
Prelude.Generic)
newRuleMetadata ::
RuleMetadata
newRuleMetadata :: RuleMetadata
newRuleMetadata =
RuleMetadata' :: Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RuleMetadata
RuleMetadata'
{ $sel:longDescription:RuleMetadata' :: Maybe Text
longDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleTags:RuleMetadata' :: Maybe (NonEmpty Text)
ruleTags = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:ruleId:RuleMetadata' :: Maybe Text
ruleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleName:RuleMetadata' :: Maybe Text
ruleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:shortDescription:RuleMetadata' :: Maybe Text
shortDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
ruleMetadata_longDescription :: Lens.Lens' RuleMetadata (Prelude.Maybe Prelude.Text)
ruleMetadata_longDescription :: (Maybe Text -> f (Maybe Text)) -> RuleMetadata -> f RuleMetadata
ruleMetadata_longDescription = (RuleMetadata -> Maybe Text)
-> (RuleMetadata -> Maybe Text -> RuleMetadata)
-> Lens RuleMetadata RuleMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleMetadata' {Maybe Text
longDescription :: Maybe Text
$sel:longDescription:RuleMetadata' :: RuleMetadata -> Maybe Text
longDescription} -> Maybe Text
longDescription) (\s :: RuleMetadata
s@RuleMetadata' {} Maybe Text
a -> RuleMetadata
s {$sel:longDescription:RuleMetadata' :: Maybe Text
longDescription = Maybe Text
a} :: RuleMetadata)
ruleMetadata_ruleTags :: Lens.Lens' RuleMetadata (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
ruleMetadata_ruleTags :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RuleMetadata -> f RuleMetadata
ruleMetadata_ruleTags = (RuleMetadata -> Maybe (NonEmpty Text))
-> (RuleMetadata -> Maybe (NonEmpty Text) -> RuleMetadata)
-> Lens
RuleMetadata
RuleMetadata
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleMetadata' {Maybe (NonEmpty Text)
ruleTags :: Maybe (NonEmpty Text)
$sel:ruleTags:RuleMetadata' :: RuleMetadata -> Maybe (NonEmpty Text)
ruleTags} -> Maybe (NonEmpty Text)
ruleTags) (\s :: RuleMetadata
s@RuleMetadata' {} Maybe (NonEmpty Text)
a -> RuleMetadata
s {$sel:ruleTags:RuleMetadata' :: Maybe (NonEmpty Text)
ruleTags = Maybe (NonEmpty Text)
a} :: RuleMetadata) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RuleMetadata -> f RuleMetadata)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RuleMetadata
-> f RuleMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty 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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
ruleMetadata_ruleId :: Lens.Lens' RuleMetadata (Prelude.Maybe Prelude.Text)
ruleMetadata_ruleId :: (Maybe Text -> f (Maybe Text)) -> RuleMetadata -> f RuleMetadata
ruleMetadata_ruleId = (RuleMetadata -> Maybe Text)
-> (RuleMetadata -> Maybe Text -> RuleMetadata)
-> Lens RuleMetadata RuleMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleMetadata' {Maybe Text
ruleId :: Maybe Text
$sel:ruleId:RuleMetadata' :: RuleMetadata -> Maybe Text
ruleId} -> Maybe Text
ruleId) (\s :: RuleMetadata
s@RuleMetadata' {} Maybe Text
a -> RuleMetadata
s {$sel:ruleId:RuleMetadata' :: Maybe Text
ruleId = Maybe Text
a} :: RuleMetadata)
ruleMetadata_ruleName :: Lens.Lens' RuleMetadata (Prelude.Maybe Prelude.Text)
ruleMetadata_ruleName :: (Maybe Text -> f (Maybe Text)) -> RuleMetadata -> f RuleMetadata
ruleMetadata_ruleName = (RuleMetadata -> Maybe Text)
-> (RuleMetadata -> Maybe Text -> RuleMetadata)
-> Lens RuleMetadata RuleMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleMetadata' {Maybe Text
ruleName :: Maybe Text
$sel:ruleName:RuleMetadata' :: RuleMetadata -> Maybe Text
ruleName} -> Maybe Text
ruleName) (\s :: RuleMetadata
s@RuleMetadata' {} Maybe Text
a -> RuleMetadata
s {$sel:ruleName:RuleMetadata' :: Maybe Text
ruleName = Maybe Text
a} :: RuleMetadata)
ruleMetadata_shortDescription :: Lens.Lens' RuleMetadata (Prelude.Maybe Prelude.Text)
ruleMetadata_shortDescription :: (Maybe Text -> f (Maybe Text)) -> RuleMetadata -> f RuleMetadata
ruleMetadata_shortDescription = (RuleMetadata -> Maybe Text)
-> (RuleMetadata -> Maybe Text -> RuleMetadata)
-> Lens RuleMetadata RuleMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleMetadata' {Maybe Text
shortDescription :: Maybe Text
$sel:shortDescription:RuleMetadata' :: RuleMetadata -> Maybe Text
shortDescription} -> Maybe Text
shortDescription) (\s :: RuleMetadata
s@RuleMetadata' {} Maybe Text
a -> RuleMetadata
s {$sel:shortDescription:RuleMetadata' :: Maybe Text
shortDescription = Maybe Text
a} :: RuleMetadata)
instance Core.FromJSON RuleMetadata where
parseJSON :: Value -> Parser RuleMetadata
parseJSON =
String
-> (Object -> Parser RuleMetadata) -> Value -> Parser RuleMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RuleMetadata"
( \Object
x ->
Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RuleMetadata
RuleMetadata'
(Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RuleMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe (NonEmpty Text)
-> Maybe Text -> Maybe Text -> Maybe Text -> RuleMetadata)
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
"LongDescription")
Parser
(Maybe (NonEmpty Text)
-> Maybe Text -> Maybe Text -> Maybe Text -> RuleMetadata)
-> Parser (Maybe (NonEmpty Text))
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> RuleMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleTags")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> RuleMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> RuleMetadata)
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
"RuleId")
Parser (Maybe Text -> Maybe Text -> RuleMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> RuleMetadata)
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
"RuleName")
Parser (Maybe Text -> RuleMetadata)
-> Parser (Maybe Text) -> Parser RuleMetadata
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
"ShortDescription")
)
instance Prelude.Hashable RuleMetadata
instance Prelude.NFData RuleMetadata