{-# 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.ShareError where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ShareError = ShareError'
{
ShareError -> Maybe [Text]
accounts :: Prelude.Maybe [Prelude.Text],
ShareError -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
ShareError -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (ShareError -> ShareError -> Bool
(ShareError -> ShareError -> Bool)
-> (ShareError -> ShareError -> Bool) -> Eq ShareError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShareError -> ShareError -> Bool
$c/= :: ShareError -> ShareError -> Bool
== :: ShareError -> ShareError -> Bool
$c== :: ShareError -> ShareError -> Bool
Prelude.Eq, ReadPrec [ShareError]
ReadPrec ShareError
Int -> ReadS ShareError
ReadS [ShareError]
(Int -> ReadS ShareError)
-> ReadS [ShareError]
-> ReadPrec ShareError
-> ReadPrec [ShareError]
-> Read ShareError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShareError]
$creadListPrec :: ReadPrec [ShareError]
readPrec :: ReadPrec ShareError
$creadPrec :: ReadPrec ShareError
readList :: ReadS [ShareError]
$creadList :: ReadS [ShareError]
readsPrec :: Int -> ReadS ShareError
$creadsPrec :: Int -> ReadS ShareError
Prelude.Read, Int -> ShareError -> ShowS
[ShareError] -> ShowS
ShareError -> String
(Int -> ShareError -> ShowS)
-> (ShareError -> String)
-> ([ShareError] -> ShowS)
-> Show ShareError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShareError] -> ShowS
$cshowList :: [ShareError] -> ShowS
show :: ShareError -> String
$cshow :: ShareError -> String
showsPrec :: Int -> ShareError -> ShowS
$cshowsPrec :: Int -> ShareError -> ShowS
Prelude.Show, (forall x. ShareError -> Rep ShareError x)
-> (forall x. Rep ShareError x -> ShareError) -> Generic ShareError
forall x. Rep ShareError x -> ShareError
forall x. ShareError -> Rep ShareError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShareError x -> ShareError
$cfrom :: forall x. ShareError -> Rep ShareError x
Prelude.Generic)
newShareError ::
ShareError
newShareError :: ShareError
newShareError =
ShareError' :: Maybe [Text] -> Maybe Text -> Maybe Text -> ShareError
ShareError'
{ $sel:accounts:ShareError' :: Maybe [Text]
accounts = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:error:ShareError' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:message:ShareError' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
shareError_accounts :: Lens.Lens' ShareError (Prelude.Maybe [Prelude.Text])
shareError_accounts :: (Maybe [Text] -> f (Maybe [Text])) -> ShareError -> f ShareError
shareError_accounts = (ShareError -> Maybe [Text])
-> (ShareError -> Maybe [Text] -> ShareError)
-> Lens ShareError ShareError (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareError' {Maybe [Text]
accounts :: Maybe [Text]
$sel:accounts:ShareError' :: ShareError -> Maybe [Text]
accounts} -> Maybe [Text]
accounts) (\s :: ShareError
s@ShareError' {} Maybe [Text]
a -> ShareError
s {$sel:accounts:ShareError' :: Maybe [Text]
accounts = Maybe [Text]
a} :: ShareError) ((Maybe [Text] -> f (Maybe [Text])) -> ShareError -> f ShareError)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ShareError
-> f ShareError
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
shareError_error :: Lens.Lens' ShareError (Prelude.Maybe Prelude.Text)
shareError_error :: (Maybe Text -> f (Maybe Text)) -> ShareError -> f ShareError
shareError_error = (ShareError -> Maybe Text)
-> (ShareError -> Maybe Text -> ShareError)
-> Lens ShareError ShareError (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareError' {Maybe Text
error :: Maybe Text
$sel:error:ShareError' :: ShareError -> Maybe Text
error} -> Maybe Text
error) (\s :: ShareError
s@ShareError' {} Maybe Text
a -> ShareError
s {$sel:error:ShareError' :: Maybe Text
error = Maybe Text
a} :: ShareError)
shareError_message :: Lens.Lens' ShareError (Prelude.Maybe Prelude.Text)
shareError_message :: (Maybe Text -> f (Maybe Text)) -> ShareError -> f ShareError
shareError_message = (ShareError -> Maybe Text)
-> (ShareError -> Maybe Text -> ShareError)
-> Lens ShareError ShareError (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareError' {Maybe Text
message :: Maybe Text
$sel:message:ShareError' :: ShareError -> Maybe Text
message} -> Maybe Text
message) (\s :: ShareError
s@ShareError' {} Maybe Text
a -> ShareError
s {$sel:message:ShareError' :: Maybe Text
message = Maybe Text
a} :: ShareError)
instance Core.FromJSON ShareError where
parseJSON :: Value -> Parser ShareError
parseJSON =
String
-> (Object -> Parser ShareError) -> Value -> Parser ShareError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ShareError"
( \Object
x ->
Maybe [Text] -> Maybe Text -> Maybe Text -> ShareError
ShareError'
(Maybe [Text] -> Maybe Text -> Maybe Text -> ShareError)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Text -> ShareError)
forall (f :: * -> *) a b. Functor 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
"Accounts" 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)
Parser (Maybe Text -> Maybe Text -> ShareError)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ShareError)
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
"Error")
Parser (Maybe Text -> ShareError)
-> Parser (Maybe Text) -> Parser ShareError
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
"Message")
)
instance Prelude.Hashable ShareError
instance Prelude.NFData ShareError