{-# 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.Host where
import Amazonka.CodeStarConnections.Types.ProviderType
import Amazonka.CodeStarConnections.Types.VpcConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Host = Host'
{
Host -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Host -> Maybe Text
providerEndpoint :: Prelude.Maybe Prelude.Text,
Host -> Maybe ProviderType
providerType :: Prelude.Maybe ProviderType,
Host -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
Host -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Host -> Maybe Text
hostArn :: Prelude.Maybe Prelude.Text,
Host -> Maybe VpcConfiguration
vpcConfiguration :: Prelude.Maybe VpcConfiguration
}
deriving (Host -> Host -> Bool
(Host -> Host -> Bool) -> (Host -> Host -> Bool) -> Eq Host
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Host -> Host -> Bool
$c/= :: Host -> Host -> Bool
== :: Host -> Host -> Bool
$c== :: Host -> Host -> Bool
Prelude.Eq, ReadPrec [Host]
ReadPrec Host
Int -> ReadS Host
ReadS [Host]
(Int -> ReadS Host)
-> ReadS [Host] -> ReadPrec Host -> ReadPrec [Host] -> Read Host
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Host]
$creadListPrec :: ReadPrec [Host]
readPrec :: ReadPrec Host
$creadPrec :: ReadPrec Host
readList :: ReadS [Host]
$creadList :: ReadS [Host]
readsPrec :: Int -> ReadS Host
$creadsPrec :: Int -> ReadS Host
Prelude.Read, Int -> Host -> ShowS
[Host] -> ShowS
Host -> String
(Int -> Host -> ShowS)
-> (Host -> String) -> ([Host] -> ShowS) -> Show Host
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Host] -> ShowS
$cshowList :: [Host] -> ShowS
show :: Host -> String
$cshow :: Host -> String
showsPrec :: Int -> Host -> ShowS
$cshowsPrec :: Int -> Host -> ShowS
Prelude.Show, (forall x. Host -> Rep Host x)
-> (forall x. Rep Host x -> Host) -> Generic Host
forall x. Rep Host x -> Host
forall x. Host -> Rep Host x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Host x -> Host
$cfrom :: forall x. Host -> Rep Host x
Prelude.Generic)
newHost ::
Host
newHost :: Host
newHost =
Host' :: Maybe Text
-> Maybe Text
-> Maybe ProviderType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> Host
Host'
{ $sel:status:Host' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:providerEndpoint:Host' :: Maybe Text
providerEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:providerType:Host' :: Maybe ProviderType
providerType = Maybe ProviderType
forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:Host' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Host' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hostArn:Host' :: Maybe Text
hostArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:vpcConfiguration:Host' :: Maybe VpcConfiguration
vpcConfiguration = Maybe VpcConfiguration
forall a. Maybe a
Prelude.Nothing
}
host_status :: Lens.Lens' Host (Prelude.Maybe Prelude.Text)
host_status :: (Maybe Text -> f (Maybe Text)) -> Host -> f Host
host_status = (Host -> Maybe Text)
-> (Host -> Maybe Text -> Host)
-> Lens Host Host (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Host' {Maybe Text
status :: Maybe Text
$sel:status:Host' :: Host -> Maybe Text
status} -> Maybe Text
status) (\s :: Host
s@Host' {} Maybe Text
a -> Host
s {$sel:status:Host' :: Maybe Text
status = Maybe Text
a} :: Host)
host_providerEndpoint :: Lens.Lens' Host (Prelude.Maybe Prelude.Text)
host_providerEndpoint :: (Maybe Text -> f (Maybe Text)) -> Host -> f Host
host_providerEndpoint = (Host -> Maybe Text)
-> (Host -> Maybe Text -> Host)
-> Lens Host Host (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Host' {Maybe Text
providerEndpoint :: Maybe Text
$sel:providerEndpoint:Host' :: Host -> Maybe Text
providerEndpoint} -> Maybe Text
providerEndpoint) (\s :: Host
s@Host' {} Maybe Text
a -> Host
s {$sel:providerEndpoint:Host' :: Maybe Text
providerEndpoint = Maybe Text
a} :: Host)
host_providerType :: Lens.Lens' Host (Prelude.Maybe ProviderType)
host_providerType :: (Maybe ProviderType -> f (Maybe ProviderType)) -> Host -> f Host
host_providerType = (Host -> Maybe ProviderType)
-> (Host -> Maybe ProviderType -> Host)
-> Lens Host Host (Maybe ProviderType) (Maybe ProviderType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Host' {Maybe ProviderType
providerType :: Maybe ProviderType
$sel:providerType:Host' :: Host -> Maybe ProviderType
providerType} -> Maybe ProviderType
providerType) (\s :: Host
s@Host' {} Maybe ProviderType
a -> Host
s {$sel:providerType:Host' :: Maybe ProviderType
providerType = Maybe ProviderType
a} :: Host)
host_statusMessage :: Lens.Lens' Host (Prelude.Maybe Prelude.Text)
host_statusMessage :: (Maybe Text -> f (Maybe Text)) -> Host -> f Host
host_statusMessage = (Host -> Maybe Text)
-> (Host -> Maybe Text -> Host)
-> Lens Host Host (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Host' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:Host' :: Host -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: Host
s@Host' {} Maybe Text
a -> Host
s {$sel:statusMessage:Host' :: Maybe Text
statusMessage = Maybe Text
a} :: Host)
host_name :: Lens.Lens' Host (Prelude.Maybe Prelude.Text)
host_name :: (Maybe Text -> f (Maybe Text)) -> Host -> f Host
host_name = (Host -> Maybe Text)
-> (Host -> Maybe Text -> Host)
-> Lens Host Host (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Host' {Maybe Text
name :: Maybe Text
$sel:name:Host' :: Host -> Maybe Text
name} -> Maybe Text
name) (\s :: Host
s@Host' {} Maybe Text
a -> Host
s {$sel:name:Host' :: Maybe Text
name = Maybe Text
a} :: Host)
host_hostArn :: Lens.Lens' Host (Prelude.Maybe Prelude.Text)
host_hostArn :: (Maybe Text -> f (Maybe Text)) -> Host -> f Host
host_hostArn = (Host -> Maybe Text)
-> (Host -> Maybe Text -> Host)
-> Lens Host Host (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Host' {Maybe Text
hostArn :: Maybe Text
$sel:hostArn:Host' :: Host -> Maybe Text
hostArn} -> Maybe Text
hostArn) (\s :: Host
s@Host' {} Maybe Text
a -> Host
s {$sel:hostArn:Host' :: Maybe Text
hostArn = Maybe Text
a} :: Host)
host_vpcConfiguration :: Lens.Lens' Host (Prelude.Maybe VpcConfiguration)
host_vpcConfiguration :: (Maybe VpcConfiguration -> f (Maybe VpcConfiguration))
-> Host -> f Host
host_vpcConfiguration = (Host -> Maybe VpcConfiguration)
-> (Host -> Maybe VpcConfiguration -> Host)
-> Lens Host Host (Maybe VpcConfiguration) (Maybe VpcConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Host' {Maybe VpcConfiguration
vpcConfiguration :: Maybe VpcConfiguration
$sel:vpcConfiguration:Host' :: Host -> Maybe VpcConfiguration
vpcConfiguration} -> Maybe VpcConfiguration
vpcConfiguration) (\s :: Host
s@Host' {} Maybe VpcConfiguration
a -> Host
s {$sel:vpcConfiguration:Host' :: Maybe VpcConfiguration
vpcConfiguration = Maybe VpcConfiguration
a} :: Host)
instance Core.FromJSON Host where
parseJSON :: Value -> Parser Host
parseJSON =
String -> (Object -> Parser Host) -> Value -> Parser Host
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Host"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe ProviderType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> Host
Host'
(Maybe Text
-> Maybe Text
-> Maybe ProviderType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> Host)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ProviderType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> Host)
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
"Status")
Parser
(Maybe Text
-> Maybe ProviderType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> Host)
-> Parser (Maybe Text)
-> Parser
(Maybe ProviderType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> Host)
forall (f :: * -> *) a b. Applicative f => 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
"ProviderEndpoint")
Parser
(Maybe ProviderType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> Host)
-> Parser (Maybe ProviderType)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe VpcConfiguration -> Host)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProviderType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProviderType")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe VpcConfiguration -> Host)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe VpcConfiguration -> Host)
forall (f :: * -> *) a b. Applicative f => 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
"StatusMessage")
Parser (Maybe Text -> Maybe Text -> Maybe VpcConfiguration -> Host)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe VpcConfiguration -> Host)
forall (f :: * -> *) a b. Applicative f => 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
"Name")
Parser (Maybe Text -> Maybe VpcConfiguration -> Host)
-> Parser (Maybe Text) -> Parser (Maybe VpcConfiguration -> Host)
forall (f :: * -> *) a b. Applicative f => 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
"HostArn")
Parser (Maybe VpcConfiguration -> Host)
-> Parser (Maybe VpcConfiguration) -> Parser Host
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VpcConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VpcConfiguration")
)
instance Prelude.Hashable Host
instance Prelude.NFData Host