{-# 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.IoT.Types.SalesforceAction 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 SalesforceAction = SalesforceAction'
{
SalesforceAction -> Text
token :: Prelude.Text,
SalesforceAction -> Text
url :: Prelude.Text
}
deriving (SalesforceAction -> SalesforceAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SalesforceAction -> SalesforceAction -> Bool
$c/= :: SalesforceAction -> SalesforceAction -> Bool
== :: SalesforceAction -> SalesforceAction -> Bool
$c== :: SalesforceAction -> SalesforceAction -> Bool
Prelude.Eq, ReadPrec [SalesforceAction]
ReadPrec SalesforceAction
Int -> ReadS SalesforceAction
ReadS [SalesforceAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SalesforceAction]
$creadListPrec :: ReadPrec [SalesforceAction]
readPrec :: ReadPrec SalesforceAction
$creadPrec :: ReadPrec SalesforceAction
readList :: ReadS [SalesforceAction]
$creadList :: ReadS [SalesforceAction]
readsPrec :: Int -> ReadS SalesforceAction
$creadsPrec :: Int -> ReadS SalesforceAction
Prelude.Read, Int -> SalesforceAction -> ShowS
[SalesforceAction] -> ShowS
SalesforceAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SalesforceAction] -> ShowS
$cshowList :: [SalesforceAction] -> ShowS
show :: SalesforceAction -> String
$cshow :: SalesforceAction -> String
showsPrec :: Int -> SalesforceAction -> ShowS
$cshowsPrec :: Int -> SalesforceAction -> ShowS
Prelude.Show, forall x. Rep SalesforceAction x -> SalesforceAction
forall x. SalesforceAction -> Rep SalesforceAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SalesforceAction x -> SalesforceAction
$cfrom :: forall x. SalesforceAction -> Rep SalesforceAction x
Prelude.Generic)
newSalesforceAction ::
Prelude.Text ->
Prelude.Text ->
SalesforceAction
newSalesforceAction :: Text -> Text -> SalesforceAction
newSalesforceAction Text
pToken_ Text
pUrl_ =
SalesforceAction' {$sel:token:SalesforceAction' :: Text
token = Text
pToken_, $sel:url:SalesforceAction' :: Text
url = Text
pUrl_}
salesforceAction_token :: Lens.Lens' SalesforceAction Prelude.Text
salesforceAction_token :: Lens' SalesforceAction Text
salesforceAction_token = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceAction' {Text
token :: Text
$sel:token:SalesforceAction' :: SalesforceAction -> Text
token} -> Text
token) (\s :: SalesforceAction
s@SalesforceAction' {} Text
a -> SalesforceAction
s {$sel:token:SalesforceAction' :: Text
token = Text
a} :: SalesforceAction)
salesforceAction_url :: Lens.Lens' SalesforceAction Prelude.Text
salesforceAction_url :: Lens' SalesforceAction Text
salesforceAction_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceAction' {Text
url :: Text
$sel:url:SalesforceAction' :: SalesforceAction -> Text
url} -> Text
url) (\s :: SalesforceAction
s@SalesforceAction' {} Text
a -> SalesforceAction
s {$sel:url:SalesforceAction' :: Text
url = Text
a} :: SalesforceAction)
instance Data.FromJSON SalesforceAction where
parseJSON :: Value -> Parser SalesforceAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SalesforceAction"
( \Object
x ->
Text -> Text -> SalesforceAction
SalesforceAction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"token")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"url")
)
instance Prelude.Hashable SalesforceAction where
hashWithSalt :: Int -> SalesforceAction -> Int
hashWithSalt Int
_salt SalesforceAction' {Text
url :: Text
token :: Text
$sel:url:SalesforceAction' :: SalesforceAction -> Text
$sel:token:SalesforceAction' :: SalesforceAction -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
token
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
url
instance Prelude.NFData SalesforceAction where
rnf :: SalesforceAction -> ()
rnf SalesforceAction' {Text
url :: Text
token :: Text
$sel:url:SalesforceAction' :: SalesforceAction -> Text
$sel:token:SalesforceAction' :: SalesforceAction -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
token seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
url
instance Data.ToJSON SalesforceAction where
toJSON :: SalesforceAction -> Value
toJSON SalesforceAction' {Text
url :: Text
token :: Text
$sel:url:SalesforceAction' :: SalesforceAction -> Text
$sel:token:SalesforceAction' :: SalesforceAction -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"token" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
token),
forall a. a -> Maybe a
Prelude.Just (Key
"url" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
url)
]
)