{-# 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.SNS.Types.PlatformApplication where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PlatformApplication = PlatformApplication'
{
PlatformApplication -> Maybe Text
platformApplicationArn :: Prelude.Maybe Prelude.Text,
PlatformApplication -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (PlatformApplication -> PlatformApplication -> Bool
(PlatformApplication -> PlatformApplication -> Bool)
-> (PlatformApplication -> PlatformApplication -> Bool)
-> Eq PlatformApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlatformApplication -> PlatformApplication -> Bool
$c/= :: PlatformApplication -> PlatformApplication -> Bool
== :: PlatformApplication -> PlatformApplication -> Bool
$c== :: PlatformApplication -> PlatformApplication -> Bool
Prelude.Eq, ReadPrec [PlatformApplication]
ReadPrec PlatformApplication
Int -> ReadS PlatformApplication
ReadS [PlatformApplication]
(Int -> ReadS PlatformApplication)
-> ReadS [PlatformApplication]
-> ReadPrec PlatformApplication
-> ReadPrec [PlatformApplication]
-> Read PlatformApplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlatformApplication]
$creadListPrec :: ReadPrec [PlatformApplication]
readPrec :: ReadPrec PlatformApplication
$creadPrec :: ReadPrec PlatformApplication
readList :: ReadS [PlatformApplication]
$creadList :: ReadS [PlatformApplication]
readsPrec :: Int -> ReadS PlatformApplication
$creadsPrec :: Int -> ReadS PlatformApplication
Prelude.Read, Int -> PlatformApplication -> ShowS
[PlatformApplication] -> ShowS
PlatformApplication -> String
(Int -> PlatformApplication -> ShowS)
-> (PlatformApplication -> String)
-> ([PlatformApplication] -> ShowS)
-> Show PlatformApplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlatformApplication] -> ShowS
$cshowList :: [PlatformApplication] -> ShowS
show :: PlatformApplication -> String
$cshow :: PlatformApplication -> String
showsPrec :: Int -> PlatformApplication -> ShowS
$cshowsPrec :: Int -> PlatformApplication -> ShowS
Prelude.Show, (forall x. PlatformApplication -> Rep PlatformApplication x)
-> (forall x. Rep PlatformApplication x -> PlatformApplication)
-> Generic PlatformApplication
forall x. Rep PlatformApplication x -> PlatformApplication
forall x. PlatformApplication -> Rep PlatformApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlatformApplication x -> PlatformApplication
$cfrom :: forall x. PlatformApplication -> Rep PlatformApplication x
Prelude.Generic)
newPlatformApplication ::
PlatformApplication
newPlatformApplication :: PlatformApplication
newPlatformApplication =
PlatformApplication' :: Maybe Text -> Maybe (HashMap Text Text) -> PlatformApplication
PlatformApplication'
{ $sel:platformApplicationArn:PlatformApplication' :: Maybe Text
platformApplicationArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:PlatformApplication' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
platformApplication_platformApplicationArn :: Lens.Lens' PlatformApplication (Prelude.Maybe Prelude.Text)
platformApplication_platformApplicationArn :: (Maybe Text -> f (Maybe Text))
-> PlatformApplication -> f PlatformApplication
platformApplication_platformApplicationArn = (PlatformApplication -> Maybe Text)
-> (PlatformApplication -> Maybe Text -> PlatformApplication)
-> Lens
PlatformApplication PlatformApplication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformApplication' {Maybe Text
platformApplicationArn :: Maybe Text
$sel:platformApplicationArn:PlatformApplication' :: PlatformApplication -> Maybe Text
platformApplicationArn} -> Maybe Text
platformApplicationArn) (\s :: PlatformApplication
s@PlatformApplication' {} Maybe Text
a -> PlatformApplication
s {$sel:platformApplicationArn:PlatformApplication' :: Maybe Text
platformApplicationArn = Maybe Text
a} :: PlatformApplication)
platformApplication_attributes :: Lens.Lens' PlatformApplication (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
platformApplication_attributes :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PlatformApplication -> f PlatformApplication
platformApplication_attributes = (PlatformApplication -> Maybe (HashMap Text Text))
-> (PlatformApplication
-> Maybe (HashMap Text Text) -> PlatformApplication)
-> Lens
PlatformApplication
PlatformApplication
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformApplication' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:PlatformApplication' :: PlatformApplication -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: PlatformApplication
s@PlatformApplication' {} Maybe (HashMap Text Text)
a -> PlatformApplication
s {$sel:attributes:PlatformApplication' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: PlatformApplication) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PlatformApplication -> f PlatformApplication)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PlatformApplication
-> f PlatformApplication
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromXML PlatformApplication where
parseXML :: [Node] -> Either String PlatformApplication
parseXML [Node]
x =
Maybe Text -> Maybe (HashMap Text Text) -> PlatformApplication
PlatformApplication'
(Maybe Text -> Maybe (HashMap Text Text) -> PlatformApplication)
-> Either String (Maybe Text)
-> Either String (Maybe (HashMap Text Text) -> PlatformApplication)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PlatformApplicationArn")
Either String (Maybe (HashMap Text Text) -> PlatformApplication)
-> Either String (Maybe (HashMap Text Text))
-> Either String PlatformApplication
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Attributes" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe (HashMap Text Text)))
-> Either String (Maybe (HashMap Text Text))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String (HashMap Text Text))
-> [Node] -> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> Text -> Text -> [Node] -> Either String (HashMap Text Text)
forall k v.
(Eq k, Hashable k, FromText k, FromXML v) =>
Text -> Text -> Text -> [Node] -> Either String (HashMap k v)
Core.parseXMLMap Text
"entry" Text
"key" Text
"value")
)
instance Prelude.Hashable PlatformApplication
instance Prelude.NFData PlatformApplication