{-# 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.Proton.Types.RepositoryBranchInput 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
import Amazonka.Proton.Types.RepositoryProvider
data RepositoryBranchInput = RepositoryBranchInput'
{
RepositoryBranchInput -> Text
branch :: Prelude.Text,
RepositoryBranchInput -> Text
name :: Prelude.Text,
RepositoryBranchInput -> RepositoryProvider
provider :: RepositoryProvider
}
deriving (RepositoryBranchInput -> RepositoryBranchInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositoryBranchInput -> RepositoryBranchInput -> Bool
$c/= :: RepositoryBranchInput -> RepositoryBranchInput -> Bool
== :: RepositoryBranchInput -> RepositoryBranchInput -> Bool
$c== :: RepositoryBranchInput -> RepositoryBranchInput -> Bool
Prelude.Eq, ReadPrec [RepositoryBranchInput]
ReadPrec RepositoryBranchInput
Int -> ReadS RepositoryBranchInput
ReadS [RepositoryBranchInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositoryBranchInput]
$creadListPrec :: ReadPrec [RepositoryBranchInput]
readPrec :: ReadPrec RepositoryBranchInput
$creadPrec :: ReadPrec RepositoryBranchInput
readList :: ReadS [RepositoryBranchInput]
$creadList :: ReadS [RepositoryBranchInput]
readsPrec :: Int -> ReadS RepositoryBranchInput
$creadsPrec :: Int -> ReadS RepositoryBranchInput
Prelude.Read, Int -> RepositoryBranchInput -> ShowS
[RepositoryBranchInput] -> ShowS
RepositoryBranchInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositoryBranchInput] -> ShowS
$cshowList :: [RepositoryBranchInput] -> ShowS
show :: RepositoryBranchInput -> String
$cshow :: RepositoryBranchInput -> String
showsPrec :: Int -> RepositoryBranchInput -> ShowS
$cshowsPrec :: Int -> RepositoryBranchInput -> ShowS
Prelude.Show, forall x. Rep RepositoryBranchInput x -> RepositoryBranchInput
forall x. RepositoryBranchInput -> Rep RepositoryBranchInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RepositoryBranchInput x -> RepositoryBranchInput
$cfrom :: forall x. RepositoryBranchInput -> Rep RepositoryBranchInput x
Prelude.Generic)
newRepositoryBranchInput ::
Prelude.Text ->
Prelude.Text ->
RepositoryProvider ->
RepositoryBranchInput
newRepositoryBranchInput :: Text -> Text -> RepositoryProvider -> RepositoryBranchInput
newRepositoryBranchInput Text
pBranch_ Text
pName_ RepositoryProvider
pProvider_ =
RepositoryBranchInput'
{ $sel:branch:RepositoryBranchInput' :: Text
branch = Text
pBranch_,
$sel:name:RepositoryBranchInput' :: Text
name = Text
pName_,
$sel:provider:RepositoryBranchInput' :: RepositoryProvider
provider = RepositoryProvider
pProvider_
}
repositoryBranchInput_branch :: Lens.Lens' RepositoryBranchInput Prelude.Text
repositoryBranchInput_branch :: Lens' RepositoryBranchInput Text
repositoryBranchInput_branch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryBranchInput' {Text
branch :: Text
$sel:branch:RepositoryBranchInput' :: RepositoryBranchInput -> Text
branch} -> Text
branch) (\s :: RepositoryBranchInput
s@RepositoryBranchInput' {} Text
a -> RepositoryBranchInput
s {$sel:branch:RepositoryBranchInput' :: Text
branch = Text
a} :: RepositoryBranchInput)
repositoryBranchInput_name :: Lens.Lens' RepositoryBranchInput Prelude.Text
repositoryBranchInput_name :: Lens' RepositoryBranchInput Text
repositoryBranchInput_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryBranchInput' {Text
name :: Text
$sel:name:RepositoryBranchInput' :: RepositoryBranchInput -> Text
name} -> Text
name) (\s :: RepositoryBranchInput
s@RepositoryBranchInput' {} Text
a -> RepositoryBranchInput
s {$sel:name:RepositoryBranchInput' :: Text
name = Text
a} :: RepositoryBranchInput)
repositoryBranchInput_provider :: Lens.Lens' RepositoryBranchInput RepositoryProvider
repositoryBranchInput_provider :: Lens' RepositoryBranchInput RepositoryProvider
repositoryBranchInput_provider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryBranchInput' {RepositoryProvider
provider :: RepositoryProvider
$sel:provider:RepositoryBranchInput' :: RepositoryBranchInput -> RepositoryProvider
provider} -> RepositoryProvider
provider) (\s :: RepositoryBranchInput
s@RepositoryBranchInput' {} RepositoryProvider
a -> RepositoryBranchInput
s {$sel:provider:RepositoryBranchInput' :: RepositoryProvider
provider = RepositoryProvider
a} :: RepositoryBranchInput)
instance Prelude.Hashable RepositoryBranchInput where
hashWithSalt :: Int -> RepositoryBranchInput -> Int
hashWithSalt Int
_salt RepositoryBranchInput' {Text
RepositoryProvider
provider :: RepositoryProvider
name :: Text
branch :: Text
$sel:provider:RepositoryBranchInput' :: RepositoryBranchInput -> RepositoryProvider
$sel:name:RepositoryBranchInput' :: RepositoryBranchInput -> Text
$sel:branch:RepositoryBranchInput' :: RepositoryBranchInput -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
branch
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RepositoryProvider
provider
instance Prelude.NFData RepositoryBranchInput where
rnf :: RepositoryBranchInput -> ()
rnf RepositoryBranchInput' {Text
RepositoryProvider
provider :: RepositoryProvider
name :: Text
branch :: Text
$sel:provider:RepositoryBranchInput' :: RepositoryBranchInput -> RepositoryProvider
$sel:name:RepositoryBranchInput' :: RepositoryBranchInput -> Text
$sel:branch:RepositoryBranchInput' :: RepositoryBranchInput -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
branch
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RepositoryProvider
provider
instance Data.ToJSON RepositoryBranchInput where
toJSON :: RepositoryBranchInput -> Value
toJSON RepositoryBranchInput' {Text
RepositoryProvider
provider :: RepositoryProvider
name :: Text
branch :: Text
$sel:provider:RepositoryBranchInput' :: RepositoryBranchInput -> RepositoryProvider
$sel:name:RepositoryBranchInput' :: RepositoryBranchInput -> Text
$sel:branch:RepositoryBranchInput' :: RepositoryBranchInput -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"branch" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
branch),
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"provider" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RepositoryProvider
provider)
]
)