{-# 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.GitHubCodeDestination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GitHubCodeDestination = GitHubCodeDestination'
{
GitHubCodeDestination -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
GitHubCodeDestination -> Text
name :: Prelude.Text,
GitHubCodeDestination -> Text
type' :: Prelude.Text,
GitHubCodeDestination -> Text
owner :: Prelude.Text,
GitHubCodeDestination -> Bool
privateRepository :: Prelude.Bool,
GitHubCodeDestination -> Bool
issuesEnabled :: Prelude.Bool,
GitHubCodeDestination -> Sensitive Text
token :: Core.Sensitive Prelude.Text
}
deriving (GitHubCodeDestination -> GitHubCodeDestination -> Bool
(GitHubCodeDestination -> GitHubCodeDestination -> Bool)
-> (GitHubCodeDestination -> GitHubCodeDestination -> Bool)
-> Eq GitHubCodeDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GitHubCodeDestination -> GitHubCodeDestination -> Bool
$c/= :: GitHubCodeDestination -> GitHubCodeDestination -> Bool
== :: GitHubCodeDestination -> GitHubCodeDestination -> Bool
$c== :: GitHubCodeDestination -> GitHubCodeDestination -> Bool
Prelude.Eq, Int -> GitHubCodeDestination -> ShowS
[GitHubCodeDestination] -> ShowS
GitHubCodeDestination -> String
(Int -> GitHubCodeDestination -> ShowS)
-> (GitHubCodeDestination -> String)
-> ([GitHubCodeDestination] -> ShowS)
-> Show GitHubCodeDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GitHubCodeDestination] -> ShowS
$cshowList :: [GitHubCodeDestination] -> ShowS
show :: GitHubCodeDestination -> String
$cshow :: GitHubCodeDestination -> String
showsPrec :: Int -> GitHubCodeDestination -> ShowS
$cshowsPrec :: Int -> GitHubCodeDestination -> ShowS
Prelude.Show, (forall x. GitHubCodeDestination -> Rep GitHubCodeDestination x)
-> (forall x. Rep GitHubCodeDestination x -> GitHubCodeDestination)
-> Generic GitHubCodeDestination
forall x. Rep GitHubCodeDestination x -> GitHubCodeDestination
forall x. GitHubCodeDestination -> Rep GitHubCodeDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GitHubCodeDestination x -> GitHubCodeDestination
$cfrom :: forall x. GitHubCodeDestination -> Rep GitHubCodeDestination x
Prelude.Generic)
newGitHubCodeDestination ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Bool ->
Prelude.Bool ->
Prelude.Text ->
GitHubCodeDestination
newGitHubCodeDestination :: Text
-> Text -> Text -> Bool -> Bool -> Text -> GitHubCodeDestination
newGitHubCodeDestination
Text
pName_
Text
pType_
Text
pOwner_
Bool
pPrivateRepository_
Bool
pIssuesEnabled_
Text
pToken_ =
GitHubCodeDestination' :: Maybe Text
-> Text
-> Text
-> Text
-> Bool
-> Bool
-> Sensitive Text
-> GitHubCodeDestination
GitHubCodeDestination'
{ $sel:description:GitHubCodeDestination' :: Maybe Text
description =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:GitHubCodeDestination' :: Text
name = Text
pName_,
$sel:type':GitHubCodeDestination' :: Text
type' = Text
pType_,
$sel:owner:GitHubCodeDestination' :: Text
owner = Text
pOwner_,
$sel:privateRepository:GitHubCodeDestination' :: Bool
privateRepository = Bool
pPrivateRepository_,
$sel:issuesEnabled:GitHubCodeDestination' :: Bool
issuesEnabled = Bool
pIssuesEnabled_,
$sel:token:GitHubCodeDestination' :: Sensitive Text
token = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pToken_
}
gitHubCodeDestination_description :: Lens.Lens' GitHubCodeDestination (Prelude.Maybe Prelude.Text)
gitHubCodeDestination_description :: (Maybe Text -> f (Maybe Text))
-> GitHubCodeDestination -> f GitHubCodeDestination
gitHubCodeDestination_description = (GitHubCodeDestination -> Maybe Text)
-> (GitHubCodeDestination -> Maybe Text -> GitHubCodeDestination)
-> Lens
GitHubCodeDestination
GitHubCodeDestination
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitHubCodeDestination' {Maybe Text
description :: Maybe Text
$sel:description:GitHubCodeDestination' :: GitHubCodeDestination -> Maybe Text
description} -> Maybe Text
description) (\s :: GitHubCodeDestination
s@GitHubCodeDestination' {} Maybe Text
a -> GitHubCodeDestination
s {$sel:description:GitHubCodeDestination' :: Maybe Text
description = Maybe Text
a} :: GitHubCodeDestination)
gitHubCodeDestination_name :: Lens.Lens' GitHubCodeDestination Prelude.Text
gitHubCodeDestination_name :: (Text -> f Text)
-> GitHubCodeDestination -> f GitHubCodeDestination
gitHubCodeDestination_name = (GitHubCodeDestination -> Text)
-> (GitHubCodeDestination -> Text -> GitHubCodeDestination)
-> Lens GitHubCodeDestination GitHubCodeDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitHubCodeDestination' {Text
name :: Text
$sel:name:GitHubCodeDestination' :: GitHubCodeDestination -> Text
name} -> Text
name) (\s :: GitHubCodeDestination
s@GitHubCodeDestination' {} Text
a -> GitHubCodeDestination
s {$sel:name:GitHubCodeDestination' :: Text
name = Text
a} :: GitHubCodeDestination)
gitHubCodeDestination_type :: Lens.Lens' GitHubCodeDestination Prelude.Text
gitHubCodeDestination_type :: (Text -> f Text)
-> GitHubCodeDestination -> f GitHubCodeDestination
gitHubCodeDestination_type = (GitHubCodeDestination -> Text)
-> (GitHubCodeDestination -> Text -> GitHubCodeDestination)
-> Lens GitHubCodeDestination GitHubCodeDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitHubCodeDestination' {Text
type' :: Text
$sel:type':GitHubCodeDestination' :: GitHubCodeDestination -> Text
type'} -> Text
type') (\s :: GitHubCodeDestination
s@GitHubCodeDestination' {} Text
a -> GitHubCodeDestination
s {$sel:type':GitHubCodeDestination' :: Text
type' = Text
a} :: GitHubCodeDestination)
gitHubCodeDestination_owner :: Lens.Lens' GitHubCodeDestination Prelude.Text
gitHubCodeDestination_owner :: (Text -> f Text)
-> GitHubCodeDestination -> f GitHubCodeDestination
gitHubCodeDestination_owner = (GitHubCodeDestination -> Text)
-> (GitHubCodeDestination -> Text -> GitHubCodeDestination)
-> Lens GitHubCodeDestination GitHubCodeDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitHubCodeDestination' {Text
owner :: Text
$sel:owner:GitHubCodeDestination' :: GitHubCodeDestination -> Text
owner} -> Text
owner) (\s :: GitHubCodeDestination
s@GitHubCodeDestination' {} Text
a -> GitHubCodeDestination
s {$sel:owner:GitHubCodeDestination' :: Text
owner = Text
a} :: GitHubCodeDestination)
gitHubCodeDestination_privateRepository :: Lens.Lens' GitHubCodeDestination Prelude.Bool
gitHubCodeDestination_privateRepository :: (Bool -> f Bool)
-> GitHubCodeDestination -> f GitHubCodeDestination
gitHubCodeDestination_privateRepository = (GitHubCodeDestination -> Bool)
-> (GitHubCodeDestination -> Bool -> GitHubCodeDestination)
-> Lens GitHubCodeDestination GitHubCodeDestination Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitHubCodeDestination' {Bool
privateRepository :: Bool
$sel:privateRepository:GitHubCodeDestination' :: GitHubCodeDestination -> Bool
privateRepository} -> Bool
privateRepository) (\s :: GitHubCodeDestination
s@GitHubCodeDestination' {} Bool
a -> GitHubCodeDestination
s {$sel:privateRepository:GitHubCodeDestination' :: Bool
privateRepository = Bool
a} :: GitHubCodeDestination)
gitHubCodeDestination_issuesEnabled :: Lens.Lens' GitHubCodeDestination Prelude.Bool
gitHubCodeDestination_issuesEnabled :: (Bool -> f Bool)
-> GitHubCodeDestination -> f GitHubCodeDestination
gitHubCodeDestination_issuesEnabled = (GitHubCodeDestination -> Bool)
-> (GitHubCodeDestination -> Bool -> GitHubCodeDestination)
-> Lens GitHubCodeDestination GitHubCodeDestination Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitHubCodeDestination' {Bool
issuesEnabled :: Bool
$sel:issuesEnabled:GitHubCodeDestination' :: GitHubCodeDestination -> Bool
issuesEnabled} -> Bool
issuesEnabled) (\s :: GitHubCodeDestination
s@GitHubCodeDestination' {} Bool
a -> GitHubCodeDestination
s {$sel:issuesEnabled:GitHubCodeDestination' :: Bool
issuesEnabled = Bool
a} :: GitHubCodeDestination)
gitHubCodeDestination_token :: Lens.Lens' GitHubCodeDestination Prelude.Text
gitHubCodeDestination_token :: (Text -> f Text)
-> GitHubCodeDestination -> f GitHubCodeDestination
gitHubCodeDestination_token = (GitHubCodeDestination -> Sensitive Text)
-> (GitHubCodeDestination
-> Sensitive Text -> GitHubCodeDestination)
-> Lens
GitHubCodeDestination
GitHubCodeDestination
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitHubCodeDestination' {Sensitive Text
token :: Sensitive Text
$sel:token:GitHubCodeDestination' :: GitHubCodeDestination -> Sensitive Text
token} -> Sensitive Text
token) (\s :: GitHubCodeDestination
s@GitHubCodeDestination' {} Sensitive Text
a -> GitHubCodeDestination
s {$sel:token:GitHubCodeDestination' :: Sensitive Text
token = Sensitive Text
a} :: GitHubCodeDestination) ((Sensitive Text -> f (Sensitive Text))
-> GitHubCodeDestination -> f GitHubCodeDestination)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> GitHubCodeDestination
-> f GitHubCodeDestination
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Prelude.Hashable GitHubCodeDestination
instance Prelude.NFData GitHubCodeDestination
instance Core.ToJSON GitHubCodeDestination where
toJSON :: GitHubCodeDestination -> Value
toJSON GitHubCodeDestination' {Bool
Maybe Text
Text
Sensitive Text
token :: Sensitive Text
issuesEnabled :: Bool
privateRepository :: Bool
owner :: Text
type' :: Text
name :: Text
description :: Maybe Text
$sel:token:GitHubCodeDestination' :: GitHubCodeDestination -> Sensitive Text
$sel:issuesEnabled:GitHubCodeDestination' :: GitHubCodeDestination -> Bool
$sel:privateRepository:GitHubCodeDestination' :: GitHubCodeDestination -> Bool
$sel:owner:GitHubCodeDestination' :: GitHubCodeDestination -> Text
$sel:type':GitHubCodeDestination' :: GitHubCodeDestination -> Text
$sel:name:GitHubCodeDestination' :: GitHubCodeDestination -> Text
$sel:description:GitHubCodeDestination' :: GitHubCodeDestination -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"owner" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
owner),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"privateRepository" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
privateRepository),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"issuesEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
issuesEnabled),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"token" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
token)
]
)