{-# 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.ShareDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalog.Types.ShareError
data ShareDetails = ShareDetails'
{
ShareDetails -> Maybe [ShareError]
shareErrors :: Prelude.Maybe [ShareError],
ShareDetails -> Maybe [Text]
successfulShares :: Prelude.Maybe [Prelude.Text]
}
deriving (ShareDetails -> ShareDetails -> Bool
(ShareDetails -> ShareDetails -> Bool)
-> (ShareDetails -> ShareDetails -> Bool) -> Eq ShareDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShareDetails -> ShareDetails -> Bool
$c/= :: ShareDetails -> ShareDetails -> Bool
== :: ShareDetails -> ShareDetails -> Bool
$c== :: ShareDetails -> ShareDetails -> Bool
Prelude.Eq, ReadPrec [ShareDetails]
ReadPrec ShareDetails
Int -> ReadS ShareDetails
ReadS [ShareDetails]
(Int -> ReadS ShareDetails)
-> ReadS [ShareDetails]
-> ReadPrec ShareDetails
-> ReadPrec [ShareDetails]
-> Read ShareDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShareDetails]
$creadListPrec :: ReadPrec [ShareDetails]
readPrec :: ReadPrec ShareDetails
$creadPrec :: ReadPrec ShareDetails
readList :: ReadS [ShareDetails]
$creadList :: ReadS [ShareDetails]
readsPrec :: Int -> ReadS ShareDetails
$creadsPrec :: Int -> ReadS ShareDetails
Prelude.Read, Int -> ShareDetails -> ShowS
[ShareDetails] -> ShowS
ShareDetails -> String
(Int -> ShareDetails -> ShowS)
-> (ShareDetails -> String)
-> ([ShareDetails] -> ShowS)
-> Show ShareDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShareDetails] -> ShowS
$cshowList :: [ShareDetails] -> ShowS
show :: ShareDetails -> String
$cshow :: ShareDetails -> String
showsPrec :: Int -> ShareDetails -> ShowS
$cshowsPrec :: Int -> ShareDetails -> ShowS
Prelude.Show, (forall x. ShareDetails -> Rep ShareDetails x)
-> (forall x. Rep ShareDetails x -> ShareDetails)
-> Generic ShareDetails
forall x. Rep ShareDetails x -> ShareDetails
forall x. ShareDetails -> Rep ShareDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShareDetails x -> ShareDetails
$cfrom :: forall x. ShareDetails -> Rep ShareDetails x
Prelude.Generic)
newShareDetails ::
ShareDetails
newShareDetails :: ShareDetails
newShareDetails =
ShareDetails' :: Maybe [ShareError] -> Maybe [Text] -> ShareDetails
ShareDetails'
{ $sel:shareErrors:ShareDetails' :: Maybe [ShareError]
shareErrors = Maybe [ShareError]
forall a. Maybe a
Prelude.Nothing,
$sel:successfulShares:ShareDetails' :: Maybe [Text]
successfulShares = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
shareDetails_shareErrors :: Lens.Lens' ShareDetails (Prelude.Maybe [ShareError])
shareDetails_shareErrors :: (Maybe [ShareError] -> f (Maybe [ShareError]))
-> ShareDetails -> f ShareDetails
shareDetails_shareErrors = (ShareDetails -> Maybe [ShareError])
-> (ShareDetails -> Maybe [ShareError] -> ShareDetails)
-> Lens
ShareDetails ShareDetails (Maybe [ShareError]) (Maybe [ShareError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareDetails' {Maybe [ShareError]
shareErrors :: Maybe [ShareError]
$sel:shareErrors:ShareDetails' :: ShareDetails -> Maybe [ShareError]
shareErrors} -> Maybe [ShareError]
shareErrors) (\s :: ShareDetails
s@ShareDetails' {} Maybe [ShareError]
a -> ShareDetails
s {$sel:shareErrors:ShareDetails' :: Maybe [ShareError]
shareErrors = Maybe [ShareError]
a} :: ShareDetails) ((Maybe [ShareError] -> f (Maybe [ShareError]))
-> ShareDetails -> f ShareDetails)
-> ((Maybe [ShareError] -> f (Maybe [ShareError]))
-> Maybe [ShareError] -> f (Maybe [ShareError]))
-> (Maybe [ShareError] -> f (Maybe [ShareError]))
-> ShareDetails
-> f ShareDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ShareError] [ShareError] [ShareError] [ShareError]
-> Iso
(Maybe [ShareError])
(Maybe [ShareError])
(Maybe [ShareError])
(Maybe [ShareError])
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 [ShareError] [ShareError] [ShareError] [ShareError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
shareDetails_successfulShares :: Lens.Lens' ShareDetails (Prelude.Maybe [Prelude.Text])
shareDetails_successfulShares :: (Maybe [Text] -> f (Maybe [Text]))
-> ShareDetails -> f ShareDetails
shareDetails_successfulShares = (ShareDetails -> Maybe [Text])
-> (ShareDetails -> Maybe [Text] -> ShareDetails)
-> Lens ShareDetails ShareDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareDetails' {Maybe [Text]
successfulShares :: Maybe [Text]
$sel:successfulShares:ShareDetails' :: ShareDetails -> Maybe [Text]
successfulShares} -> Maybe [Text]
successfulShares) (\s :: ShareDetails
s@ShareDetails' {} Maybe [Text]
a -> ShareDetails
s {$sel:successfulShares:ShareDetails' :: Maybe [Text]
successfulShares = Maybe [Text]
a} :: ShareDetails) ((Maybe [Text] -> f (Maybe [Text]))
-> ShareDetails -> f ShareDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ShareDetails
-> f ShareDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ShareDetails where
parseJSON :: Value -> Parser ShareDetails
parseJSON =
String
-> (Object -> Parser ShareDetails) -> Value -> Parser ShareDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ShareDetails"
( \Object
x ->
Maybe [ShareError] -> Maybe [Text] -> ShareDetails
ShareDetails'
(Maybe [ShareError] -> Maybe [Text] -> ShareDetails)
-> Parser (Maybe [ShareError])
-> Parser (Maybe [Text] -> ShareDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [ShareError]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShareErrors" Parser (Maybe (Maybe [ShareError]))
-> Maybe [ShareError] -> Parser (Maybe [ShareError])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ShareError]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe [Text] -> ShareDetails)
-> Parser (Maybe [Text]) -> Parser ShareDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SuccessfulShares"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ShareDetails
instance Prelude.NFData ShareDetails