{-# 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.Revision 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 Revision = Revision'
{
Revision -> Text
branch :: Prelude.Text,
Revision -> Text
directory :: Prelude.Text,
Revision -> Text
repositoryName :: Prelude.Text,
Revision -> RepositoryProvider
repositoryProvider :: RepositoryProvider,
Revision -> Text
sha :: Prelude.Text
}
deriving (Revision -> Revision -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Revision -> Revision -> Bool
$c/= :: Revision -> Revision -> Bool
== :: Revision -> Revision -> Bool
$c== :: Revision -> Revision -> Bool
Prelude.Eq, ReadPrec [Revision]
ReadPrec Revision
Int -> ReadS Revision
ReadS [Revision]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Revision]
$creadListPrec :: ReadPrec [Revision]
readPrec :: ReadPrec Revision
$creadPrec :: ReadPrec Revision
readList :: ReadS [Revision]
$creadList :: ReadS [Revision]
readsPrec :: Int -> ReadS Revision
$creadsPrec :: Int -> ReadS Revision
Prelude.Read, Int -> Revision -> ShowS
[Revision] -> ShowS
Revision -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Revision] -> ShowS
$cshowList :: [Revision] -> ShowS
show :: Revision -> String
$cshow :: Revision -> String
showsPrec :: Int -> Revision -> ShowS
$cshowsPrec :: Int -> Revision -> ShowS
Prelude.Show, forall x. Rep Revision x -> Revision
forall x. Revision -> Rep Revision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Revision x -> Revision
$cfrom :: forall x. Revision -> Rep Revision x
Prelude.Generic)
newRevision ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
RepositoryProvider ->
Prelude.Text ->
Revision
newRevision :: Text -> Text -> Text -> RepositoryProvider -> Text -> Revision
newRevision
Text
pBranch_
Text
pDirectory_
Text
pRepositoryName_
RepositoryProvider
pRepositoryProvider_
Text
pSha_ =
Revision'
{ $sel:branch:Revision' :: Text
branch = Text
pBranch_,
$sel:directory:Revision' :: Text
directory = Text
pDirectory_,
$sel:repositoryName:Revision' :: Text
repositoryName = Text
pRepositoryName_,
$sel:repositoryProvider:Revision' :: RepositoryProvider
repositoryProvider = RepositoryProvider
pRepositoryProvider_,
$sel:sha:Revision' :: Text
sha = Text
pSha_
}
revision_branch :: Lens.Lens' Revision Prelude.Text
revision_branch :: Lens' Revision Text
revision_branch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Revision' {Text
branch :: Text
$sel:branch:Revision' :: Revision -> Text
branch} -> Text
branch) (\s :: Revision
s@Revision' {} Text
a -> Revision
s {$sel:branch:Revision' :: Text
branch = Text
a} :: Revision)
revision_directory :: Lens.Lens' Revision Prelude.Text
revision_directory :: Lens' Revision Text
revision_directory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Revision' {Text
directory :: Text
$sel:directory:Revision' :: Revision -> Text
directory} -> Text
directory) (\s :: Revision
s@Revision' {} Text
a -> Revision
s {$sel:directory:Revision' :: Text
directory = Text
a} :: Revision)
revision_repositoryName :: Lens.Lens' Revision Prelude.Text
revision_repositoryName :: Lens' Revision Text
revision_repositoryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Revision' {Text
repositoryName :: Text
$sel:repositoryName:Revision' :: Revision -> Text
repositoryName} -> Text
repositoryName) (\s :: Revision
s@Revision' {} Text
a -> Revision
s {$sel:repositoryName:Revision' :: Text
repositoryName = Text
a} :: Revision)
revision_repositoryProvider :: Lens.Lens' Revision RepositoryProvider
revision_repositoryProvider :: Lens' Revision RepositoryProvider
revision_repositoryProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Revision' {RepositoryProvider
repositoryProvider :: RepositoryProvider
$sel:repositoryProvider:Revision' :: Revision -> RepositoryProvider
repositoryProvider} -> RepositoryProvider
repositoryProvider) (\s :: Revision
s@Revision' {} RepositoryProvider
a -> Revision
s {$sel:repositoryProvider:Revision' :: RepositoryProvider
repositoryProvider = RepositoryProvider
a} :: Revision)
revision_sha :: Lens.Lens' Revision Prelude.Text
revision_sha :: Lens' Revision Text
revision_sha = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Revision' {Text
sha :: Text
$sel:sha:Revision' :: Revision -> Text
sha} -> Text
sha) (\s :: Revision
s@Revision' {} Text
a -> Revision
s {$sel:sha:Revision' :: Text
sha = Text
a} :: Revision)
instance Data.FromJSON Revision where
parseJSON :: Value -> Parser Revision
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Revision"
( \Object
x ->
Text -> Text -> Text -> RepositoryProvider -> Text -> Revision
Revision'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"branch")
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
"directory")
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
"repositoryName")
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
"repositoryProvider")
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
"sha")
)
instance Prelude.Hashable Revision where
hashWithSalt :: Int -> Revision -> Int
hashWithSalt Int
_salt Revision' {Text
RepositoryProvider
sha :: Text
repositoryProvider :: RepositoryProvider
repositoryName :: Text
directory :: Text
branch :: Text
$sel:sha:Revision' :: Revision -> Text
$sel:repositoryProvider:Revision' :: Revision -> RepositoryProvider
$sel:repositoryName:Revision' :: Revision -> Text
$sel:directory:Revision' :: Revision -> Text
$sel:branch:Revision' :: Revision -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
branch
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directory
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
repositoryName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RepositoryProvider
repositoryProvider
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sha
instance Prelude.NFData Revision where
rnf :: Revision -> ()
rnf Revision' {Text
RepositoryProvider
sha :: Text
repositoryProvider :: RepositoryProvider
repositoryName :: Text
directory :: Text
branch :: Text
$sel:sha:Revision' :: Revision -> Text
$sel:repositoryProvider:Revision' :: Revision -> RepositoryProvider
$sel:repositoryName:Revision' :: Revision -> Text
$sel:directory:Revision' :: Revision -> Text
$sel:branch:Revision' :: Revision -> 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
directory
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
repositoryName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RepositoryProvider
repositoryProvider
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sha