{-# 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.CodeArtifact.Types.RepositoryExternalConnectionInfo where
import Amazonka.CodeArtifact.Types.ExternalConnectionStatus
import Amazonka.CodeArtifact.Types.PackageFormat
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RepositoryExternalConnectionInfo = RepositoryExternalConnectionInfo'
{
RepositoryExternalConnectionInfo -> Maybe Text
externalConnectionName :: Prelude.Maybe Prelude.Text,
RepositoryExternalConnectionInfo -> Maybe ExternalConnectionStatus
status :: Prelude.Maybe ExternalConnectionStatus,
RepositoryExternalConnectionInfo -> Maybe PackageFormat
packageFormat :: Prelude.Maybe PackageFormat
}
deriving (RepositoryExternalConnectionInfo
-> RepositoryExternalConnectionInfo -> Bool
(RepositoryExternalConnectionInfo
-> RepositoryExternalConnectionInfo -> Bool)
-> (RepositoryExternalConnectionInfo
-> RepositoryExternalConnectionInfo -> Bool)
-> Eq RepositoryExternalConnectionInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositoryExternalConnectionInfo
-> RepositoryExternalConnectionInfo -> Bool
$c/= :: RepositoryExternalConnectionInfo
-> RepositoryExternalConnectionInfo -> Bool
== :: RepositoryExternalConnectionInfo
-> RepositoryExternalConnectionInfo -> Bool
$c== :: RepositoryExternalConnectionInfo
-> RepositoryExternalConnectionInfo -> Bool
Prelude.Eq, ReadPrec [RepositoryExternalConnectionInfo]
ReadPrec RepositoryExternalConnectionInfo
Int -> ReadS RepositoryExternalConnectionInfo
ReadS [RepositoryExternalConnectionInfo]
(Int -> ReadS RepositoryExternalConnectionInfo)
-> ReadS [RepositoryExternalConnectionInfo]
-> ReadPrec RepositoryExternalConnectionInfo
-> ReadPrec [RepositoryExternalConnectionInfo]
-> Read RepositoryExternalConnectionInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositoryExternalConnectionInfo]
$creadListPrec :: ReadPrec [RepositoryExternalConnectionInfo]
readPrec :: ReadPrec RepositoryExternalConnectionInfo
$creadPrec :: ReadPrec RepositoryExternalConnectionInfo
readList :: ReadS [RepositoryExternalConnectionInfo]
$creadList :: ReadS [RepositoryExternalConnectionInfo]
readsPrec :: Int -> ReadS RepositoryExternalConnectionInfo
$creadsPrec :: Int -> ReadS RepositoryExternalConnectionInfo
Prelude.Read, Int -> RepositoryExternalConnectionInfo -> ShowS
[RepositoryExternalConnectionInfo] -> ShowS
RepositoryExternalConnectionInfo -> String
(Int -> RepositoryExternalConnectionInfo -> ShowS)
-> (RepositoryExternalConnectionInfo -> String)
-> ([RepositoryExternalConnectionInfo] -> ShowS)
-> Show RepositoryExternalConnectionInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositoryExternalConnectionInfo] -> ShowS
$cshowList :: [RepositoryExternalConnectionInfo] -> ShowS
show :: RepositoryExternalConnectionInfo -> String
$cshow :: RepositoryExternalConnectionInfo -> String
showsPrec :: Int -> RepositoryExternalConnectionInfo -> ShowS
$cshowsPrec :: Int -> RepositoryExternalConnectionInfo -> ShowS
Prelude.Show, (forall x.
RepositoryExternalConnectionInfo
-> Rep RepositoryExternalConnectionInfo x)
-> (forall x.
Rep RepositoryExternalConnectionInfo x
-> RepositoryExternalConnectionInfo)
-> Generic RepositoryExternalConnectionInfo
forall x.
Rep RepositoryExternalConnectionInfo x
-> RepositoryExternalConnectionInfo
forall x.
RepositoryExternalConnectionInfo
-> Rep RepositoryExternalConnectionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RepositoryExternalConnectionInfo x
-> RepositoryExternalConnectionInfo
$cfrom :: forall x.
RepositoryExternalConnectionInfo
-> Rep RepositoryExternalConnectionInfo x
Prelude.Generic)
newRepositoryExternalConnectionInfo ::
RepositoryExternalConnectionInfo
newRepositoryExternalConnectionInfo :: RepositoryExternalConnectionInfo
newRepositoryExternalConnectionInfo =
RepositoryExternalConnectionInfo' :: Maybe Text
-> Maybe ExternalConnectionStatus
-> Maybe PackageFormat
-> RepositoryExternalConnectionInfo
RepositoryExternalConnectionInfo'
{ $sel:externalConnectionName:RepositoryExternalConnectionInfo' :: Maybe Text
externalConnectionName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:RepositoryExternalConnectionInfo' :: Maybe ExternalConnectionStatus
status = Maybe ExternalConnectionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:packageFormat:RepositoryExternalConnectionInfo' :: Maybe PackageFormat
packageFormat = Maybe PackageFormat
forall a. Maybe a
Prelude.Nothing
}
repositoryExternalConnectionInfo_externalConnectionName :: Lens.Lens' RepositoryExternalConnectionInfo (Prelude.Maybe Prelude.Text)
repositoryExternalConnectionInfo_externalConnectionName :: (Maybe Text -> f (Maybe Text))
-> RepositoryExternalConnectionInfo
-> f RepositoryExternalConnectionInfo
repositoryExternalConnectionInfo_externalConnectionName = (RepositoryExternalConnectionInfo -> Maybe Text)
-> (RepositoryExternalConnectionInfo
-> Maybe Text -> RepositoryExternalConnectionInfo)
-> Lens
RepositoryExternalConnectionInfo
RepositoryExternalConnectionInfo
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryExternalConnectionInfo' {Maybe Text
externalConnectionName :: Maybe Text
$sel:externalConnectionName:RepositoryExternalConnectionInfo' :: RepositoryExternalConnectionInfo -> Maybe Text
externalConnectionName} -> Maybe Text
externalConnectionName) (\s :: RepositoryExternalConnectionInfo
s@RepositoryExternalConnectionInfo' {} Maybe Text
a -> RepositoryExternalConnectionInfo
s {$sel:externalConnectionName:RepositoryExternalConnectionInfo' :: Maybe Text
externalConnectionName = Maybe Text
a} :: RepositoryExternalConnectionInfo)
repositoryExternalConnectionInfo_status :: Lens.Lens' RepositoryExternalConnectionInfo (Prelude.Maybe ExternalConnectionStatus)
repositoryExternalConnectionInfo_status :: (Maybe ExternalConnectionStatus
-> f (Maybe ExternalConnectionStatus))
-> RepositoryExternalConnectionInfo
-> f RepositoryExternalConnectionInfo
repositoryExternalConnectionInfo_status = (RepositoryExternalConnectionInfo
-> Maybe ExternalConnectionStatus)
-> (RepositoryExternalConnectionInfo
-> Maybe ExternalConnectionStatus
-> RepositoryExternalConnectionInfo)
-> Lens
RepositoryExternalConnectionInfo
RepositoryExternalConnectionInfo
(Maybe ExternalConnectionStatus)
(Maybe ExternalConnectionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryExternalConnectionInfo' {Maybe ExternalConnectionStatus
status :: Maybe ExternalConnectionStatus
$sel:status:RepositoryExternalConnectionInfo' :: RepositoryExternalConnectionInfo -> Maybe ExternalConnectionStatus
status} -> Maybe ExternalConnectionStatus
status) (\s :: RepositoryExternalConnectionInfo
s@RepositoryExternalConnectionInfo' {} Maybe ExternalConnectionStatus
a -> RepositoryExternalConnectionInfo
s {$sel:status:RepositoryExternalConnectionInfo' :: Maybe ExternalConnectionStatus
status = Maybe ExternalConnectionStatus
a} :: RepositoryExternalConnectionInfo)
repositoryExternalConnectionInfo_packageFormat :: Lens.Lens' RepositoryExternalConnectionInfo (Prelude.Maybe PackageFormat)
repositoryExternalConnectionInfo_packageFormat :: (Maybe PackageFormat -> f (Maybe PackageFormat))
-> RepositoryExternalConnectionInfo
-> f RepositoryExternalConnectionInfo
repositoryExternalConnectionInfo_packageFormat = (RepositoryExternalConnectionInfo -> Maybe PackageFormat)
-> (RepositoryExternalConnectionInfo
-> Maybe PackageFormat -> RepositoryExternalConnectionInfo)
-> Lens
RepositoryExternalConnectionInfo
RepositoryExternalConnectionInfo
(Maybe PackageFormat)
(Maybe PackageFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryExternalConnectionInfo' {Maybe PackageFormat
packageFormat :: Maybe PackageFormat
$sel:packageFormat:RepositoryExternalConnectionInfo' :: RepositoryExternalConnectionInfo -> Maybe PackageFormat
packageFormat} -> Maybe PackageFormat
packageFormat) (\s :: RepositoryExternalConnectionInfo
s@RepositoryExternalConnectionInfo' {} Maybe PackageFormat
a -> RepositoryExternalConnectionInfo
s {$sel:packageFormat:RepositoryExternalConnectionInfo' :: Maybe PackageFormat
packageFormat = Maybe PackageFormat
a} :: RepositoryExternalConnectionInfo)
instance
Core.FromJSON
RepositoryExternalConnectionInfo
where
parseJSON :: Value -> Parser RepositoryExternalConnectionInfo
parseJSON =
String
-> (Object -> Parser RepositoryExternalConnectionInfo)
-> Value
-> Parser RepositoryExternalConnectionInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RepositoryExternalConnectionInfo"
( \Object
x ->
Maybe Text
-> Maybe ExternalConnectionStatus
-> Maybe PackageFormat
-> RepositoryExternalConnectionInfo
RepositoryExternalConnectionInfo'
(Maybe Text
-> Maybe ExternalConnectionStatus
-> Maybe PackageFormat
-> RepositoryExternalConnectionInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe ExternalConnectionStatus
-> Maybe PackageFormat -> RepositoryExternalConnectionInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"externalConnectionName")
Parser
(Maybe ExternalConnectionStatus
-> Maybe PackageFormat -> RepositoryExternalConnectionInfo)
-> Parser (Maybe ExternalConnectionStatus)
-> Parser (Maybe PackageFormat -> RepositoryExternalConnectionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExternalConnectionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser (Maybe PackageFormat -> RepositoryExternalConnectionInfo)
-> Parser (Maybe PackageFormat)
-> Parser RepositoryExternalConnectionInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PackageFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"packageFormat")
)
instance
Prelude.Hashable
RepositoryExternalConnectionInfo
instance
Prelude.NFData
RepositoryExternalConnectionInfo