{-# 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.Lens as Lens
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 :: Core.POSIX,
Webhook -> POSIX
updateTime :: Core.POSIX
}
deriving (Webhook -> Webhook -> Bool
(Webhook -> Webhook -> Bool)
-> (Webhook -> Webhook -> Bool) -> Eq Webhook
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]
(Int -> ReadS Webhook)
-> ReadS [Webhook]
-> ReadPrec Webhook
-> ReadPrec [Webhook]
-> Read 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
(Int -> Webhook -> ShowS)
-> (Webhook -> String) -> ([Webhook] -> ShowS) -> Show Webhook
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. Webhook -> Rep Webhook x)
-> (forall x. Rep Webhook x -> Webhook) -> Generic Webhook
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' :: Text -> Text -> Text -> Text -> Text -> POSIX -> POSIX -> Webhook
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 = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreateTime_,
$sel:updateTime:Webhook' :: POSIX
updateTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateTime_
}
webhook_webhookArn :: Lens.Lens' Webhook Prelude.Text
webhook_webhookArn :: (Text -> f Text) -> Webhook -> f Webhook
webhook_webhookArn = (Webhook -> Text)
-> (Webhook -> Text -> Webhook) -> Lens Webhook Webhook Text Text
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 :: (Text -> f Text) -> Webhook -> f Webhook
webhook_webhookId = (Webhook -> Text)
-> (Webhook -> Text -> Webhook) -> Lens Webhook Webhook Text Text
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 :: (Text -> f Text) -> Webhook -> f Webhook
webhook_webhookUrl = (Webhook -> Text)
-> (Webhook -> Text -> Webhook) -> Lens Webhook Webhook Text Text
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 :: (Text -> f Text) -> Webhook -> f Webhook
webhook_branchName = (Webhook -> Text)
-> (Webhook -> Text -> Webhook) -> Lens Webhook Webhook Text Text
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 :: (Text -> f Text) -> Webhook -> f Webhook
webhook_description = (Webhook -> Text)
-> (Webhook -> Text -> Webhook) -> Lens Webhook Webhook Text Text
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 :: (UTCTime -> f UTCTime) -> Webhook -> f Webhook
webhook_createTime = (Webhook -> POSIX)
-> (Webhook -> POSIX -> Webhook)
-> Lens Webhook Webhook POSIX POSIX
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) ((POSIX -> f POSIX) -> Webhook -> f Webhook)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Webhook
-> f Webhook
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
webhook_updateTime :: Lens.Lens' Webhook Prelude.UTCTime
webhook_updateTime :: (UTCTime -> f UTCTime) -> Webhook -> f Webhook
webhook_updateTime = (Webhook -> POSIX)
-> (Webhook -> POSIX -> Webhook)
-> Lens Webhook Webhook POSIX POSIX
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) ((POSIX -> f POSIX) -> Webhook -> f Webhook)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Webhook
-> f Webhook
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON Webhook where
parseJSON :: Value -> Parser Webhook
parseJSON =
String -> (Object -> Parser Webhook) -> Value -> Parser Webhook
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Webhook"
( \Object
x ->
Text -> Text -> Text -> Text -> Text -> POSIX -> POSIX -> Webhook
Webhook'
(Text -> Text -> Text -> Text -> Text -> POSIX -> POSIX -> Webhook)
-> Parser Text
-> Parser
(Text -> Text -> Text -> Text -> POSIX -> POSIX -> Webhook)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"webhookArn")
Parser (Text -> Text -> Text -> Text -> POSIX -> POSIX -> Webhook)
-> Parser Text
-> Parser (Text -> Text -> Text -> POSIX -> POSIX -> Webhook)
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
"webhookId")
Parser (Text -> Text -> Text -> POSIX -> POSIX -> Webhook)
-> Parser Text
-> Parser (Text -> Text -> POSIX -> POSIX -> Webhook)
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
"webhookUrl")
Parser (Text -> Text -> POSIX -> POSIX -> Webhook)
-> Parser Text -> Parser (Text -> POSIX -> POSIX -> Webhook)
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
"branchName")
Parser (Text -> POSIX -> POSIX -> Webhook)
-> Parser Text -> Parser (POSIX -> POSIX -> Webhook)
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
"description")
Parser (POSIX -> POSIX -> Webhook)
-> Parser POSIX -> Parser (POSIX -> Webhook)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"createTime")
Parser (POSIX -> Webhook) -> Parser POSIX -> Parser Webhook
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"updateTime")
)
instance Prelude.Hashable Webhook
instance Prelude.NFData Webhook