{-# 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.StorageGateway.Types.GatewayInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GatewayInfo = GatewayInfo'
{
GatewayInfo -> Maybe Text
ec2InstanceRegion :: Prelude.Maybe Prelude.Text,
GatewayInfo -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
GatewayInfo -> Maybe Text
ec2InstanceId :: Prelude.Maybe Prelude.Text,
GatewayInfo -> Maybe Text
gatewayOperationalState :: Prelude.Maybe Prelude.Text,
GatewayInfo -> Maybe Text
gatewayName :: Prelude.Maybe Prelude.Text,
GatewayInfo -> Maybe Text
gatewayId :: Prelude.Maybe Prelude.Text,
GatewayInfo -> Maybe Text
gatewayType :: Prelude.Maybe Prelude.Text
}
deriving (GatewayInfo -> GatewayInfo -> Bool
(GatewayInfo -> GatewayInfo -> Bool)
-> (GatewayInfo -> GatewayInfo -> Bool) -> Eq GatewayInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewayInfo -> GatewayInfo -> Bool
$c/= :: GatewayInfo -> GatewayInfo -> Bool
== :: GatewayInfo -> GatewayInfo -> Bool
$c== :: GatewayInfo -> GatewayInfo -> Bool
Prelude.Eq, ReadPrec [GatewayInfo]
ReadPrec GatewayInfo
Int -> ReadS GatewayInfo
ReadS [GatewayInfo]
(Int -> ReadS GatewayInfo)
-> ReadS [GatewayInfo]
-> ReadPrec GatewayInfo
-> ReadPrec [GatewayInfo]
-> Read GatewayInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewayInfo]
$creadListPrec :: ReadPrec [GatewayInfo]
readPrec :: ReadPrec GatewayInfo
$creadPrec :: ReadPrec GatewayInfo
readList :: ReadS [GatewayInfo]
$creadList :: ReadS [GatewayInfo]
readsPrec :: Int -> ReadS GatewayInfo
$creadsPrec :: Int -> ReadS GatewayInfo
Prelude.Read, Int -> GatewayInfo -> ShowS
[GatewayInfo] -> ShowS
GatewayInfo -> String
(Int -> GatewayInfo -> ShowS)
-> (GatewayInfo -> String)
-> ([GatewayInfo] -> ShowS)
-> Show GatewayInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewayInfo] -> ShowS
$cshowList :: [GatewayInfo] -> ShowS
show :: GatewayInfo -> String
$cshow :: GatewayInfo -> String
showsPrec :: Int -> GatewayInfo -> ShowS
$cshowsPrec :: Int -> GatewayInfo -> ShowS
Prelude.Show, (forall x. GatewayInfo -> Rep GatewayInfo x)
-> (forall x. Rep GatewayInfo x -> GatewayInfo)
-> Generic GatewayInfo
forall x. Rep GatewayInfo x -> GatewayInfo
forall x. GatewayInfo -> Rep GatewayInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatewayInfo x -> GatewayInfo
$cfrom :: forall x. GatewayInfo -> Rep GatewayInfo x
Prelude.Generic)
newGatewayInfo ::
GatewayInfo
newGatewayInfo :: GatewayInfo
newGatewayInfo =
GatewayInfo' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewayInfo
GatewayInfo'
{ $sel:ec2InstanceRegion:GatewayInfo' :: Maybe Text
ec2InstanceRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayARN:GatewayInfo' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ec2InstanceId:GatewayInfo' :: Maybe Text
ec2InstanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayOperationalState:GatewayInfo' :: Maybe Text
gatewayOperationalState = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayName:GatewayInfo' :: Maybe Text
gatewayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayId:GatewayInfo' :: Maybe Text
gatewayId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayType:GatewayInfo' :: Maybe Text
gatewayType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
gatewayInfo_ec2InstanceRegion :: Lens.Lens' GatewayInfo (Prelude.Maybe Prelude.Text)
gatewayInfo_ec2InstanceRegion :: (Maybe Text -> f (Maybe Text)) -> GatewayInfo -> f GatewayInfo
gatewayInfo_ec2InstanceRegion = (GatewayInfo -> Maybe Text)
-> (GatewayInfo -> Maybe Text -> GatewayInfo)
-> Lens GatewayInfo GatewayInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayInfo' {Maybe Text
ec2InstanceRegion :: Maybe Text
$sel:ec2InstanceRegion:GatewayInfo' :: GatewayInfo -> Maybe Text
ec2InstanceRegion} -> Maybe Text
ec2InstanceRegion) (\s :: GatewayInfo
s@GatewayInfo' {} Maybe Text
a -> GatewayInfo
s {$sel:ec2InstanceRegion:GatewayInfo' :: Maybe Text
ec2InstanceRegion = Maybe Text
a} :: GatewayInfo)
gatewayInfo_gatewayARN :: Lens.Lens' GatewayInfo (Prelude.Maybe Prelude.Text)
gatewayInfo_gatewayARN :: (Maybe Text -> f (Maybe Text)) -> GatewayInfo -> f GatewayInfo
gatewayInfo_gatewayARN = (GatewayInfo -> Maybe Text)
-> (GatewayInfo -> Maybe Text -> GatewayInfo)
-> Lens GatewayInfo GatewayInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayInfo' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:GatewayInfo' :: GatewayInfo -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: GatewayInfo
s@GatewayInfo' {} Maybe Text
a -> GatewayInfo
s {$sel:gatewayARN:GatewayInfo' :: Maybe Text
gatewayARN = Maybe Text
a} :: GatewayInfo)
gatewayInfo_ec2InstanceId :: Lens.Lens' GatewayInfo (Prelude.Maybe Prelude.Text)
gatewayInfo_ec2InstanceId :: (Maybe Text -> f (Maybe Text)) -> GatewayInfo -> f GatewayInfo
gatewayInfo_ec2InstanceId = (GatewayInfo -> Maybe Text)
-> (GatewayInfo -> Maybe Text -> GatewayInfo)
-> Lens GatewayInfo GatewayInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayInfo' {Maybe Text
ec2InstanceId :: Maybe Text
$sel:ec2InstanceId:GatewayInfo' :: GatewayInfo -> Maybe Text
ec2InstanceId} -> Maybe Text
ec2InstanceId) (\s :: GatewayInfo
s@GatewayInfo' {} Maybe Text
a -> GatewayInfo
s {$sel:ec2InstanceId:GatewayInfo' :: Maybe Text
ec2InstanceId = Maybe Text
a} :: GatewayInfo)
gatewayInfo_gatewayOperationalState :: Lens.Lens' GatewayInfo (Prelude.Maybe Prelude.Text)
gatewayInfo_gatewayOperationalState :: (Maybe Text -> f (Maybe Text)) -> GatewayInfo -> f GatewayInfo
gatewayInfo_gatewayOperationalState = (GatewayInfo -> Maybe Text)
-> (GatewayInfo -> Maybe Text -> GatewayInfo)
-> Lens GatewayInfo GatewayInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayInfo' {Maybe Text
gatewayOperationalState :: Maybe Text
$sel:gatewayOperationalState:GatewayInfo' :: GatewayInfo -> Maybe Text
gatewayOperationalState} -> Maybe Text
gatewayOperationalState) (\s :: GatewayInfo
s@GatewayInfo' {} Maybe Text
a -> GatewayInfo
s {$sel:gatewayOperationalState:GatewayInfo' :: Maybe Text
gatewayOperationalState = Maybe Text
a} :: GatewayInfo)
gatewayInfo_gatewayName :: Lens.Lens' GatewayInfo (Prelude.Maybe Prelude.Text)
gatewayInfo_gatewayName :: (Maybe Text -> f (Maybe Text)) -> GatewayInfo -> f GatewayInfo
gatewayInfo_gatewayName = (GatewayInfo -> Maybe Text)
-> (GatewayInfo -> Maybe Text -> GatewayInfo)
-> Lens GatewayInfo GatewayInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayInfo' {Maybe Text
gatewayName :: Maybe Text
$sel:gatewayName:GatewayInfo' :: GatewayInfo -> Maybe Text
gatewayName} -> Maybe Text
gatewayName) (\s :: GatewayInfo
s@GatewayInfo' {} Maybe Text
a -> GatewayInfo
s {$sel:gatewayName:GatewayInfo' :: Maybe Text
gatewayName = Maybe Text
a} :: GatewayInfo)
gatewayInfo_gatewayId :: Lens.Lens' GatewayInfo (Prelude.Maybe Prelude.Text)
gatewayInfo_gatewayId :: (Maybe Text -> f (Maybe Text)) -> GatewayInfo -> f GatewayInfo
gatewayInfo_gatewayId = (GatewayInfo -> Maybe Text)
-> (GatewayInfo -> Maybe Text -> GatewayInfo)
-> Lens GatewayInfo GatewayInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayInfo' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:GatewayInfo' :: GatewayInfo -> Maybe Text
gatewayId} -> Maybe Text
gatewayId) (\s :: GatewayInfo
s@GatewayInfo' {} Maybe Text
a -> GatewayInfo
s {$sel:gatewayId:GatewayInfo' :: Maybe Text
gatewayId = Maybe Text
a} :: GatewayInfo)
gatewayInfo_gatewayType :: Lens.Lens' GatewayInfo (Prelude.Maybe Prelude.Text)
gatewayInfo_gatewayType :: (Maybe Text -> f (Maybe Text)) -> GatewayInfo -> f GatewayInfo
gatewayInfo_gatewayType = (GatewayInfo -> Maybe Text)
-> (GatewayInfo -> Maybe Text -> GatewayInfo)
-> Lens GatewayInfo GatewayInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayInfo' {Maybe Text
gatewayType :: Maybe Text
$sel:gatewayType:GatewayInfo' :: GatewayInfo -> Maybe Text
gatewayType} -> Maybe Text
gatewayType) (\s :: GatewayInfo
s@GatewayInfo' {} Maybe Text
a -> GatewayInfo
s {$sel:gatewayType:GatewayInfo' :: Maybe Text
gatewayType = Maybe Text
a} :: GatewayInfo)
instance Core.FromJSON GatewayInfo where
parseJSON :: Value -> Parser GatewayInfo
parseJSON =
String
-> (Object -> Parser GatewayInfo) -> Value -> Parser GatewayInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GatewayInfo"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewayInfo
GatewayInfo'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewayInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewayInfo)
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
"Ec2InstanceRegion")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewayInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewayInfo)
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
"GatewayARN")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewayInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> GatewayInfo)
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
"Ec2InstanceId")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> GatewayInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> GatewayInfo)
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
"GatewayOperationalState")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> GatewayInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> GatewayInfo)
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
"GatewayName")
Parser (Maybe Text -> Maybe Text -> GatewayInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> GatewayInfo)
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
"GatewayId")
Parser (Maybe Text -> GatewayInfo)
-> Parser (Maybe Text) -> Parser GatewayInfo
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
"GatewayType")
)
instance Prelude.Hashable GatewayInfo
instance Prelude.NFData GatewayInfo