{-# 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.Pinpoint.Types.ApplicationResponse where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApplicationResponse = ApplicationResponse'
{
ApplicationResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ApplicationResponse -> Text
id :: Prelude.Text,
ApplicationResponse -> Text
arn :: Prelude.Text,
ApplicationResponse -> Text
name :: Prelude.Text
}
deriving (ApplicationResponse -> ApplicationResponse -> Bool
(ApplicationResponse -> ApplicationResponse -> Bool)
-> (ApplicationResponse -> ApplicationResponse -> Bool)
-> Eq ApplicationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationResponse -> ApplicationResponse -> Bool
$c/= :: ApplicationResponse -> ApplicationResponse -> Bool
== :: ApplicationResponse -> ApplicationResponse -> Bool
$c== :: ApplicationResponse -> ApplicationResponse -> Bool
Prelude.Eq, ReadPrec [ApplicationResponse]
ReadPrec ApplicationResponse
Int -> ReadS ApplicationResponse
ReadS [ApplicationResponse]
(Int -> ReadS ApplicationResponse)
-> ReadS [ApplicationResponse]
-> ReadPrec ApplicationResponse
-> ReadPrec [ApplicationResponse]
-> Read ApplicationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationResponse]
$creadListPrec :: ReadPrec [ApplicationResponse]
readPrec :: ReadPrec ApplicationResponse
$creadPrec :: ReadPrec ApplicationResponse
readList :: ReadS [ApplicationResponse]
$creadList :: ReadS [ApplicationResponse]
readsPrec :: Int -> ReadS ApplicationResponse
$creadsPrec :: Int -> ReadS ApplicationResponse
Prelude.Read, Int -> ApplicationResponse -> ShowS
[ApplicationResponse] -> ShowS
ApplicationResponse -> String
(Int -> ApplicationResponse -> ShowS)
-> (ApplicationResponse -> String)
-> ([ApplicationResponse] -> ShowS)
-> Show ApplicationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationResponse] -> ShowS
$cshowList :: [ApplicationResponse] -> ShowS
show :: ApplicationResponse -> String
$cshow :: ApplicationResponse -> String
showsPrec :: Int -> ApplicationResponse -> ShowS
$cshowsPrec :: Int -> ApplicationResponse -> ShowS
Prelude.Show, (forall x. ApplicationResponse -> Rep ApplicationResponse x)
-> (forall x. Rep ApplicationResponse x -> ApplicationResponse)
-> Generic ApplicationResponse
forall x. Rep ApplicationResponse x -> ApplicationResponse
forall x. ApplicationResponse -> Rep ApplicationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApplicationResponse x -> ApplicationResponse
$cfrom :: forall x. ApplicationResponse -> Rep ApplicationResponse x
Prelude.Generic)
newApplicationResponse ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ApplicationResponse
newApplicationResponse :: Text -> Text -> Text -> ApplicationResponse
newApplicationResponse Text
pId_ Text
pArn_ Text
pName_ =
ApplicationResponse' :: Maybe (HashMap Text Text)
-> Text -> Text -> Text -> ApplicationResponse
ApplicationResponse'
{ $sel:tags:ApplicationResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:id:ApplicationResponse' :: Text
id = Text
pId_,
$sel:arn:ApplicationResponse' :: Text
arn = Text
pArn_,
$sel:name:ApplicationResponse' :: Text
name = Text
pName_
}
applicationResponse_tags :: Lens.Lens' ApplicationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
applicationResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ApplicationResponse -> f ApplicationResponse
applicationResponse_tags = (ApplicationResponse -> Maybe (HashMap Text Text))
-> (ApplicationResponse
-> Maybe (HashMap Text Text) -> ApplicationResponse)
-> Lens
ApplicationResponse
ApplicationResponse
(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 (\ApplicationResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ApplicationResponse' :: ApplicationResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ApplicationResponse
s@ApplicationResponse' {} Maybe (HashMap Text Text)
a -> ApplicationResponse
s {$sel:tags:ApplicationResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ApplicationResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ApplicationResponse -> f ApplicationResponse)
-> ((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)))
-> ApplicationResponse
-> f ApplicationResponse
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
applicationResponse_id :: Lens.Lens' ApplicationResponse Prelude.Text
applicationResponse_id :: (Text -> f Text) -> ApplicationResponse -> f ApplicationResponse
applicationResponse_id = (ApplicationResponse -> Text)
-> (ApplicationResponse -> Text -> ApplicationResponse)
-> Lens ApplicationResponse ApplicationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationResponse' {Text
id :: Text
$sel:id:ApplicationResponse' :: ApplicationResponse -> Text
id} -> Text
id) (\s :: ApplicationResponse
s@ApplicationResponse' {} Text
a -> ApplicationResponse
s {$sel:id:ApplicationResponse' :: Text
id = Text
a} :: ApplicationResponse)
applicationResponse_arn :: Lens.Lens' ApplicationResponse Prelude.Text
applicationResponse_arn :: (Text -> f Text) -> ApplicationResponse -> f ApplicationResponse
applicationResponse_arn = (ApplicationResponse -> Text)
-> (ApplicationResponse -> Text -> ApplicationResponse)
-> Lens ApplicationResponse ApplicationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationResponse' {Text
arn :: Text
$sel:arn:ApplicationResponse' :: ApplicationResponse -> Text
arn} -> Text
arn) (\s :: ApplicationResponse
s@ApplicationResponse' {} Text
a -> ApplicationResponse
s {$sel:arn:ApplicationResponse' :: Text
arn = Text
a} :: ApplicationResponse)
applicationResponse_name :: Lens.Lens' ApplicationResponse Prelude.Text
applicationResponse_name :: (Text -> f Text) -> ApplicationResponse -> f ApplicationResponse
applicationResponse_name = (ApplicationResponse -> Text)
-> (ApplicationResponse -> Text -> ApplicationResponse)
-> Lens ApplicationResponse ApplicationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationResponse' {Text
name :: Text
$sel:name:ApplicationResponse' :: ApplicationResponse -> Text
name} -> Text
name) (\s :: ApplicationResponse
s@ApplicationResponse' {} Text
a -> ApplicationResponse
s {$sel:name:ApplicationResponse' :: Text
name = Text
a} :: ApplicationResponse)
instance Core.FromJSON ApplicationResponse where
parseJSON :: Value -> Parser ApplicationResponse
parseJSON =
String
-> (Object -> Parser ApplicationResponse)
-> Value
-> Parser ApplicationResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ApplicationResponse"
( \Object
x ->
Maybe (HashMap Text Text)
-> Text -> Text -> Text -> ApplicationResponse
ApplicationResponse'
(Maybe (HashMap Text Text)
-> Text -> Text -> Text -> ApplicationResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> Text -> ApplicationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> Text -> Text -> ApplicationResponse)
-> Parser Text -> Parser (Text -> Text -> ApplicationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
Parser (Text -> Text -> ApplicationResponse)
-> Parser Text -> Parser (Text -> ApplicationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
Parser (Text -> ApplicationResponse)
-> Parser Text -> Parser ApplicationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
)
instance Prelude.Hashable ApplicationResponse
instance Prelude.NFData ApplicationResponse