{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RemoteAccessConfig = RemoteAccessConfig'
{
RemoteAccessConfig -> Maybe [Text]
sourceSecurityGroups :: Prelude.Maybe [Prelude.Text],
RemoteAccessConfig -> Maybe Text
ec2SshKey :: Prelude.Maybe Prelude.Text
}
deriving (RemoteAccessConfig -> RemoteAccessConfig -> Bool
(RemoteAccessConfig -> RemoteAccessConfig -> Bool)
-> (RemoteAccessConfig -> RemoteAccessConfig -> Bool)
-> Eq RemoteAccessConfig
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]
(Int -> ReadS RemoteAccessConfig)
-> ReadS [RemoteAccessConfig]
-> ReadPrec RemoteAccessConfig
-> ReadPrec [RemoteAccessConfig]
-> Read 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
(Int -> RemoteAccessConfig -> ShowS)
-> (RemoteAccessConfig -> String)
-> ([RemoteAccessConfig] -> ShowS)
-> Show RemoteAccessConfig
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. RemoteAccessConfig -> Rep RemoteAccessConfig x)
-> (forall x. Rep RemoteAccessConfig x -> RemoteAccessConfig)
-> Generic RemoteAccessConfig
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' :: Maybe [Text] -> Maybe Text -> RemoteAccessConfig
RemoteAccessConfig'
{ $sel:sourceSecurityGroups:RemoteAccessConfig' :: Maybe [Text]
sourceSecurityGroups =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:ec2SshKey:RemoteAccessConfig' :: Maybe Text
ec2SshKey = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
remoteAccessConfig_sourceSecurityGroups :: Lens.Lens' RemoteAccessConfig (Prelude.Maybe [Prelude.Text])
remoteAccessConfig_sourceSecurityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> RemoteAccessConfig -> f RemoteAccessConfig
remoteAccessConfig_sourceSecurityGroups = (RemoteAccessConfig -> Maybe [Text])
-> (RemoteAccessConfig -> Maybe [Text] -> RemoteAccessConfig)
-> Lens
RemoteAccessConfig RemoteAccessConfig (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
-> RemoteAccessConfig -> f RemoteAccessConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> RemoteAccessConfig
-> f RemoteAccessConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
remoteAccessConfig_ec2SshKey :: Lens.Lens' RemoteAccessConfig (Prelude.Maybe Prelude.Text)
remoteAccessConfig_ec2SshKey :: (Maybe Text -> f (Maybe Text))
-> RemoteAccessConfig -> f RemoteAccessConfig
remoteAccessConfig_ec2SshKey = (RemoteAccessConfig -> Maybe Text)
-> (RemoteAccessConfig -> Maybe Text -> RemoteAccessConfig)
-> Lens
RemoteAccessConfig RemoteAccessConfig (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON RemoteAccessConfig where
parseJSON :: Value -> Parser RemoteAccessConfig
parseJSON =
String
-> (Object -> Parser RemoteAccessConfig)
-> Value
-> Parser RemoteAccessConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RemoteAccessConfig"
( \Object
x ->
Maybe [Text] -> Maybe Text -> RemoteAccessConfig
RemoteAccessConfig'
(Maybe [Text] -> Maybe Text -> RemoteAccessConfig)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> RemoteAccessConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceSecurityGroups"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> RemoteAccessConfig)
-> Parser (Maybe Text) -> Parser RemoteAccessConfig
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
"ec2SshKey")
)
instance Prelude.Hashable RemoteAccessConfig
instance Prelude.NFData RemoteAccessConfig
instance Core.ToJSON RemoteAccessConfig where
toJSON :: RemoteAccessConfig -> Value
toJSON RemoteAccessConfig' {Maybe [Text]
Maybe Text
ec2SshKey :: Maybe Text
sourceSecurityGroups :: Maybe [Text]
$sel:ec2SshKey:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe Text
$sel:sourceSecurityGroups:RemoteAccessConfig' :: RemoteAccessConfig -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"sourceSecurityGroups" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
sourceSecurityGroups,
(Text
"ec2SshKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ec2SshKey
]
)