{-# 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.CodePipeline.Types.ListWebhookItem where
import Amazonka.CodePipeline.Types.Tag
import Amazonka.CodePipeline.Types.WebhookDefinition
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 ListWebhookItem = ListWebhookItem'
{
ListWebhookItem -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ListWebhookItem -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
ListWebhookItem -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
ListWebhookItem -> Maybe POSIX
lastTriggered :: Prelude.Maybe Data.POSIX,
ListWebhookItem -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
ListWebhookItem -> WebhookDefinition
definition :: WebhookDefinition,
ListWebhookItem -> Text
url :: Prelude.Text
}
deriving (ListWebhookItem -> ListWebhookItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWebhookItem -> ListWebhookItem -> Bool
$c/= :: ListWebhookItem -> ListWebhookItem -> Bool
== :: ListWebhookItem -> ListWebhookItem -> Bool
$c== :: ListWebhookItem -> ListWebhookItem -> Bool
Prelude.Eq, ReadPrec [ListWebhookItem]
ReadPrec ListWebhookItem
Int -> ReadS ListWebhookItem
ReadS [ListWebhookItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWebhookItem]
$creadListPrec :: ReadPrec [ListWebhookItem]
readPrec :: ReadPrec ListWebhookItem
$creadPrec :: ReadPrec ListWebhookItem
readList :: ReadS [ListWebhookItem]
$creadList :: ReadS [ListWebhookItem]
readsPrec :: Int -> ReadS ListWebhookItem
$creadsPrec :: Int -> ReadS ListWebhookItem
Prelude.Read, Int -> ListWebhookItem -> ShowS
[ListWebhookItem] -> ShowS
ListWebhookItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWebhookItem] -> ShowS
$cshowList :: [ListWebhookItem] -> ShowS
show :: ListWebhookItem -> String
$cshow :: ListWebhookItem -> String
showsPrec :: Int -> ListWebhookItem -> ShowS
$cshowsPrec :: Int -> ListWebhookItem -> ShowS
Prelude.Show, forall x. Rep ListWebhookItem x -> ListWebhookItem
forall x. ListWebhookItem -> Rep ListWebhookItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWebhookItem x -> ListWebhookItem
$cfrom :: forall x. ListWebhookItem -> Rep ListWebhookItem x
Prelude.Generic)
newListWebhookItem ::
WebhookDefinition ->
Prelude.Text ->
ListWebhookItem
newListWebhookItem :: WebhookDefinition -> Text -> ListWebhookItem
newListWebhookItem WebhookDefinition
pDefinition_ Text
pUrl_ =
ListWebhookItem'
{ $sel:arn:ListWebhookItem' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:errorCode:ListWebhookItem' :: Maybe Text
errorCode = forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:ListWebhookItem' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
$sel:lastTriggered:ListWebhookItem' :: Maybe POSIX
lastTriggered = forall a. Maybe a
Prelude.Nothing,
$sel:tags:ListWebhookItem' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:definition:ListWebhookItem' :: WebhookDefinition
definition = WebhookDefinition
pDefinition_,
$sel:url:ListWebhookItem' :: Text
url = Text
pUrl_
}
listWebhookItem_arn :: Lens.Lens' ListWebhookItem (Prelude.Maybe Prelude.Text)
listWebhookItem_arn :: Lens' ListWebhookItem (Maybe Text)
listWebhookItem_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWebhookItem' {Maybe Text
arn :: Maybe Text
$sel:arn:ListWebhookItem' :: ListWebhookItem -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ListWebhookItem
s@ListWebhookItem' {} Maybe Text
a -> ListWebhookItem
s {$sel:arn:ListWebhookItem' :: Maybe Text
arn = Maybe Text
a} :: ListWebhookItem)
listWebhookItem_errorCode :: Lens.Lens' ListWebhookItem (Prelude.Maybe Prelude.Text)
listWebhookItem_errorCode :: Lens' ListWebhookItem (Maybe Text)
listWebhookItem_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWebhookItem' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:ListWebhookItem' :: ListWebhookItem -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: ListWebhookItem
s@ListWebhookItem' {} Maybe Text
a -> ListWebhookItem
s {$sel:errorCode:ListWebhookItem' :: Maybe Text
errorCode = Maybe Text
a} :: ListWebhookItem)
listWebhookItem_errorMessage :: Lens.Lens' ListWebhookItem (Prelude.Maybe Prelude.Text)
listWebhookItem_errorMessage :: Lens' ListWebhookItem (Maybe Text)
listWebhookItem_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWebhookItem' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:ListWebhookItem' :: ListWebhookItem -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: ListWebhookItem
s@ListWebhookItem' {} Maybe Text
a -> ListWebhookItem
s {$sel:errorMessage:ListWebhookItem' :: Maybe Text
errorMessage = Maybe Text
a} :: ListWebhookItem)
listWebhookItem_lastTriggered :: Lens.Lens' ListWebhookItem (Prelude.Maybe Prelude.UTCTime)
listWebhookItem_lastTriggered :: Lens' ListWebhookItem (Maybe UTCTime)
listWebhookItem_lastTriggered = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWebhookItem' {Maybe POSIX
lastTriggered :: Maybe POSIX
$sel:lastTriggered:ListWebhookItem' :: ListWebhookItem -> Maybe POSIX
lastTriggered} -> Maybe POSIX
lastTriggered) (\s :: ListWebhookItem
s@ListWebhookItem' {} Maybe POSIX
a -> ListWebhookItem
s {$sel:lastTriggered:ListWebhookItem' :: Maybe POSIX
lastTriggered = Maybe POSIX
a} :: ListWebhookItem) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
listWebhookItem_tags :: Lens.Lens' ListWebhookItem (Prelude.Maybe [Tag])
listWebhookItem_tags :: Lens' ListWebhookItem (Maybe [Tag])
listWebhookItem_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWebhookItem' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ListWebhookItem' :: ListWebhookItem -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ListWebhookItem
s@ListWebhookItem' {} Maybe [Tag]
a -> ListWebhookItem
s {$sel:tags:ListWebhookItem' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ListWebhookItem) 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
listWebhookItem_definition :: Lens.Lens' ListWebhookItem WebhookDefinition
listWebhookItem_definition :: Lens' ListWebhookItem WebhookDefinition
listWebhookItem_definition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWebhookItem' {WebhookDefinition
definition :: WebhookDefinition
$sel:definition:ListWebhookItem' :: ListWebhookItem -> WebhookDefinition
definition} -> WebhookDefinition
definition) (\s :: ListWebhookItem
s@ListWebhookItem' {} WebhookDefinition
a -> ListWebhookItem
s {$sel:definition:ListWebhookItem' :: WebhookDefinition
definition = WebhookDefinition
a} :: ListWebhookItem)
listWebhookItem_url :: Lens.Lens' ListWebhookItem Prelude.Text
listWebhookItem_url :: Lens' ListWebhookItem Text
listWebhookItem_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWebhookItem' {Text
url :: Text
$sel:url:ListWebhookItem' :: ListWebhookItem -> Text
url} -> Text
url) (\s :: ListWebhookItem
s@ListWebhookItem' {} Text
a -> ListWebhookItem
s {$sel:url:ListWebhookItem' :: Text
url = Text
a} :: ListWebhookItem)
instance Data.FromJSON ListWebhookItem where
parseJSON :: Value -> Parser ListWebhookItem
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ListWebhookItem"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [Tag]
-> WebhookDefinition
-> Text
-> ListWebhookItem
ListWebhookItem'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"errorCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"errorMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastTriggered")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"definition")
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 ListWebhookItem where
hashWithSalt :: Int -> ListWebhookItem -> Int
hashWithSalt Int
_salt ListWebhookItem' {Maybe [Tag]
Maybe Text
Maybe POSIX
Text
WebhookDefinition
url :: Text
definition :: WebhookDefinition
tags :: Maybe [Tag]
lastTriggered :: Maybe POSIX
errorMessage :: Maybe Text
errorCode :: Maybe Text
arn :: Maybe Text
$sel:url:ListWebhookItem' :: ListWebhookItem -> Text
$sel:definition:ListWebhookItem' :: ListWebhookItem -> WebhookDefinition
$sel:tags:ListWebhookItem' :: ListWebhookItem -> Maybe [Tag]
$sel:lastTriggered:ListWebhookItem' :: ListWebhookItem -> Maybe POSIX
$sel:errorMessage:ListWebhookItem' :: ListWebhookItem -> Maybe Text
$sel:errorCode:ListWebhookItem' :: ListWebhookItem -> Maybe Text
$sel:arn:ListWebhookItem' :: ListWebhookItem -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastTriggered
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WebhookDefinition
definition
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
url
instance Prelude.NFData ListWebhookItem where
rnf :: ListWebhookItem -> ()
rnf ListWebhookItem' {Maybe [Tag]
Maybe Text
Maybe POSIX
Text
WebhookDefinition
url :: Text
definition :: WebhookDefinition
tags :: Maybe [Tag]
lastTriggered :: Maybe POSIX
errorMessage :: Maybe Text
errorCode :: Maybe Text
arn :: Maybe Text
$sel:url:ListWebhookItem' :: ListWebhookItem -> Text
$sel:definition:ListWebhookItem' :: ListWebhookItem -> WebhookDefinition
$sel:tags:ListWebhookItem' :: ListWebhookItem -> Maybe [Tag]
$sel:lastTriggered:ListWebhookItem' :: ListWebhookItem -> Maybe POSIX
$sel:errorMessage:ListWebhookItem' :: ListWebhookItem -> Maybe Text
$sel:errorCode:ListWebhookItem' :: ListWebhookItem -> Maybe Text
$sel:arn:ListWebhookItem' :: ListWebhookItem -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastTriggered
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WebhookDefinition
definition
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
url