{-# 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.CodeStarConnections.Types.Connection where
import Amazonka.CodeStarConnections.Types.ConnectionStatus
import Amazonka.CodeStarConnections.Types.ProviderType
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
data Connection = Connection'
{
Connection -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
connectionName :: Prelude.Maybe Prelude.Text,
Connection -> Maybe ConnectionStatus
connectionStatus :: Prelude.Maybe ConnectionStatus,
Connection -> Maybe Text
hostArn :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
ownerAccountId :: Prelude.Maybe Prelude.Text,
Connection -> Maybe ProviderType
providerType :: Prelude.Maybe ProviderType
}
deriving (Connection -> Connection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Connection -> Connection -> Bool
$c/= :: Connection -> Connection -> Bool
== :: Connection -> Connection -> Bool
$c== :: Connection -> Connection -> Bool
Prelude.Eq, ReadPrec [Connection]
ReadPrec Connection
Int -> ReadS Connection
ReadS [Connection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Connection]
$creadListPrec :: ReadPrec [Connection]
readPrec :: ReadPrec Connection
$creadPrec :: ReadPrec Connection
readList :: ReadS [Connection]
$creadList :: ReadS [Connection]
readsPrec :: Int -> ReadS Connection
$creadsPrec :: Int -> ReadS Connection
Prelude.Read, Int -> Connection -> ShowS
[Connection] -> ShowS
Connection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Connection] -> ShowS
$cshowList :: [Connection] -> ShowS
show :: Connection -> String
$cshow :: Connection -> String
showsPrec :: Int -> Connection -> ShowS
$cshowsPrec :: Int -> Connection -> ShowS
Prelude.Show, forall x. Rep Connection x -> Connection
forall x. Connection -> Rep Connection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Connection x -> Connection
$cfrom :: forall x. Connection -> Rep Connection x
Prelude.Generic)
newConnection ::
Connection
newConnection :: Connection
newConnection =
Connection'
{ $sel:connectionArn:Connection' :: Maybe Text
connectionArn = forall a. Maybe a
Prelude.Nothing,
$sel:connectionName:Connection' :: Maybe Text
connectionName = forall a. Maybe a
Prelude.Nothing,
$sel:connectionStatus:Connection' :: Maybe ConnectionStatus
connectionStatus = forall a. Maybe a
Prelude.Nothing,
$sel:hostArn:Connection' :: Maybe Text
hostArn = forall a. Maybe a
Prelude.Nothing,
$sel:ownerAccountId:Connection' :: Maybe Text
ownerAccountId = forall a. Maybe a
Prelude.Nothing,
$sel:providerType:Connection' :: Maybe ProviderType
providerType = forall a. Maybe a
Prelude.Nothing
}
connection_connectionArn :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectionArn :: Lens' Connection (Maybe Text)
connection_connectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:Connection' :: Connection -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:connectionArn:Connection' :: Maybe Text
connectionArn = Maybe Text
a} :: Connection)
connection_connectionName :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectionName :: Lens' Connection (Maybe Text)
connection_connectionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
connectionName :: Maybe Text
$sel:connectionName:Connection' :: Connection -> Maybe Text
connectionName} -> Maybe Text
connectionName) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:connectionName:Connection' :: Maybe Text
connectionName = Maybe Text
a} :: Connection)
connection_connectionStatus :: Lens.Lens' Connection (Prelude.Maybe ConnectionStatus)
connection_connectionStatus :: Lens' Connection (Maybe ConnectionStatus)
connection_connectionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe ConnectionStatus
connectionStatus :: Maybe ConnectionStatus
$sel:connectionStatus:Connection' :: Connection -> Maybe ConnectionStatus
connectionStatus} -> Maybe ConnectionStatus
connectionStatus) (\s :: Connection
s@Connection' {} Maybe ConnectionStatus
a -> Connection
s {$sel:connectionStatus:Connection' :: Maybe ConnectionStatus
connectionStatus = Maybe ConnectionStatus
a} :: Connection)
connection_hostArn :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_hostArn :: Lens' Connection (Maybe Text)
connection_hostArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
hostArn :: Maybe Text
$sel:hostArn:Connection' :: Connection -> Maybe Text
hostArn} -> Maybe Text
hostArn) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:hostArn:Connection' :: Maybe Text
hostArn = Maybe Text
a} :: Connection)
connection_ownerAccountId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_ownerAccountId :: Lens' Connection (Maybe Text)
connection_ownerAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
ownerAccountId :: Maybe Text
$sel:ownerAccountId:Connection' :: Connection -> Maybe Text
ownerAccountId} -> Maybe Text
ownerAccountId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:ownerAccountId:Connection' :: Maybe Text
ownerAccountId = Maybe Text
a} :: Connection)
connection_providerType :: Lens.Lens' Connection (Prelude.Maybe ProviderType)
connection_providerType :: Lens' Connection (Maybe ProviderType)
connection_providerType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe ProviderType
providerType :: Maybe ProviderType
$sel:providerType:Connection' :: Connection -> Maybe ProviderType
providerType} -> Maybe ProviderType
providerType) (\s :: Connection
s@Connection' {} Maybe ProviderType
a -> Connection
s {$sel:providerType:Connection' :: Maybe ProviderType
providerType = Maybe ProviderType
a} :: Connection)
instance Data.FromJSON Connection where
parseJSON :: Value -> Parser Connection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Connection"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe ConnectionStatus
-> Maybe Text
-> Maybe Text
-> Maybe ProviderType
-> Connection
Connection'
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
"ConnectionArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConnectionName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConnectionStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HostArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OwnerAccountId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProviderType")
)
instance Prelude.Hashable Connection where
hashWithSalt :: Int -> Connection -> Int
hashWithSalt Int
_salt Connection' {Maybe Text
Maybe ConnectionStatus
Maybe ProviderType
providerType :: Maybe ProviderType
ownerAccountId :: Maybe Text
hostArn :: Maybe Text
connectionStatus :: Maybe ConnectionStatus
connectionName :: Maybe Text
connectionArn :: Maybe Text
$sel:providerType:Connection' :: Connection -> Maybe ProviderType
$sel:ownerAccountId:Connection' :: Connection -> Maybe Text
$sel:hostArn:Connection' :: Connection -> Maybe Text
$sel:connectionStatus:Connection' :: Connection -> Maybe ConnectionStatus
$sel:connectionName:Connection' :: Connection -> Maybe Text
$sel:connectionArn:Connection' :: Connection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConnectionStatus
connectionStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerAccountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProviderType
providerType
instance Prelude.NFData Connection where
rnf :: Connection -> ()
rnf Connection' {Maybe Text
Maybe ConnectionStatus
Maybe ProviderType
providerType :: Maybe ProviderType
ownerAccountId :: Maybe Text
hostArn :: Maybe Text
connectionStatus :: Maybe ConnectionStatus
connectionName :: Maybe Text
connectionArn :: Maybe Text
$sel:providerType:Connection' :: Connection -> Maybe ProviderType
$sel:ownerAccountId:Connection' :: Connection -> Maybe Text
$sel:hostArn:Connection' :: Connection -> Maybe Text
$sel:connectionStatus:Connection' :: Connection -> Maybe ConnectionStatus
$sel:connectionName:Connection' :: Connection -> Maybe Text
$sel:connectionArn:Connection' :: Connection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectionStatus
connectionStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAccountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProviderType
providerType