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