{-# 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.CreateApplicationRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CreateApplicationRequest = CreateApplicationRequest'
{
CreateApplicationRequest -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateApplicationRequest -> Text
name :: Prelude.Text
}
deriving (CreateApplicationRequest -> CreateApplicationRequest -> Bool
(CreateApplicationRequest -> CreateApplicationRequest -> Bool)
-> (CreateApplicationRequest -> CreateApplicationRequest -> Bool)
-> Eq CreateApplicationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApplicationRequest -> CreateApplicationRequest -> Bool
$c/= :: CreateApplicationRequest -> CreateApplicationRequest -> Bool
== :: CreateApplicationRequest -> CreateApplicationRequest -> Bool
$c== :: CreateApplicationRequest -> CreateApplicationRequest -> Bool
Prelude.Eq, ReadPrec [CreateApplicationRequest]
ReadPrec CreateApplicationRequest
Int -> ReadS CreateApplicationRequest
ReadS [CreateApplicationRequest]
(Int -> ReadS CreateApplicationRequest)
-> ReadS [CreateApplicationRequest]
-> ReadPrec CreateApplicationRequest
-> ReadPrec [CreateApplicationRequest]
-> Read CreateApplicationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApplicationRequest]
$creadListPrec :: ReadPrec [CreateApplicationRequest]
readPrec :: ReadPrec CreateApplicationRequest
$creadPrec :: ReadPrec CreateApplicationRequest
readList :: ReadS [CreateApplicationRequest]
$creadList :: ReadS [CreateApplicationRequest]
readsPrec :: Int -> ReadS CreateApplicationRequest
$creadsPrec :: Int -> ReadS CreateApplicationRequest
Prelude.Read, Int -> CreateApplicationRequest -> ShowS
[CreateApplicationRequest] -> ShowS
CreateApplicationRequest -> String
(Int -> CreateApplicationRequest -> ShowS)
-> (CreateApplicationRequest -> String)
-> ([CreateApplicationRequest] -> ShowS)
-> Show CreateApplicationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApplicationRequest] -> ShowS
$cshowList :: [CreateApplicationRequest] -> ShowS
show :: CreateApplicationRequest -> String
$cshow :: CreateApplicationRequest -> String
showsPrec :: Int -> CreateApplicationRequest -> ShowS
$cshowsPrec :: Int -> CreateApplicationRequest -> ShowS
Prelude.Show, (forall x.
CreateApplicationRequest -> Rep CreateApplicationRequest x)
-> (forall x.
Rep CreateApplicationRequest x -> CreateApplicationRequest)
-> Generic CreateApplicationRequest
forall x.
Rep CreateApplicationRequest x -> CreateApplicationRequest
forall x.
CreateApplicationRequest -> Rep CreateApplicationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateApplicationRequest x -> CreateApplicationRequest
$cfrom :: forall x.
CreateApplicationRequest -> Rep CreateApplicationRequest x
Prelude.Generic)
newCreateApplicationRequest ::
Prelude.Text ->
CreateApplicationRequest
newCreateApplicationRequest :: Text -> CreateApplicationRequest
newCreateApplicationRequest Text
pName_ =
CreateApplicationRequest' :: Maybe (HashMap Text Text) -> Text -> CreateApplicationRequest
CreateApplicationRequest'
{ $sel:tags:CreateApplicationRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateApplicationRequest' :: Text
name = Text
pName_
}
createApplicationRequest_tags :: Lens.Lens' CreateApplicationRequest (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createApplicationRequest_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateApplicationRequest -> f CreateApplicationRequest
createApplicationRequest_tags = (CreateApplicationRequest -> Maybe (HashMap Text Text))
-> (CreateApplicationRequest
-> Maybe (HashMap Text Text) -> CreateApplicationRequest)
-> Lens
CreateApplicationRequest
CreateApplicationRequest
(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 (\CreateApplicationRequest' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateApplicationRequest' :: CreateApplicationRequest -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateApplicationRequest
s@CreateApplicationRequest' {} Maybe (HashMap Text Text)
a -> CreateApplicationRequest
s {$sel:tags:CreateApplicationRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateApplicationRequest) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateApplicationRequest -> f CreateApplicationRequest)
-> ((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)))
-> CreateApplicationRequest
-> f CreateApplicationRequest
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
createApplicationRequest_name :: Lens.Lens' CreateApplicationRequest Prelude.Text
createApplicationRequest_name :: (Text -> f Text)
-> CreateApplicationRequest -> f CreateApplicationRequest
createApplicationRequest_name = (CreateApplicationRequest -> Text)
-> (CreateApplicationRequest -> Text -> CreateApplicationRequest)
-> Lens CreateApplicationRequest CreateApplicationRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApplicationRequest' {Text
name :: Text
$sel:name:CreateApplicationRequest' :: CreateApplicationRequest -> Text
name} -> Text
name) (\s :: CreateApplicationRequest
s@CreateApplicationRequest' {} Text
a -> CreateApplicationRequest
s {$sel:name:CreateApplicationRequest' :: Text
name = Text
a} :: CreateApplicationRequest)
instance Prelude.Hashable CreateApplicationRequest
instance Prelude.NFData CreateApplicationRequest
instance Core.ToJSON CreateApplicationRequest where
toJSON :: CreateApplicationRequest -> Value
toJSON CreateApplicationRequest' {Maybe (HashMap Text Text)
Text
name :: Text
tags :: Maybe (HashMap Text Text)
$sel:name:CreateApplicationRequest' :: CreateApplicationRequest -> Text
$sel:tags:CreateApplicationRequest' :: CreateApplicationRequest -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)