{-# 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.ServiceCatalog.Types.ConstraintDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConstraintDetail = ConstraintDetail'
{
ConstraintDetail -> Maybe Text
portfolioId :: Prelude.Maybe Prelude.Text,
ConstraintDetail -> Maybe Text
constraintId :: Prelude.Maybe Prelude.Text,
ConstraintDetail -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
ConstraintDetail -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
ConstraintDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ConstraintDetail -> Maybe Text
productId :: Prelude.Maybe Prelude.Text
}
deriving (ConstraintDetail -> ConstraintDetail -> Bool
(ConstraintDetail -> ConstraintDetail -> Bool)
-> (ConstraintDetail -> ConstraintDetail -> Bool)
-> Eq ConstraintDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConstraintDetail -> ConstraintDetail -> Bool
$c/= :: ConstraintDetail -> ConstraintDetail -> Bool
== :: ConstraintDetail -> ConstraintDetail -> Bool
$c== :: ConstraintDetail -> ConstraintDetail -> Bool
Prelude.Eq, ReadPrec [ConstraintDetail]
ReadPrec ConstraintDetail
Int -> ReadS ConstraintDetail
ReadS [ConstraintDetail]
(Int -> ReadS ConstraintDetail)
-> ReadS [ConstraintDetail]
-> ReadPrec ConstraintDetail
-> ReadPrec [ConstraintDetail]
-> Read ConstraintDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConstraintDetail]
$creadListPrec :: ReadPrec [ConstraintDetail]
readPrec :: ReadPrec ConstraintDetail
$creadPrec :: ReadPrec ConstraintDetail
readList :: ReadS [ConstraintDetail]
$creadList :: ReadS [ConstraintDetail]
readsPrec :: Int -> ReadS ConstraintDetail
$creadsPrec :: Int -> ReadS ConstraintDetail
Prelude.Read, Int -> ConstraintDetail -> ShowS
[ConstraintDetail] -> ShowS
ConstraintDetail -> String
(Int -> ConstraintDetail -> ShowS)
-> (ConstraintDetail -> String)
-> ([ConstraintDetail] -> ShowS)
-> Show ConstraintDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConstraintDetail] -> ShowS
$cshowList :: [ConstraintDetail] -> ShowS
show :: ConstraintDetail -> String
$cshow :: ConstraintDetail -> String
showsPrec :: Int -> ConstraintDetail -> ShowS
$cshowsPrec :: Int -> ConstraintDetail -> ShowS
Prelude.Show, (forall x. ConstraintDetail -> Rep ConstraintDetail x)
-> (forall x. Rep ConstraintDetail x -> ConstraintDetail)
-> Generic ConstraintDetail
forall x. Rep ConstraintDetail x -> ConstraintDetail
forall x. ConstraintDetail -> Rep ConstraintDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConstraintDetail x -> ConstraintDetail
$cfrom :: forall x. ConstraintDetail -> Rep ConstraintDetail x
Prelude.Generic)
newConstraintDetail ::
ConstraintDetail
newConstraintDetail :: ConstraintDetail
newConstraintDetail =
ConstraintDetail' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ConstraintDetail
ConstraintDetail'
{ $sel:portfolioId:ConstraintDetail' :: Maybe Text
portfolioId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:constraintId:ConstraintDetail' :: Maybe Text
constraintId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:owner:ConstraintDetail' :: Maybe Text
owner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':ConstraintDetail' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:ConstraintDetail' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:productId:ConstraintDetail' :: Maybe Text
productId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
constraintDetail_portfolioId :: Lens.Lens' ConstraintDetail (Prelude.Maybe Prelude.Text)
constraintDetail_portfolioId :: (Maybe Text -> f (Maybe Text))
-> ConstraintDetail -> f ConstraintDetail
constraintDetail_portfolioId = (ConstraintDetail -> Maybe Text)
-> (ConstraintDetail -> Maybe Text -> ConstraintDetail)
-> Lens ConstraintDetail ConstraintDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConstraintDetail' {Maybe Text
portfolioId :: Maybe Text
$sel:portfolioId:ConstraintDetail' :: ConstraintDetail -> Maybe Text
portfolioId} -> Maybe Text
portfolioId) (\s :: ConstraintDetail
s@ConstraintDetail' {} Maybe Text
a -> ConstraintDetail
s {$sel:portfolioId:ConstraintDetail' :: Maybe Text
portfolioId = Maybe Text
a} :: ConstraintDetail)
constraintDetail_constraintId :: Lens.Lens' ConstraintDetail (Prelude.Maybe Prelude.Text)
constraintDetail_constraintId :: (Maybe Text -> f (Maybe Text))
-> ConstraintDetail -> f ConstraintDetail
constraintDetail_constraintId = (ConstraintDetail -> Maybe Text)
-> (ConstraintDetail -> Maybe Text -> ConstraintDetail)
-> Lens ConstraintDetail ConstraintDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConstraintDetail' {Maybe Text
constraintId :: Maybe Text
$sel:constraintId:ConstraintDetail' :: ConstraintDetail -> Maybe Text
constraintId} -> Maybe Text
constraintId) (\s :: ConstraintDetail
s@ConstraintDetail' {} Maybe Text
a -> ConstraintDetail
s {$sel:constraintId:ConstraintDetail' :: Maybe Text
constraintId = Maybe Text
a} :: ConstraintDetail)
constraintDetail_owner :: Lens.Lens' ConstraintDetail (Prelude.Maybe Prelude.Text)
constraintDetail_owner :: (Maybe Text -> f (Maybe Text))
-> ConstraintDetail -> f ConstraintDetail
constraintDetail_owner = (ConstraintDetail -> Maybe Text)
-> (ConstraintDetail -> Maybe Text -> ConstraintDetail)
-> Lens ConstraintDetail ConstraintDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConstraintDetail' {Maybe Text
owner :: Maybe Text
$sel:owner:ConstraintDetail' :: ConstraintDetail -> Maybe Text
owner} -> Maybe Text
owner) (\s :: ConstraintDetail
s@ConstraintDetail' {} Maybe Text
a -> ConstraintDetail
s {$sel:owner:ConstraintDetail' :: Maybe Text
owner = Maybe Text
a} :: ConstraintDetail)
constraintDetail_type :: Lens.Lens' ConstraintDetail (Prelude.Maybe Prelude.Text)
constraintDetail_type :: (Maybe Text -> f (Maybe Text))
-> ConstraintDetail -> f ConstraintDetail
constraintDetail_type = (ConstraintDetail -> Maybe Text)
-> (ConstraintDetail -> Maybe Text -> ConstraintDetail)
-> Lens ConstraintDetail ConstraintDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConstraintDetail' {Maybe Text
type' :: Maybe Text
$sel:type':ConstraintDetail' :: ConstraintDetail -> Maybe Text
type'} -> Maybe Text
type') (\s :: ConstraintDetail
s@ConstraintDetail' {} Maybe Text
a -> ConstraintDetail
s {$sel:type':ConstraintDetail' :: Maybe Text
type' = Maybe Text
a} :: ConstraintDetail)
constraintDetail_description :: Lens.Lens' ConstraintDetail (Prelude.Maybe Prelude.Text)
constraintDetail_description :: (Maybe Text -> f (Maybe Text))
-> ConstraintDetail -> f ConstraintDetail
constraintDetail_description = (ConstraintDetail -> Maybe Text)
-> (ConstraintDetail -> Maybe Text -> ConstraintDetail)
-> Lens ConstraintDetail ConstraintDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConstraintDetail' {Maybe Text
description :: Maybe Text
$sel:description:ConstraintDetail' :: ConstraintDetail -> Maybe Text
description} -> Maybe Text
description) (\s :: ConstraintDetail
s@ConstraintDetail' {} Maybe Text
a -> ConstraintDetail
s {$sel:description:ConstraintDetail' :: Maybe Text
description = Maybe Text
a} :: ConstraintDetail)
constraintDetail_productId :: Lens.Lens' ConstraintDetail (Prelude.Maybe Prelude.Text)
constraintDetail_productId :: (Maybe Text -> f (Maybe Text))
-> ConstraintDetail -> f ConstraintDetail
constraintDetail_productId = (ConstraintDetail -> Maybe Text)
-> (ConstraintDetail -> Maybe Text -> ConstraintDetail)
-> Lens ConstraintDetail ConstraintDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConstraintDetail' {Maybe Text
productId :: Maybe Text
$sel:productId:ConstraintDetail' :: ConstraintDetail -> Maybe Text
productId} -> Maybe Text
productId) (\s :: ConstraintDetail
s@ConstraintDetail' {} Maybe Text
a -> ConstraintDetail
s {$sel:productId:ConstraintDetail' :: Maybe Text
productId = Maybe Text
a} :: ConstraintDetail)
instance Core.FromJSON ConstraintDetail where
parseJSON :: Value -> Parser ConstraintDetail
parseJSON =
String
-> (Object -> Parser ConstraintDetail)
-> Value
-> Parser ConstraintDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ConstraintDetail"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ConstraintDetail
ConstraintDetail'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ConstraintDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ConstraintDetail)
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
"PortfolioId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ConstraintDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ConstraintDetail)
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
"ConstraintId")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ConstraintDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> ConstraintDetail)
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
"Owner")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> ConstraintDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ConstraintDetail)
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
"Type")
Parser (Maybe Text -> Maybe Text -> ConstraintDetail)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ConstraintDetail)
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
"Description")
Parser (Maybe Text -> ConstraintDetail)
-> Parser (Maybe Text) -> Parser ConstraintDetail
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
"ProductId")
)
instance Prelude.Hashable ConstraintDetail
instance Prelude.NFData ConstraintDetail