{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:tags:CreateApplicationRequest' :: Maybe (HashMap Text Text)
tags = 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 :: Lens' CreateApplicationRequest (Maybe (HashMap Text Text))
createApplicationRequest_tags = 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) 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
createApplicationRequest_name :: Lens.Lens' CreateApplicationRequest Prelude.Text
createApplicationRequest_name :: Lens' CreateApplicationRequest Text
createApplicationRequest_name = 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 where
hashWithSalt :: Int -> CreateApplicationRequest -> Int
hashWithSalt Int
_salt 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)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData CreateApplicationRequest where
rnf :: CreateApplicationRequest -> ()
rnf 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)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)