{-# 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.WorkSpacesWeb.Types.NetworkSettings 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
data NetworkSettings = NetworkSettings'
{
NetworkSettings -> Maybe [Text]
associatedPortalArns :: Prelude.Maybe [Prelude.Text],
NetworkSettings -> Maybe (NonEmpty Text)
securityGroupIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
NetworkSettings -> Maybe (NonEmpty Text)
subnetIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
NetworkSettings -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
NetworkSettings -> Text
networkSettingsArn :: Prelude.Text
}
deriving (NetworkSettings -> NetworkSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkSettings -> NetworkSettings -> Bool
$c/= :: NetworkSettings -> NetworkSettings -> Bool
== :: NetworkSettings -> NetworkSettings -> Bool
$c== :: NetworkSettings -> NetworkSettings -> Bool
Prelude.Eq, ReadPrec [NetworkSettings]
ReadPrec NetworkSettings
Int -> ReadS NetworkSettings
ReadS [NetworkSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkSettings]
$creadListPrec :: ReadPrec [NetworkSettings]
readPrec :: ReadPrec NetworkSettings
$creadPrec :: ReadPrec NetworkSettings
readList :: ReadS [NetworkSettings]
$creadList :: ReadS [NetworkSettings]
readsPrec :: Int -> ReadS NetworkSettings
$creadsPrec :: Int -> ReadS NetworkSettings
Prelude.Read, Int -> NetworkSettings -> ShowS
[NetworkSettings] -> ShowS
NetworkSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkSettings] -> ShowS
$cshowList :: [NetworkSettings] -> ShowS
show :: NetworkSettings -> String
$cshow :: NetworkSettings -> String
showsPrec :: Int -> NetworkSettings -> ShowS
$cshowsPrec :: Int -> NetworkSettings -> ShowS
Prelude.Show, forall x. Rep NetworkSettings x -> NetworkSettings
forall x. NetworkSettings -> Rep NetworkSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkSettings x -> NetworkSettings
$cfrom :: forall x. NetworkSettings -> Rep NetworkSettings x
Prelude.Generic)
newNetworkSettings ::
Prelude.Text ->
NetworkSettings
newNetworkSettings :: Text -> NetworkSettings
newNetworkSettings Text
pNetworkSettingsArn_ =
NetworkSettings'
{ $sel:associatedPortalArns:NetworkSettings' :: Maybe [Text]
associatedPortalArns =
forall a. Maybe a
Prelude.Nothing,
$sel:securityGroupIds:NetworkSettings' :: Maybe (NonEmpty Text)
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
$sel:subnetIds:NetworkSettings' :: Maybe (NonEmpty Text)
subnetIds = forall a. Maybe a
Prelude.Nothing,
$sel:vpcId:NetworkSettings' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing,
$sel:networkSettingsArn:NetworkSettings' :: Text
networkSettingsArn = Text
pNetworkSettingsArn_
}
networkSettings_associatedPortalArns :: Lens.Lens' NetworkSettings (Prelude.Maybe [Prelude.Text])
networkSettings_associatedPortalArns :: Lens' NetworkSettings (Maybe [Text])
networkSettings_associatedPortalArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSettings' {Maybe [Text]
associatedPortalArns :: Maybe [Text]
$sel:associatedPortalArns:NetworkSettings' :: NetworkSettings -> Maybe [Text]
associatedPortalArns} -> Maybe [Text]
associatedPortalArns) (\s :: NetworkSettings
s@NetworkSettings' {} Maybe [Text]
a -> NetworkSettings
s {$sel:associatedPortalArns:NetworkSettings' :: Maybe [Text]
associatedPortalArns = Maybe [Text]
a} :: NetworkSettings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
networkSettings_securityGroupIds :: Lens.Lens' NetworkSettings (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
networkSettings_securityGroupIds :: Lens' NetworkSettings (Maybe (NonEmpty Text))
networkSettings_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSettings' {Maybe (NonEmpty Text)
securityGroupIds :: Maybe (NonEmpty Text)
$sel:securityGroupIds:NetworkSettings' :: NetworkSettings -> Maybe (NonEmpty Text)
securityGroupIds} -> Maybe (NonEmpty Text)
securityGroupIds) (\s :: NetworkSettings
s@NetworkSettings' {} Maybe (NonEmpty Text)
a -> NetworkSettings
s {$sel:securityGroupIds:NetworkSettings' :: Maybe (NonEmpty Text)
securityGroupIds = Maybe (NonEmpty Text)
a} :: NetworkSettings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
networkSettings_subnetIds :: Lens.Lens' NetworkSettings (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
networkSettings_subnetIds :: Lens' NetworkSettings (Maybe (NonEmpty Text))
networkSettings_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSettings' {Maybe (NonEmpty Text)
subnetIds :: Maybe (NonEmpty Text)
$sel:subnetIds:NetworkSettings' :: NetworkSettings -> Maybe (NonEmpty Text)
subnetIds} -> Maybe (NonEmpty Text)
subnetIds) (\s :: NetworkSettings
s@NetworkSettings' {} Maybe (NonEmpty Text)
a -> NetworkSettings
s {$sel:subnetIds:NetworkSettings' :: Maybe (NonEmpty Text)
subnetIds = Maybe (NonEmpty Text)
a} :: NetworkSettings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
networkSettings_vpcId :: Lens.Lens' NetworkSettings (Prelude.Maybe Prelude.Text)
networkSettings_vpcId :: Lens' NetworkSettings (Maybe Text)
networkSettings_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSettings' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:NetworkSettings' :: NetworkSettings -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: NetworkSettings
s@NetworkSettings' {} Maybe Text
a -> NetworkSettings
s {$sel:vpcId:NetworkSettings' :: Maybe Text
vpcId = Maybe Text
a} :: NetworkSettings)
networkSettings_networkSettingsArn :: Lens.Lens' NetworkSettings Prelude.Text
networkSettings_networkSettingsArn :: Lens' NetworkSettings Text
networkSettings_networkSettingsArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSettings' {Text
networkSettingsArn :: Text
$sel:networkSettingsArn:NetworkSettings' :: NetworkSettings -> Text
networkSettingsArn} -> Text
networkSettingsArn) (\s :: NetworkSettings
s@NetworkSettings' {} Text
a -> NetworkSettings
s {$sel:networkSettingsArn:NetworkSettings' :: Text
networkSettingsArn = Text
a} :: NetworkSettings)
instance Data.FromJSON NetworkSettings where
parseJSON :: Value -> Parser NetworkSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NetworkSettings"
( \Object
x ->
Maybe [Text]
-> Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Text
-> NetworkSettings
NetworkSettings'
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
"associatedPortalArns"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"securityGroupIds")
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
"subnetIds")
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
"vpcId")
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
"networkSettingsArn")
)
instance Prelude.Hashable NetworkSettings where
hashWithSalt :: Int -> NetworkSettings -> Int
hashWithSalt Int
_salt NetworkSettings' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe Text
Text
networkSettingsArn :: Text
vpcId :: Maybe Text
subnetIds :: Maybe (NonEmpty Text)
securityGroupIds :: Maybe (NonEmpty Text)
associatedPortalArns :: Maybe [Text]
$sel:networkSettingsArn:NetworkSettings' :: NetworkSettings -> Text
$sel:vpcId:NetworkSettings' :: NetworkSettings -> Maybe Text
$sel:subnetIds:NetworkSettings' :: NetworkSettings -> Maybe (NonEmpty Text)
$sel:securityGroupIds:NetworkSettings' :: NetworkSettings -> Maybe (NonEmpty Text)
$sel:associatedPortalArns:NetworkSettings' :: NetworkSettings -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
associatedPortalArns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
securityGroupIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
subnetIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkSettingsArn
instance Prelude.NFData NetworkSettings where
rnf :: NetworkSettings -> ()
rnf NetworkSettings' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe Text
Text
networkSettingsArn :: Text
vpcId :: Maybe Text
subnetIds :: Maybe (NonEmpty Text)
securityGroupIds :: Maybe (NonEmpty Text)
associatedPortalArns :: Maybe [Text]
$sel:networkSettingsArn:NetworkSettings' :: NetworkSettings -> Text
$sel:vpcId:NetworkSettings' :: NetworkSettings -> Maybe Text
$sel:subnetIds:NetworkSettings' :: NetworkSettings -> Maybe (NonEmpty Text)
$sel:securityGroupIds:NetworkSettings' :: NetworkSettings -> Maybe (NonEmpty Text)
$sel:associatedPortalArns:NetworkSettings' :: NetworkSettings -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
associatedPortalArns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
securityGroupIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
subnetIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkSettingsArn