{-# 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.GameLift.Types.InstanceAccess where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.InstanceCredentials
import Amazonka.GameLift.Types.OperatingSystem
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceAccess = InstanceAccess'
{
InstanceAccess -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
InstanceAccess -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
InstanceAccess -> Maybe OperatingSystem
operatingSystem :: Prelude.Maybe OperatingSystem,
InstanceAccess -> Maybe (Sensitive InstanceCredentials)
credentials :: Prelude.Maybe (Core.Sensitive InstanceCredentials),
InstanceAccess -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text
}
deriving (InstanceAccess -> InstanceAccess -> Bool
(InstanceAccess -> InstanceAccess -> Bool)
-> (InstanceAccess -> InstanceAccess -> Bool) -> Eq InstanceAccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceAccess -> InstanceAccess -> Bool
$c/= :: InstanceAccess -> InstanceAccess -> Bool
== :: InstanceAccess -> InstanceAccess -> Bool
$c== :: InstanceAccess -> InstanceAccess -> Bool
Prelude.Eq, Int -> InstanceAccess -> ShowS
[InstanceAccess] -> ShowS
InstanceAccess -> String
(Int -> InstanceAccess -> ShowS)
-> (InstanceAccess -> String)
-> ([InstanceAccess] -> ShowS)
-> Show InstanceAccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceAccess] -> ShowS
$cshowList :: [InstanceAccess] -> ShowS
show :: InstanceAccess -> String
$cshow :: InstanceAccess -> String
showsPrec :: Int -> InstanceAccess -> ShowS
$cshowsPrec :: Int -> InstanceAccess -> ShowS
Prelude.Show, (forall x. InstanceAccess -> Rep InstanceAccess x)
-> (forall x. Rep InstanceAccess x -> InstanceAccess)
-> Generic InstanceAccess
forall x. Rep InstanceAccess x -> InstanceAccess
forall x. InstanceAccess -> Rep InstanceAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceAccess x -> InstanceAccess
$cfrom :: forall x. InstanceAccess -> Rep InstanceAccess x
Prelude.Generic)
newInstanceAccess ::
InstanceAccess
newInstanceAccess :: InstanceAccess
newInstanceAccess =
InstanceAccess' :: Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe (Sensitive InstanceCredentials)
-> Maybe Text
-> InstanceAccess
InstanceAccess'
{ $sel:instanceId:InstanceAccess' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ipAddress:InstanceAccess' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:operatingSystem:InstanceAccess' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
forall a. Maybe a
Prelude.Nothing,
$sel:credentials:InstanceAccess' :: Maybe (Sensitive InstanceCredentials)
credentials = Maybe (Sensitive InstanceCredentials)
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:InstanceAccess' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instanceAccess_instanceId :: Lens.Lens' InstanceAccess (Prelude.Maybe Prelude.Text)
instanceAccess_instanceId :: (Maybe Text -> f (Maybe Text))
-> InstanceAccess -> f InstanceAccess
instanceAccess_instanceId = (InstanceAccess -> Maybe Text)
-> (InstanceAccess -> Maybe Text -> InstanceAccess)
-> Lens InstanceAccess InstanceAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccess' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:InstanceAccess' :: InstanceAccess -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: InstanceAccess
s@InstanceAccess' {} Maybe Text
a -> InstanceAccess
s {$sel:instanceId:InstanceAccess' :: Maybe Text
instanceId = Maybe Text
a} :: InstanceAccess)
instanceAccess_ipAddress :: Lens.Lens' InstanceAccess (Prelude.Maybe Prelude.Text)
instanceAccess_ipAddress :: (Maybe Text -> f (Maybe Text))
-> InstanceAccess -> f InstanceAccess
instanceAccess_ipAddress = (InstanceAccess -> Maybe Text)
-> (InstanceAccess -> Maybe Text -> InstanceAccess)
-> Lens InstanceAccess InstanceAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccess' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:InstanceAccess' :: InstanceAccess -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: InstanceAccess
s@InstanceAccess' {} Maybe Text
a -> InstanceAccess
s {$sel:ipAddress:InstanceAccess' :: Maybe Text
ipAddress = Maybe Text
a} :: InstanceAccess)
instanceAccess_operatingSystem :: Lens.Lens' InstanceAccess (Prelude.Maybe OperatingSystem)
instanceAccess_operatingSystem :: (Maybe OperatingSystem -> f (Maybe OperatingSystem))
-> InstanceAccess -> f InstanceAccess
instanceAccess_operatingSystem = (InstanceAccess -> Maybe OperatingSystem)
-> (InstanceAccess -> Maybe OperatingSystem -> InstanceAccess)
-> Lens
InstanceAccess
InstanceAccess
(Maybe OperatingSystem)
(Maybe OperatingSystem)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccess' {Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
$sel:operatingSystem:InstanceAccess' :: InstanceAccess -> Maybe OperatingSystem
operatingSystem} -> Maybe OperatingSystem
operatingSystem) (\s :: InstanceAccess
s@InstanceAccess' {} Maybe OperatingSystem
a -> InstanceAccess
s {$sel:operatingSystem:InstanceAccess' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
a} :: InstanceAccess)
instanceAccess_credentials :: Lens.Lens' InstanceAccess (Prelude.Maybe InstanceCredentials)
instanceAccess_credentials :: (Maybe InstanceCredentials -> f (Maybe InstanceCredentials))
-> InstanceAccess -> f InstanceAccess
instanceAccess_credentials = (InstanceAccess -> Maybe (Sensitive InstanceCredentials))
-> (InstanceAccess
-> Maybe (Sensitive InstanceCredentials) -> InstanceAccess)
-> Lens
InstanceAccess
InstanceAccess
(Maybe (Sensitive InstanceCredentials))
(Maybe (Sensitive InstanceCredentials))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccess' {Maybe (Sensitive InstanceCredentials)
credentials :: Maybe (Sensitive InstanceCredentials)
$sel:credentials:InstanceAccess' :: InstanceAccess -> Maybe (Sensitive InstanceCredentials)
credentials} -> Maybe (Sensitive InstanceCredentials)
credentials) (\s :: InstanceAccess
s@InstanceAccess' {} Maybe (Sensitive InstanceCredentials)
a -> InstanceAccess
s {$sel:credentials:InstanceAccess' :: Maybe (Sensitive InstanceCredentials)
credentials = Maybe (Sensitive InstanceCredentials)
a} :: InstanceAccess) ((Maybe (Sensitive InstanceCredentials)
-> f (Maybe (Sensitive InstanceCredentials)))
-> InstanceAccess -> f InstanceAccess)
-> ((Maybe InstanceCredentials -> f (Maybe InstanceCredentials))
-> Maybe (Sensitive InstanceCredentials)
-> f (Maybe (Sensitive InstanceCredentials)))
-> (Maybe InstanceCredentials -> f (Maybe InstanceCredentials))
-> InstanceAccess
-> f InstanceAccess
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive InstanceCredentials)
(Sensitive InstanceCredentials)
InstanceCredentials
InstanceCredentials
-> Iso
(Maybe (Sensitive InstanceCredentials))
(Maybe (Sensitive InstanceCredentials))
(Maybe InstanceCredentials)
(Maybe InstanceCredentials)
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
(Sensitive InstanceCredentials)
(Sensitive InstanceCredentials)
InstanceCredentials
InstanceCredentials
forall a. Iso' (Sensitive a) a
Core._Sensitive
instanceAccess_fleetId :: Lens.Lens' InstanceAccess (Prelude.Maybe Prelude.Text)
instanceAccess_fleetId :: (Maybe Text -> f (Maybe Text))
-> InstanceAccess -> f InstanceAccess
instanceAccess_fleetId = (InstanceAccess -> Maybe Text)
-> (InstanceAccess -> Maybe Text -> InstanceAccess)
-> Lens InstanceAccess InstanceAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccess' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:InstanceAccess' :: InstanceAccess -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: InstanceAccess
s@InstanceAccess' {} Maybe Text
a -> InstanceAccess
s {$sel:fleetId:InstanceAccess' :: Maybe Text
fleetId = Maybe Text
a} :: InstanceAccess)
instance Core.FromJSON InstanceAccess where
parseJSON :: Value -> Parser InstanceAccess
parseJSON =
String
-> (Object -> Parser InstanceAccess)
-> Value
-> Parser InstanceAccess
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceAccess"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe (Sensitive InstanceCredentials)
-> Maybe Text
-> InstanceAccess
InstanceAccess'
(Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe (Sensitive InstanceCredentials)
-> Maybe Text
-> InstanceAccess)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe OperatingSystem
-> Maybe (Sensitive InstanceCredentials)
-> Maybe Text
-> InstanceAccess)
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
"InstanceId")
Parser
(Maybe Text
-> Maybe OperatingSystem
-> Maybe (Sensitive InstanceCredentials)
-> Maybe Text
-> InstanceAccess)
-> Parser (Maybe Text)
-> Parser
(Maybe OperatingSystem
-> Maybe (Sensitive InstanceCredentials)
-> Maybe Text
-> InstanceAccess)
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
"IpAddress")
Parser
(Maybe OperatingSystem
-> Maybe (Sensitive InstanceCredentials)
-> Maybe Text
-> InstanceAccess)
-> Parser (Maybe OperatingSystem)
-> Parser
(Maybe (Sensitive InstanceCredentials)
-> Maybe Text -> InstanceAccess)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OperatingSystem)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OperatingSystem")
Parser
(Maybe (Sensitive InstanceCredentials)
-> Maybe Text -> InstanceAccess)
-> Parser (Maybe (Sensitive InstanceCredentials))
-> Parser (Maybe Text -> InstanceAccess)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive InstanceCredentials))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Credentials")
Parser (Maybe Text -> InstanceAccess)
-> Parser (Maybe Text) -> Parser InstanceAccess
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
"FleetId")
)
instance Prelude.Hashable InstanceAccess
instance Prelude.NFData InstanceAccess