{-# 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.EKS.Types.RemoteAccessConfig 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 RemoteAccessConfig = RemoteAccessConfig'
{
RemoteAccessConfig -> Maybe Text
ec2SshKey :: Prelude.Maybe Prelude.Text,
RemoteAccessConfig -> Maybe [Text]
sourceSecurityGroups :: Prelude.Maybe [Prelude.Text]
}
deriving (RemoteAccessConfig -> RemoteAccessConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoteAccessConfig -> RemoteAccessConfig -> Bool
$c/= :: RemoteAccessConfig -> RemoteAccessConfig -> Bool
== :: RemoteAccessConfig -> RemoteAccessConfig -> Bool
$c== :: RemoteAccessConfig -> RemoteAccessConfig -> Bool
Prelude.Eq, ReadPrec [RemoteAccessConfig]
ReadPrec RemoteAccessConfig
Int -> ReadS RemoteAccessConfig
ReadS [RemoteAccessConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoteAccessConfig]
$creadListPrec :: ReadPrec [RemoteAccessConfig]
readPrec :: ReadPrec RemoteAccessConfig
$creadPrec :: ReadPrec RemoteAccessConfig
readList :: ReadS [RemoteAccessConfig]
$creadList :: ReadS [RemoteAccessConfig]
readsPrec :: Int -> ReadS RemoteAccessConfig
$creadsPrec :: Int -> ReadS RemoteAccessConfig
Prelude.Read, Int -> RemoteAccessConfig -> ShowS
[RemoteAccessConfig] -> ShowS
RemoteAccessConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoteAccessConfig] -> ShowS
$cshowList :: [RemoteAccessConfig] -> ShowS
show :: RemoteAccessConfig -> String
$cshow :: RemoteAccessConfig -> String
showsPrec :: Int -> RemoteAccessConfig -> ShowS
$cshowsPrec :: Int -> RemoteAccessConfig -> ShowS
Prelude.Show, forall x. Rep RemoteAccessConfig x -> RemoteAccessConfig
forall x. RemoteAccessConfig -> Rep RemoteAccessConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoteAccessConfig x -> RemoteAccessConfig
$cfrom :: forall x. RemoteAccessConfig -> Rep RemoteAccessConfig x
Prelude.Generic)
newRemoteAccessConfig ::
RemoteAccessConfig
newRemoteAccessConfig :: RemoteAccessConfig
newRemoteAccessConfig =
RemoteAccessConfig'
{ $sel:ec2SshKey:RemoteAccessConfig' :: Maybe Text
ec2SshKey = forall a. Maybe a
Prelude.Nothing,
$sel:sourceSecurityGroups:RemoteAccessConfig' :: Maybe [Text]
sourceSecurityGroups = forall a. Maybe a
Prelude.Nothing
}
remoteAccessConfig_ec2SshKey :: Lens.Lens' RemoteAccessConfig (Prelude.Maybe Prelude.Text)
remoteAccessConfig_ec2SshKey :: Lens' RemoteAccessConfig (Maybe Text)
remoteAccessConfig_ec2SshKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoteAccessConfig' {Maybe Text
ec2SshKey :: Maybe Text
$sel:ec2SshKey:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe Text
ec2SshKey} -> Maybe Text
ec2SshKey) (\s :: RemoteAccessConfig
s@RemoteAccessConfig' {} Maybe Text
a -> RemoteAccessConfig
s {$sel:ec2SshKey:RemoteAccessConfig' :: Maybe Text
ec2SshKey = Maybe Text
a} :: RemoteAccessConfig)
remoteAccessConfig_sourceSecurityGroups :: Lens.Lens' RemoteAccessConfig (Prelude.Maybe [Prelude.Text])
remoteAccessConfig_sourceSecurityGroups :: Lens' RemoteAccessConfig (Maybe [Text])
remoteAccessConfig_sourceSecurityGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoteAccessConfig' {Maybe [Text]
sourceSecurityGroups :: Maybe [Text]
$sel:sourceSecurityGroups:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe [Text]
sourceSecurityGroups} -> Maybe [Text]
sourceSecurityGroups) (\s :: RemoteAccessConfig
s@RemoteAccessConfig' {} Maybe [Text]
a -> RemoteAccessConfig
s {$sel:sourceSecurityGroups:RemoteAccessConfig' :: Maybe [Text]
sourceSecurityGroups = Maybe [Text]
a} :: RemoteAccessConfig) 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
instance Data.FromJSON RemoteAccessConfig where
parseJSON :: Value -> Parser RemoteAccessConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RemoteAccessConfig"
( \Object
x ->
Maybe Text -> Maybe [Text] -> RemoteAccessConfig
RemoteAccessConfig'
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
"ec2SshKey")
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
"sourceSecurityGroups"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable RemoteAccessConfig where
hashWithSalt :: Int -> RemoteAccessConfig -> Int
hashWithSalt Int
_salt RemoteAccessConfig' {Maybe [Text]
Maybe Text
sourceSecurityGroups :: Maybe [Text]
ec2SshKey :: Maybe Text
$sel:sourceSecurityGroups:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe [Text]
$sel:ec2SshKey:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ec2SshKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
sourceSecurityGroups
instance Prelude.NFData RemoteAccessConfig where
rnf :: RemoteAccessConfig -> ()
rnf RemoteAccessConfig' {Maybe [Text]
Maybe Text
sourceSecurityGroups :: Maybe [Text]
ec2SshKey :: Maybe Text
$sel:sourceSecurityGroups:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe [Text]
$sel:ec2SshKey:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ec2SshKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
sourceSecurityGroups
instance Data.ToJSON RemoteAccessConfig where
toJSON :: RemoteAccessConfig -> Value
toJSON RemoteAccessConfig' {Maybe [Text]
Maybe Text
sourceSecurityGroups :: Maybe [Text]
ec2SshKey :: Maybe Text
$sel:sourceSecurityGroups:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe [Text]
$sel:ec2SshKey:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ec2SshKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ec2SshKey,
(Key
"sourceSecurityGroups" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
sourceSecurityGroups
]
)