{-# 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.Amplify.Types.Webhook 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 Webhook = Webhook'
{
Webhook -> Text
webhookArn :: Prelude.Text,
Webhook -> Text
webhookId :: Prelude.Text,
Webhook -> Text
webhookUrl :: Prelude.Text,
Webhook -> Text
branchName :: Prelude.Text,
Webhook -> Text
description :: Prelude.Text,
Webhook -> POSIX
createTime :: Data.POSIX,
Webhook -> POSIX
updateTime :: Data.POSIX
}
deriving (Webhook -> Webhook -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Webhook -> Webhook -> Bool
$c/= :: Webhook -> Webhook -> Bool
== :: Webhook -> Webhook -> Bool
$c== :: Webhook -> Webhook -> Bool
Prelude.Eq, ReadPrec [Webhook]
ReadPrec Webhook
Int -> ReadS Webhook
ReadS [Webhook]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Webhook]
$creadListPrec :: ReadPrec [Webhook]
readPrec :: ReadPrec Webhook
$creadPrec :: ReadPrec Webhook
readList :: ReadS [Webhook]
$creadList :: ReadS [Webhook]
readsPrec :: Int -> ReadS Webhook
$creadsPrec :: Int -> ReadS Webhook
Prelude.Read, Int -> Webhook -> ShowS
[Webhook] -> ShowS
Webhook -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Webhook] -> ShowS
$cshowList :: [Webhook] -> ShowS
show :: Webhook -> String
$cshow :: Webhook -> String
showsPrec :: Int -> Webhook -> ShowS
$cshowsPrec :: Int -> Webhook -> ShowS
Prelude.Show, forall x. Rep Webhook x -> Webhook
forall x. Webhook -> Rep Webhook x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Webhook x -> Webhook
$cfrom :: forall x. Webhook -> Rep Webhook x
Prelude.Generic)
newWebhook ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
Webhook
newWebhook :: Text
-> Text -> Text -> Text -> Text -> UTCTime -> UTCTime -> Webhook
newWebhook
Text
pWebhookArn_
Text
pWebhookId_
Text
pWebhookUrl_
Text
pBranchName_
Text
pDescription_
UTCTime
pCreateTime_
UTCTime
pUpdateTime_ =
Webhook'
{ $sel:webhookArn:Webhook' :: Text
webhookArn = Text
pWebhookArn_,
$sel:webhookId:Webhook' :: Text
webhookId = Text
pWebhookId_,
$sel:webhookUrl:Webhook' :: Text
webhookUrl = Text
pWebhookUrl_,
$sel:branchName:Webhook' :: Text
branchName = Text
pBranchName_,
$sel:description:Webhook' :: Text
description = Text
pDescription_,
$sel:createTime:Webhook' :: POSIX
createTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreateTime_,
$sel:updateTime:Webhook' :: POSIX
updateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateTime_
}
webhook_webhookArn :: Lens.Lens' Webhook Prelude.Text
webhook_webhookArn :: Lens' Webhook Text
webhook_webhookArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Webhook' {Text
webhookArn :: Text
$sel:webhookArn:Webhook' :: Webhook -> Text
webhookArn} -> Text
webhookArn) (\s :: Webhook
s@Webhook' {} Text
a -> Webhook
s {$sel:webhookArn:Webhook' :: Text
webhookArn = Text
a} :: Webhook)
webhook_webhookId :: Lens.Lens' Webhook Prelude.Text
webhook_webhookId :: Lens' Webhook Text
webhook_webhookId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Webhook' {Text
webhookId :: Text
$sel:webhookId:Webhook' :: Webhook -> Text
webhookId} -> Text
webhookId) (\s :: Webhook
s@Webhook' {} Text
a -> Webhook
s {$sel:webhookId:Webhook' :: Text
webhookId = Text
a} :: Webhook)
webhook_webhookUrl :: Lens.Lens' Webhook Prelude.Text
webhook_webhookUrl :: Lens' Webhook Text
webhook_webhookUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Webhook' {Text
webhookUrl :: Text
$sel:webhookUrl:Webhook' :: Webhook -> Text
webhookUrl} -> Text
webhookUrl) (\s :: Webhook
s@Webhook' {} Text
a -> Webhook
s {$sel:webhookUrl:Webhook' :: Text
webhookUrl = Text
a} :: Webhook)
webhook_branchName :: Lens.Lens' Webhook Prelude.Text
webhook_branchName :: Lens' Webhook Text
webhook_branchName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Webhook' {Text
branchName :: Text
$sel:branchName:Webhook' :: Webhook -> Text
branchName} -> Text
branchName) (\s :: Webhook
s@Webhook' {} Text
a -> Webhook
s {$sel:branchName:Webhook' :: Text
branchName = Text
a} :: Webhook)
webhook_description :: Lens.Lens' Webhook Prelude.Text
webhook_description :: Lens' Webhook Text
webhook_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Webhook' {Text
description :: Text
$sel:description:Webhook' :: Webhook -> Text
description} -> Text
description) (\s :: Webhook
s@Webhook' {} Text
a -> Webhook
s {$sel:description:Webhook' :: Text
description = Text
a} :: Webhook)
webhook_createTime :: Lens.Lens' Webhook Prelude.UTCTime
webhook_createTime :: Lens' Webhook UTCTime
webhook_createTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Webhook' {POSIX
createTime :: POSIX
$sel:createTime:Webhook' :: Webhook -> POSIX
createTime} -> POSIX
createTime) (\s :: Webhook
s@Webhook' {} POSIX
a -> Webhook
s {$sel:createTime:Webhook' :: POSIX
createTime = POSIX
a} :: Webhook) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
webhook_updateTime :: Lens.Lens' Webhook Prelude.UTCTime
webhook_updateTime :: Lens' Webhook UTCTime
webhook_updateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Webhook' {POSIX
updateTime :: POSIX
$sel:updateTime:Webhook' :: Webhook -> POSIX
updateTime} -> POSIX
updateTime) (\s :: Webhook
s@Webhook' {} POSIX
a -> Webhook
s {$sel:updateTime:Webhook' :: POSIX
updateTime = POSIX
a} :: Webhook) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON Webhook where
parseJSON :: Value -> Parser Webhook
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Webhook"
( \Object
x ->
Text -> Text -> Text -> Text -> Text -> POSIX -> POSIX -> Webhook
Webhook'
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
"webhookArn")
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
"webhookId")
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
"webhookUrl")
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
"branchName")
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
"description")
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
"createTime")
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
"updateTime")
)
instance Prelude.Hashable Webhook where
hashWithSalt :: Int -> Webhook -> Int
hashWithSalt Int
_salt Webhook' {Text
POSIX
updateTime :: POSIX
createTime :: POSIX
description :: Text
branchName :: Text
webhookUrl :: Text
webhookId :: Text
webhookArn :: Text
$sel:updateTime:Webhook' :: Webhook -> POSIX
$sel:createTime:Webhook' :: Webhook -> POSIX
$sel:description:Webhook' :: Webhook -> Text
$sel:branchName:Webhook' :: Webhook -> Text
$sel:webhookUrl:Webhook' :: Webhook -> Text
$sel:webhookId:Webhook' :: Webhook -> Text
$sel:webhookArn:Webhook' :: Webhook -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
webhookArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
webhookId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
webhookUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
branchName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
updateTime
instance Prelude.NFData Webhook where
rnf :: Webhook -> ()
rnf Webhook' {Text
POSIX
updateTime :: POSIX
createTime :: POSIX
description :: Text
branchName :: Text
webhookUrl :: Text
webhookId :: Text
webhookArn :: Text
$sel:updateTime:Webhook' :: Webhook -> POSIX
$sel:createTime:Webhook' :: Webhook -> POSIX
$sel:description:Webhook' :: Webhook -> Text
$sel:branchName:Webhook' :: Webhook -> Text
$sel:webhookUrl:Webhook' :: Webhook -> Text
$sel:webhookId:Webhook' :: Webhook -> Text
$sel:webhookArn:Webhook' :: Webhook -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
webhookArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
webhookId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
webhookUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
branchName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
updateTime