{-# 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.Repository 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 Repository = Repository'
{
Repository -> Maybe Text
encryptionKey :: Prelude.Maybe Prelude.Text,
Repository -> Text
arn :: Prelude.Text,
Repository -> Text
connectionArn :: Prelude.Text,
Repository -> Text
name :: Prelude.Text,
Repository -> RepositoryProvider
provider :: RepositoryProvider
}
deriving (Repository -> Repository -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Repository -> Repository -> Bool
$c/= :: Repository -> Repository -> Bool
== :: Repository -> Repository -> Bool
$c== :: Repository -> Repository -> Bool
Prelude.Eq, ReadPrec [Repository]
ReadPrec Repository
Int -> ReadS Repository
ReadS [Repository]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Repository]
$creadListPrec :: ReadPrec [Repository]
readPrec :: ReadPrec Repository
$creadPrec :: ReadPrec Repository
readList :: ReadS [Repository]
$creadList :: ReadS [Repository]
readsPrec :: Int -> ReadS Repository
$creadsPrec :: Int -> ReadS Repository
Prelude.Read, Int -> Repository -> ShowS
[Repository] -> ShowS
Repository -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Repository] -> ShowS
$cshowList :: [Repository] -> ShowS
show :: Repository -> String
$cshow :: Repository -> String
showsPrec :: Int -> Repository -> ShowS
$cshowsPrec :: Int -> Repository -> ShowS
Prelude.Show, forall x. Rep Repository x -> Repository
forall x. Repository -> Rep Repository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Repository x -> Repository
$cfrom :: forall x. Repository -> Rep Repository x
Prelude.Generic)
newRepository ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
RepositoryProvider ->
Repository
newRepository :: Text -> Text -> Text -> RepositoryProvider -> Repository
newRepository Text
pArn_ Text
pConnectionArn_ Text
pName_ RepositoryProvider
pProvider_ =
Repository'
{ $sel:encryptionKey:Repository' :: Maybe Text
encryptionKey = forall a. Maybe a
Prelude.Nothing,
$sel:arn:Repository' :: Text
arn = Text
pArn_,
$sel:connectionArn:Repository' :: Text
connectionArn = Text
pConnectionArn_,
$sel:name:Repository' :: Text
name = Text
pName_,
$sel:provider:Repository' :: RepositoryProvider
provider = RepositoryProvider
pProvider_
}
repository_encryptionKey :: Lens.Lens' Repository (Prelude.Maybe Prelude.Text)
repository_encryptionKey :: Lens' Repository (Maybe Text)
repository_encryptionKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Maybe Text
encryptionKey :: Maybe Text
$sel:encryptionKey:Repository' :: Repository -> Maybe Text
encryptionKey} -> Maybe Text
encryptionKey) (\s :: Repository
s@Repository' {} Maybe Text
a -> Repository
s {$sel:encryptionKey:Repository' :: Maybe Text
encryptionKey = Maybe Text
a} :: Repository)
repository_arn :: Lens.Lens' Repository Prelude.Text
repository_arn :: Lens' Repository Text
repository_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Text
arn :: Text
$sel:arn:Repository' :: Repository -> Text
arn} -> Text
arn) (\s :: Repository
s@Repository' {} Text
a -> Repository
s {$sel:arn:Repository' :: Text
arn = Text
a} :: Repository)
repository_connectionArn :: Lens.Lens' Repository Prelude.Text
repository_connectionArn :: Lens' Repository Text
repository_connectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Text
connectionArn :: Text
$sel:connectionArn:Repository' :: Repository -> Text
connectionArn} -> Text
connectionArn) (\s :: Repository
s@Repository' {} Text
a -> Repository
s {$sel:connectionArn:Repository' :: Text
connectionArn = Text
a} :: Repository)
repository_name :: Lens.Lens' Repository Prelude.Text
repository_name :: Lens' Repository Text
repository_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {Text
name :: Text
$sel:name:Repository' :: Repository -> Text
name} -> Text
name) (\s :: Repository
s@Repository' {} Text
a -> Repository
s {$sel:name:Repository' :: Text
name = Text
a} :: Repository)
repository_provider :: Lens.Lens' Repository RepositoryProvider
repository_provider :: Lens' Repository RepositoryProvider
repository_provider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Repository' {RepositoryProvider
provider :: RepositoryProvider
$sel:provider:Repository' :: Repository -> RepositoryProvider
provider} -> RepositoryProvider
provider) (\s :: Repository
s@Repository' {} RepositoryProvider
a -> Repository
s {$sel:provider:Repository' :: RepositoryProvider
provider = RepositoryProvider
a} :: Repository)
instance Data.FromJSON Repository where
parseJSON :: Value -> Parser Repository
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Repository"
( \Object
x ->
Maybe Text
-> Text -> Text -> Text -> RepositoryProvider -> Repository
Repository'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"encryptionKey")
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
"arn")
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
"connectionArn")
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
"name")
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
"provider")
)
instance Prelude.Hashable Repository where
hashWithSalt :: Int -> Repository -> Int
hashWithSalt Int
_salt Repository' {Maybe Text
Text
RepositoryProvider
provider :: RepositoryProvider
name :: Text
connectionArn :: Text
arn :: Text
encryptionKey :: Maybe Text
$sel:provider:Repository' :: Repository -> RepositoryProvider
$sel:name:Repository' :: Repository -> Text
$sel:connectionArn:Repository' :: Repository -> Text
$sel:arn:Repository' :: Repository -> Text
$sel:encryptionKey:Repository' :: Repository -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encryptionKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionArn
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 Repository where
rnf :: Repository -> ()
rnf Repository' {Maybe Text
Text
RepositoryProvider
provider :: RepositoryProvider
name :: Text
connectionArn :: Text
arn :: Text
encryptionKey :: Maybe Text
$sel:provider:Repository' :: Repository -> RepositoryProvider
$sel:name:Repository' :: Repository -> Text
$sel:connectionArn:Repository' :: Repository -> Text
$sel:arn:Repository' :: Repository -> Text
$sel:encryptionKey:Repository' :: Repository -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encryptionKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectionArn
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