{-# 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.PortfolioShareDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalog.Types.DescribePortfolioShareType
data PortfolioShareDetail = PortfolioShareDetail'
{
PortfolioShareDetail -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
PortfolioShareDetail -> Maybe Bool
shareTagOptions :: Prelude.Maybe Prelude.Bool,
PortfolioShareDetail -> Maybe DescribePortfolioShareType
type' :: Prelude.Maybe DescribePortfolioShareType,
PortfolioShareDetail -> Maybe Bool
accepted :: Prelude.Maybe Prelude.Bool
}
deriving (PortfolioShareDetail -> PortfolioShareDetail -> Bool
(PortfolioShareDetail -> PortfolioShareDetail -> Bool)
-> (PortfolioShareDetail -> PortfolioShareDetail -> Bool)
-> Eq PortfolioShareDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PortfolioShareDetail -> PortfolioShareDetail -> Bool
$c/= :: PortfolioShareDetail -> PortfolioShareDetail -> Bool
== :: PortfolioShareDetail -> PortfolioShareDetail -> Bool
$c== :: PortfolioShareDetail -> PortfolioShareDetail -> Bool
Prelude.Eq, ReadPrec [PortfolioShareDetail]
ReadPrec PortfolioShareDetail
Int -> ReadS PortfolioShareDetail
ReadS [PortfolioShareDetail]
(Int -> ReadS PortfolioShareDetail)
-> ReadS [PortfolioShareDetail]
-> ReadPrec PortfolioShareDetail
-> ReadPrec [PortfolioShareDetail]
-> Read PortfolioShareDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PortfolioShareDetail]
$creadListPrec :: ReadPrec [PortfolioShareDetail]
readPrec :: ReadPrec PortfolioShareDetail
$creadPrec :: ReadPrec PortfolioShareDetail
readList :: ReadS [PortfolioShareDetail]
$creadList :: ReadS [PortfolioShareDetail]
readsPrec :: Int -> ReadS PortfolioShareDetail
$creadsPrec :: Int -> ReadS PortfolioShareDetail
Prelude.Read, Int -> PortfolioShareDetail -> ShowS
[PortfolioShareDetail] -> ShowS
PortfolioShareDetail -> String
(Int -> PortfolioShareDetail -> ShowS)
-> (PortfolioShareDetail -> String)
-> ([PortfolioShareDetail] -> ShowS)
-> Show PortfolioShareDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PortfolioShareDetail] -> ShowS
$cshowList :: [PortfolioShareDetail] -> ShowS
show :: PortfolioShareDetail -> String
$cshow :: PortfolioShareDetail -> String
showsPrec :: Int -> PortfolioShareDetail -> ShowS
$cshowsPrec :: Int -> PortfolioShareDetail -> ShowS
Prelude.Show, (forall x. PortfolioShareDetail -> Rep PortfolioShareDetail x)
-> (forall x. Rep PortfolioShareDetail x -> PortfolioShareDetail)
-> Generic PortfolioShareDetail
forall x. Rep PortfolioShareDetail x -> PortfolioShareDetail
forall x. PortfolioShareDetail -> Rep PortfolioShareDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PortfolioShareDetail x -> PortfolioShareDetail
$cfrom :: forall x. PortfolioShareDetail -> Rep PortfolioShareDetail x
Prelude.Generic)
newPortfolioShareDetail ::
PortfolioShareDetail
newPortfolioShareDetail :: PortfolioShareDetail
newPortfolioShareDetail =
PortfolioShareDetail' :: Maybe Text
-> Maybe Bool
-> Maybe DescribePortfolioShareType
-> Maybe Bool
-> PortfolioShareDetail
PortfolioShareDetail'
{ $sel:principalId:PortfolioShareDetail' :: Maybe Text
principalId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:shareTagOptions:PortfolioShareDetail' :: Maybe Bool
shareTagOptions = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:type':PortfolioShareDetail' :: Maybe DescribePortfolioShareType
type' = Maybe DescribePortfolioShareType
forall a. Maybe a
Prelude.Nothing,
$sel:accepted:PortfolioShareDetail' :: Maybe Bool
accepted = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
portfolioShareDetail_principalId :: Lens.Lens' PortfolioShareDetail (Prelude.Maybe Prelude.Text)
portfolioShareDetail_principalId :: (Maybe Text -> f (Maybe Text))
-> PortfolioShareDetail -> f PortfolioShareDetail
portfolioShareDetail_principalId = (PortfolioShareDetail -> Maybe Text)
-> (PortfolioShareDetail -> Maybe Text -> PortfolioShareDetail)
-> Lens
PortfolioShareDetail PortfolioShareDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioShareDetail' {Maybe Text
principalId :: Maybe Text
$sel:principalId:PortfolioShareDetail' :: PortfolioShareDetail -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: PortfolioShareDetail
s@PortfolioShareDetail' {} Maybe Text
a -> PortfolioShareDetail
s {$sel:principalId:PortfolioShareDetail' :: Maybe Text
principalId = Maybe Text
a} :: PortfolioShareDetail)
portfolioShareDetail_shareTagOptions :: Lens.Lens' PortfolioShareDetail (Prelude.Maybe Prelude.Bool)
portfolioShareDetail_shareTagOptions :: (Maybe Bool -> f (Maybe Bool))
-> PortfolioShareDetail -> f PortfolioShareDetail
portfolioShareDetail_shareTagOptions = (PortfolioShareDetail -> Maybe Bool)
-> (PortfolioShareDetail -> Maybe Bool -> PortfolioShareDetail)
-> Lens
PortfolioShareDetail PortfolioShareDetail (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioShareDetail' {Maybe Bool
shareTagOptions :: Maybe Bool
$sel:shareTagOptions:PortfolioShareDetail' :: PortfolioShareDetail -> Maybe Bool
shareTagOptions} -> Maybe Bool
shareTagOptions) (\s :: PortfolioShareDetail
s@PortfolioShareDetail' {} Maybe Bool
a -> PortfolioShareDetail
s {$sel:shareTagOptions:PortfolioShareDetail' :: Maybe Bool
shareTagOptions = Maybe Bool
a} :: PortfolioShareDetail)
portfolioShareDetail_type :: Lens.Lens' PortfolioShareDetail (Prelude.Maybe DescribePortfolioShareType)
portfolioShareDetail_type :: (Maybe DescribePortfolioShareType
-> f (Maybe DescribePortfolioShareType))
-> PortfolioShareDetail -> f PortfolioShareDetail
portfolioShareDetail_type = (PortfolioShareDetail -> Maybe DescribePortfolioShareType)
-> (PortfolioShareDetail
-> Maybe DescribePortfolioShareType -> PortfolioShareDetail)
-> Lens
PortfolioShareDetail
PortfolioShareDetail
(Maybe DescribePortfolioShareType)
(Maybe DescribePortfolioShareType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioShareDetail' {Maybe DescribePortfolioShareType
type' :: Maybe DescribePortfolioShareType
$sel:type':PortfolioShareDetail' :: PortfolioShareDetail -> Maybe DescribePortfolioShareType
type'} -> Maybe DescribePortfolioShareType
type') (\s :: PortfolioShareDetail
s@PortfolioShareDetail' {} Maybe DescribePortfolioShareType
a -> PortfolioShareDetail
s {$sel:type':PortfolioShareDetail' :: Maybe DescribePortfolioShareType
type' = Maybe DescribePortfolioShareType
a} :: PortfolioShareDetail)
portfolioShareDetail_accepted :: Lens.Lens' PortfolioShareDetail (Prelude.Maybe Prelude.Bool)
portfolioShareDetail_accepted :: (Maybe Bool -> f (Maybe Bool))
-> PortfolioShareDetail -> f PortfolioShareDetail
portfolioShareDetail_accepted = (PortfolioShareDetail -> Maybe Bool)
-> (PortfolioShareDetail -> Maybe Bool -> PortfolioShareDetail)
-> Lens
PortfolioShareDetail PortfolioShareDetail (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioShareDetail' {Maybe Bool
accepted :: Maybe Bool
$sel:accepted:PortfolioShareDetail' :: PortfolioShareDetail -> Maybe Bool
accepted} -> Maybe Bool
accepted) (\s :: PortfolioShareDetail
s@PortfolioShareDetail' {} Maybe Bool
a -> PortfolioShareDetail
s {$sel:accepted:PortfolioShareDetail' :: Maybe Bool
accepted = Maybe Bool
a} :: PortfolioShareDetail)
instance Core.FromJSON PortfolioShareDetail where
parseJSON :: Value -> Parser PortfolioShareDetail
parseJSON =
String
-> (Object -> Parser PortfolioShareDetail)
-> Value
-> Parser PortfolioShareDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PortfolioShareDetail"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe DescribePortfolioShareType
-> Maybe Bool
-> PortfolioShareDetail
PortfolioShareDetail'
(Maybe Text
-> Maybe Bool
-> Maybe DescribePortfolioShareType
-> Maybe Bool
-> PortfolioShareDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe DescribePortfolioShareType
-> Maybe Bool
-> PortfolioShareDetail)
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
"PrincipalId")
Parser
(Maybe Bool
-> Maybe DescribePortfolioShareType
-> Maybe Bool
-> PortfolioShareDetail)
-> Parser (Maybe Bool)
-> Parser
(Maybe DescribePortfolioShareType
-> Maybe Bool -> PortfolioShareDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShareTagOptions")
Parser
(Maybe DescribePortfolioShareType
-> Maybe Bool -> PortfolioShareDetail)
-> Parser (Maybe DescribePortfolioShareType)
-> Parser (Maybe Bool -> PortfolioShareDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DescribePortfolioShareType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Bool -> PortfolioShareDetail)
-> Parser (Maybe Bool) -> Parser PortfolioShareDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Accepted")
)
instance Prelude.Hashable PortfolioShareDetail
instance Prelude.NFData PortfolioShareDetail