{-# 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.Config.Types.Compliance where
import Amazonka.Config.Types.ComplianceContributorCount
import Amazonka.Config.Types.ComplianceType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Compliance = Compliance'
{
Compliance -> Maybe ComplianceContributorCount
complianceContributorCount :: Prelude.Maybe ComplianceContributorCount,
Compliance -> Maybe ComplianceType
complianceType :: Prelude.Maybe ComplianceType
}
deriving (Compliance -> Compliance -> Bool
(Compliance -> Compliance -> Bool)
-> (Compliance -> Compliance -> Bool) -> Eq Compliance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Compliance -> Compliance -> Bool
$c/= :: Compliance -> Compliance -> Bool
== :: Compliance -> Compliance -> Bool
$c== :: Compliance -> Compliance -> Bool
Prelude.Eq, ReadPrec [Compliance]
ReadPrec Compliance
Int -> ReadS Compliance
ReadS [Compliance]
(Int -> ReadS Compliance)
-> ReadS [Compliance]
-> ReadPrec Compliance
-> ReadPrec [Compliance]
-> Read Compliance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Compliance]
$creadListPrec :: ReadPrec [Compliance]
readPrec :: ReadPrec Compliance
$creadPrec :: ReadPrec Compliance
readList :: ReadS [Compliance]
$creadList :: ReadS [Compliance]
readsPrec :: Int -> ReadS Compliance
$creadsPrec :: Int -> ReadS Compliance
Prelude.Read, Int -> Compliance -> ShowS
[Compliance] -> ShowS
Compliance -> String
(Int -> Compliance -> ShowS)
-> (Compliance -> String)
-> ([Compliance] -> ShowS)
-> Show Compliance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Compliance] -> ShowS
$cshowList :: [Compliance] -> ShowS
show :: Compliance -> String
$cshow :: Compliance -> String
showsPrec :: Int -> Compliance -> ShowS
$cshowsPrec :: Int -> Compliance -> ShowS
Prelude.Show, (forall x. Compliance -> Rep Compliance x)
-> (forall x. Rep Compliance x -> Compliance) -> Generic Compliance
forall x. Rep Compliance x -> Compliance
forall x. Compliance -> Rep Compliance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Compliance x -> Compliance
$cfrom :: forall x. Compliance -> Rep Compliance x
Prelude.Generic)
newCompliance ::
Compliance
newCompliance :: Compliance
newCompliance =
Compliance' :: Maybe ComplianceContributorCount
-> Maybe ComplianceType -> Compliance
Compliance'
{ $sel:complianceContributorCount:Compliance' :: Maybe ComplianceContributorCount
complianceContributorCount =
Maybe ComplianceContributorCount
forall a. Maybe a
Prelude.Nothing,
$sel:complianceType:Compliance' :: Maybe ComplianceType
complianceType = Maybe ComplianceType
forall a. Maybe a
Prelude.Nothing
}
compliance_complianceContributorCount :: Lens.Lens' Compliance (Prelude.Maybe ComplianceContributorCount)
compliance_complianceContributorCount :: (Maybe ComplianceContributorCount
-> f (Maybe ComplianceContributorCount))
-> Compliance -> f Compliance
compliance_complianceContributorCount = (Compliance -> Maybe ComplianceContributorCount)
-> (Compliance -> Maybe ComplianceContributorCount -> Compliance)
-> Lens
Compliance
Compliance
(Maybe ComplianceContributorCount)
(Maybe ComplianceContributorCount)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Compliance' {Maybe ComplianceContributorCount
complianceContributorCount :: Maybe ComplianceContributorCount
$sel:complianceContributorCount:Compliance' :: Compliance -> Maybe ComplianceContributorCount
complianceContributorCount} -> Maybe ComplianceContributorCount
complianceContributorCount) (\s :: Compliance
s@Compliance' {} Maybe ComplianceContributorCount
a -> Compliance
s {$sel:complianceContributorCount:Compliance' :: Maybe ComplianceContributorCount
complianceContributorCount = Maybe ComplianceContributorCount
a} :: Compliance)
compliance_complianceType :: Lens.Lens' Compliance (Prelude.Maybe ComplianceType)
compliance_complianceType :: (Maybe ComplianceType -> f (Maybe ComplianceType))
-> Compliance -> f Compliance
compliance_complianceType = (Compliance -> Maybe ComplianceType)
-> (Compliance -> Maybe ComplianceType -> Compliance)
-> Lens
Compliance Compliance (Maybe ComplianceType) (Maybe ComplianceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Compliance' {Maybe ComplianceType
complianceType :: Maybe ComplianceType
$sel:complianceType:Compliance' :: Compliance -> Maybe ComplianceType
complianceType} -> Maybe ComplianceType
complianceType) (\s :: Compliance
s@Compliance' {} Maybe ComplianceType
a -> Compliance
s {$sel:complianceType:Compliance' :: Maybe ComplianceType
complianceType = Maybe ComplianceType
a} :: Compliance)
instance Core.FromJSON Compliance where
parseJSON :: Value -> Parser Compliance
parseJSON =
String
-> (Object -> Parser Compliance) -> Value -> Parser Compliance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Compliance"
( \Object
x ->
Maybe ComplianceContributorCount
-> Maybe ComplianceType -> Compliance
Compliance'
(Maybe ComplianceContributorCount
-> Maybe ComplianceType -> Compliance)
-> Parser (Maybe ComplianceContributorCount)
-> Parser (Maybe ComplianceType -> Compliance)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ComplianceContributorCount)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComplianceContributorCount")
Parser (Maybe ComplianceType -> Compliance)
-> Parser (Maybe ComplianceType) -> Parser Compliance
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComplianceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComplianceType")
)
instance Prelude.Hashable Compliance
instance Prelude.NFData Compliance