{-# 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.CodeStar.Types.CodeDestination where
import Amazonka.CodeStar.Types.CodeCommitCodeDestination
import Amazonka.CodeStar.Types.GitHubCodeDestination
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 CodeDestination = CodeDestination'
{
CodeDestination -> Maybe CodeCommitCodeDestination
codeCommit :: Prelude.Maybe CodeCommitCodeDestination,
CodeDestination -> Maybe GitHubCodeDestination
gitHub :: Prelude.Maybe GitHubCodeDestination
}
deriving (CodeDestination -> CodeDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeDestination -> CodeDestination -> Bool
$c/= :: CodeDestination -> CodeDestination -> Bool
== :: CodeDestination -> CodeDestination -> Bool
$c== :: CodeDestination -> CodeDestination -> Bool
Prelude.Eq, Int -> CodeDestination -> ShowS
[CodeDestination] -> ShowS
CodeDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeDestination] -> ShowS
$cshowList :: [CodeDestination] -> ShowS
show :: CodeDestination -> String
$cshow :: CodeDestination -> String
showsPrec :: Int -> CodeDestination -> ShowS
$cshowsPrec :: Int -> CodeDestination -> ShowS
Prelude.Show, forall x. Rep CodeDestination x -> CodeDestination
forall x. CodeDestination -> Rep CodeDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeDestination x -> CodeDestination
$cfrom :: forall x. CodeDestination -> Rep CodeDestination x
Prelude.Generic)
newCodeDestination ::
CodeDestination
newCodeDestination :: CodeDestination
newCodeDestination =
CodeDestination'
{ $sel:codeCommit:CodeDestination' :: Maybe CodeCommitCodeDestination
codeCommit = forall a. Maybe a
Prelude.Nothing,
$sel:gitHub:CodeDestination' :: Maybe GitHubCodeDestination
gitHub = forall a. Maybe a
Prelude.Nothing
}
codeDestination_codeCommit :: Lens.Lens' CodeDestination (Prelude.Maybe CodeCommitCodeDestination)
codeDestination_codeCommit :: Lens' CodeDestination (Maybe CodeCommitCodeDestination)
codeDestination_codeCommit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeDestination' {Maybe CodeCommitCodeDestination
codeCommit :: Maybe CodeCommitCodeDestination
$sel:codeCommit:CodeDestination' :: CodeDestination -> Maybe CodeCommitCodeDestination
codeCommit} -> Maybe CodeCommitCodeDestination
codeCommit) (\s :: CodeDestination
s@CodeDestination' {} Maybe CodeCommitCodeDestination
a -> CodeDestination
s {$sel:codeCommit:CodeDestination' :: Maybe CodeCommitCodeDestination
codeCommit = Maybe CodeCommitCodeDestination
a} :: CodeDestination)
codeDestination_gitHub :: Lens.Lens' CodeDestination (Prelude.Maybe GitHubCodeDestination)
codeDestination_gitHub :: Lens' CodeDestination (Maybe GitHubCodeDestination)
codeDestination_gitHub = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeDestination' {Maybe GitHubCodeDestination
gitHub :: Maybe GitHubCodeDestination
$sel:gitHub:CodeDestination' :: CodeDestination -> Maybe GitHubCodeDestination
gitHub} -> Maybe GitHubCodeDestination
gitHub) (\s :: CodeDestination
s@CodeDestination' {} Maybe GitHubCodeDestination
a -> CodeDestination
s {$sel:gitHub:CodeDestination' :: Maybe GitHubCodeDestination
gitHub = Maybe GitHubCodeDestination
a} :: CodeDestination)
instance Prelude.Hashable CodeDestination where
hashWithSalt :: Int -> CodeDestination -> Int
hashWithSalt Int
_salt CodeDestination' {Maybe CodeCommitCodeDestination
Maybe GitHubCodeDestination
gitHub :: Maybe GitHubCodeDestination
codeCommit :: Maybe CodeCommitCodeDestination
$sel:gitHub:CodeDestination' :: CodeDestination -> Maybe GitHubCodeDestination
$sel:codeCommit:CodeDestination' :: CodeDestination -> Maybe CodeCommitCodeDestination
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CodeCommitCodeDestination
codeCommit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GitHubCodeDestination
gitHub
instance Prelude.NFData CodeDestination where
rnf :: CodeDestination -> ()
rnf CodeDestination' {Maybe CodeCommitCodeDestination
Maybe GitHubCodeDestination
gitHub :: Maybe GitHubCodeDestination
codeCommit :: Maybe CodeCommitCodeDestination
$sel:gitHub:CodeDestination' :: CodeDestination -> Maybe GitHubCodeDestination
$sel:codeCommit:CodeDestination' :: CodeDestination -> Maybe CodeCommitCodeDestination
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CodeCommitCodeDestination
codeCommit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GitHubCodeDestination
gitHub
instance Data.ToJSON CodeDestination where
toJSON :: CodeDestination -> Value
toJSON CodeDestination' {Maybe CodeCommitCodeDestination
Maybe GitHubCodeDestination
gitHub :: Maybe GitHubCodeDestination
codeCommit :: Maybe CodeCommitCodeDestination
$sel:gitHub:CodeDestination' :: CodeDestination -> Maybe GitHubCodeDestination
$sel:codeCommit:CodeDestination' :: CodeDestination -> Maybe CodeCommitCodeDestination
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"codeCommit" 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 CodeCommitCodeDestination
codeCommit,
(Key
"gitHub" 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 GitHubCodeDestination
gitHub
]
)