{-# 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.CodeStarNotifications.Types.Target 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 Target = Target'
{
Target -> Maybe (Sensitive Text)
targetAddress :: Prelude.Maybe (Data.Sensitive Prelude.Text),
Target -> Maybe Text
targetType :: Prelude.Maybe Prelude.Text
}
deriving (Target -> Target -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Target -> Target -> Bool
$c/= :: Target -> Target -> Bool
== :: Target -> Target -> Bool
$c== :: Target -> Target -> Bool
Prelude.Eq, Int -> Target -> ShowS
[Target] -> ShowS
Target -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Target] -> ShowS
$cshowList :: [Target] -> ShowS
show :: Target -> String
$cshow :: Target -> String
showsPrec :: Int -> Target -> ShowS
$cshowsPrec :: Int -> Target -> ShowS
Prelude.Show, forall x. Rep Target x -> Target
forall x. Target -> Rep Target x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Target x -> Target
$cfrom :: forall x. Target -> Rep Target x
Prelude.Generic)
newTarget ::
Target
newTarget :: Target
newTarget =
Target'
{ $sel:targetAddress:Target' :: Maybe (Sensitive Text)
targetAddress = forall a. Maybe a
Prelude.Nothing,
$sel:targetType:Target' :: Maybe Text
targetType = forall a. Maybe a
Prelude.Nothing
}
target_targetAddress :: Lens.Lens' Target (Prelude.Maybe Prelude.Text)
target_targetAddress :: Lens' Target (Maybe Text)
target_targetAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Target' {Maybe (Sensitive Text)
targetAddress :: Maybe (Sensitive Text)
$sel:targetAddress:Target' :: Target -> Maybe (Sensitive Text)
targetAddress} -> Maybe (Sensitive Text)
targetAddress) (\s :: Target
s@Target' {} Maybe (Sensitive Text)
a -> Target
s {$sel:targetAddress:Target' :: Maybe (Sensitive Text)
targetAddress = Maybe (Sensitive Text)
a} :: Target) 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. Iso' (Sensitive a) a
Data._Sensitive
target_targetType :: Lens.Lens' Target (Prelude.Maybe Prelude.Text)
target_targetType :: Lens' Target (Maybe Text)
target_targetType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Target' {Maybe Text
targetType :: Maybe Text
$sel:targetType:Target' :: Target -> Maybe Text
targetType} -> Maybe Text
targetType) (\s :: Target
s@Target' {} Maybe Text
a -> Target
s {$sel:targetType:Target' :: Maybe Text
targetType = Maybe Text
a} :: Target)
instance Prelude.Hashable Target where
hashWithSalt :: Int -> Target -> Int
hashWithSalt Int
_salt Target' {Maybe Text
Maybe (Sensitive Text)
targetType :: Maybe Text
targetAddress :: Maybe (Sensitive Text)
$sel:targetType:Target' :: Target -> Maybe Text
$sel:targetAddress:Target' :: Target -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
targetAddress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetType
instance Prelude.NFData Target where
rnf :: Target -> ()
rnf Target' {Maybe Text
Maybe (Sensitive Text)
targetType :: Maybe Text
targetAddress :: Maybe (Sensitive Text)
$sel:targetType:Target' :: Target -> Maybe Text
$sel:targetAddress:Target' :: Target -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
targetAddress
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetType
instance Data.ToJSON Target where
toJSON :: Target -> Value
toJSON Target' {Maybe Text
Maybe (Sensitive Text)
targetType :: Maybe Text
targetAddress :: Maybe (Sensitive Text)
$sel:targetType:Target' :: Target -> Maybe Text
$sel:targetAddress:Target' :: Target -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"TargetAddress" 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 (Sensitive Text)
targetAddress,
(Key
"TargetType" 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 Text
targetType
]
)