{-# 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.DeviceiSCSIAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeviceiSCSIAttributes = DeviceiSCSIAttributes'
{
DeviceiSCSIAttributes -> Maybe Text
targetARN :: Prelude.Maybe Prelude.Text,
DeviceiSCSIAttributes -> Maybe Bool
chapEnabled :: Prelude.Maybe Prelude.Bool,
DeviceiSCSIAttributes -> Maybe Text
networkInterfaceId :: Prelude.Maybe Prelude.Text,
DeviceiSCSIAttributes -> Maybe Int
networkInterfacePort :: Prelude.Maybe Prelude.Int
}
deriving (DeviceiSCSIAttributes -> DeviceiSCSIAttributes -> Bool
(DeviceiSCSIAttributes -> DeviceiSCSIAttributes -> Bool)
-> (DeviceiSCSIAttributes -> DeviceiSCSIAttributes -> Bool)
-> Eq DeviceiSCSIAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceiSCSIAttributes -> DeviceiSCSIAttributes -> Bool
$c/= :: DeviceiSCSIAttributes -> DeviceiSCSIAttributes -> Bool
== :: DeviceiSCSIAttributes -> DeviceiSCSIAttributes -> Bool
$c== :: DeviceiSCSIAttributes -> DeviceiSCSIAttributes -> Bool
Prelude.Eq, ReadPrec [DeviceiSCSIAttributes]
ReadPrec DeviceiSCSIAttributes
Int -> ReadS DeviceiSCSIAttributes
ReadS [DeviceiSCSIAttributes]
(Int -> ReadS DeviceiSCSIAttributes)
-> ReadS [DeviceiSCSIAttributes]
-> ReadPrec DeviceiSCSIAttributes
-> ReadPrec [DeviceiSCSIAttributes]
-> Read DeviceiSCSIAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceiSCSIAttributes]
$creadListPrec :: ReadPrec [DeviceiSCSIAttributes]
readPrec :: ReadPrec DeviceiSCSIAttributes
$creadPrec :: ReadPrec DeviceiSCSIAttributes
readList :: ReadS [DeviceiSCSIAttributes]
$creadList :: ReadS [DeviceiSCSIAttributes]
readsPrec :: Int -> ReadS DeviceiSCSIAttributes
$creadsPrec :: Int -> ReadS DeviceiSCSIAttributes
Prelude.Read, Int -> DeviceiSCSIAttributes -> ShowS
[DeviceiSCSIAttributes] -> ShowS
DeviceiSCSIAttributes -> String
(Int -> DeviceiSCSIAttributes -> ShowS)
-> (DeviceiSCSIAttributes -> String)
-> ([DeviceiSCSIAttributes] -> ShowS)
-> Show DeviceiSCSIAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceiSCSIAttributes] -> ShowS
$cshowList :: [DeviceiSCSIAttributes] -> ShowS
show :: DeviceiSCSIAttributes -> String
$cshow :: DeviceiSCSIAttributes -> String
showsPrec :: Int -> DeviceiSCSIAttributes -> ShowS
$cshowsPrec :: Int -> DeviceiSCSIAttributes -> ShowS
Prelude.Show, (forall x. DeviceiSCSIAttributes -> Rep DeviceiSCSIAttributes x)
-> (forall x. Rep DeviceiSCSIAttributes x -> DeviceiSCSIAttributes)
-> Generic DeviceiSCSIAttributes
forall x. Rep DeviceiSCSIAttributes x -> DeviceiSCSIAttributes
forall x. DeviceiSCSIAttributes -> Rep DeviceiSCSIAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceiSCSIAttributes x -> DeviceiSCSIAttributes
$cfrom :: forall x. DeviceiSCSIAttributes -> Rep DeviceiSCSIAttributes x
Prelude.Generic)
newDeviceiSCSIAttributes ::
DeviceiSCSIAttributes
newDeviceiSCSIAttributes :: DeviceiSCSIAttributes
newDeviceiSCSIAttributes =
DeviceiSCSIAttributes' :: Maybe Text
-> Maybe Bool -> Maybe Text -> Maybe Int -> DeviceiSCSIAttributes
DeviceiSCSIAttributes'
{ $sel:targetARN:DeviceiSCSIAttributes' :: Maybe Text
targetARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:chapEnabled:DeviceiSCSIAttributes' :: Maybe Bool
chapEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:networkInterfaceId:DeviceiSCSIAttributes' :: Maybe Text
networkInterfaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:networkInterfacePort:DeviceiSCSIAttributes' :: Maybe Int
networkInterfacePort = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
deviceiSCSIAttributes_targetARN :: Lens.Lens' DeviceiSCSIAttributes (Prelude.Maybe Prelude.Text)
deviceiSCSIAttributes_targetARN :: (Maybe Text -> f (Maybe Text))
-> DeviceiSCSIAttributes -> f DeviceiSCSIAttributes
deviceiSCSIAttributes_targetARN = (DeviceiSCSIAttributes -> Maybe Text)
-> (DeviceiSCSIAttributes -> Maybe Text -> DeviceiSCSIAttributes)
-> Lens
DeviceiSCSIAttributes
DeviceiSCSIAttributes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceiSCSIAttributes' {Maybe Text
targetARN :: Maybe Text
$sel:targetARN:DeviceiSCSIAttributes' :: DeviceiSCSIAttributes -> Maybe Text
targetARN} -> Maybe Text
targetARN) (\s :: DeviceiSCSIAttributes
s@DeviceiSCSIAttributes' {} Maybe Text
a -> DeviceiSCSIAttributes
s {$sel:targetARN:DeviceiSCSIAttributes' :: Maybe Text
targetARN = Maybe Text
a} :: DeviceiSCSIAttributes)
deviceiSCSIAttributes_chapEnabled :: Lens.Lens' DeviceiSCSIAttributes (Prelude.Maybe Prelude.Bool)
deviceiSCSIAttributes_chapEnabled :: (Maybe Bool -> f (Maybe Bool))
-> DeviceiSCSIAttributes -> f DeviceiSCSIAttributes
deviceiSCSIAttributes_chapEnabled = (DeviceiSCSIAttributes -> Maybe Bool)
-> (DeviceiSCSIAttributes -> Maybe Bool -> DeviceiSCSIAttributes)
-> Lens
DeviceiSCSIAttributes
DeviceiSCSIAttributes
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceiSCSIAttributes' {Maybe Bool
chapEnabled :: Maybe Bool
$sel:chapEnabled:DeviceiSCSIAttributes' :: DeviceiSCSIAttributes -> Maybe Bool
chapEnabled} -> Maybe Bool
chapEnabled) (\s :: DeviceiSCSIAttributes
s@DeviceiSCSIAttributes' {} Maybe Bool
a -> DeviceiSCSIAttributes
s {$sel:chapEnabled:DeviceiSCSIAttributes' :: Maybe Bool
chapEnabled = Maybe Bool
a} :: DeviceiSCSIAttributes)
deviceiSCSIAttributes_networkInterfaceId :: Lens.Lens' DeviceiSCSIAttributes (Prelude.Maybe Prelude.Text)
deviceiSCSIAttributes_networkInterfaceId :: (Maybe Text -> f (Maybe Text))
-> DeviceiSCSIAttributes -> f DeviceiSCSIAttributes
deviceiSCSIAttributes_networkInterfaceId = (DeviceiSCSIAttributes -> Maybe Text)
-> (DeviceiSCSIAttributes -> Maybe Text -> DeviceiSCSIAttributes)
-> Lens
DeviceiSCSIAttributes
DeviceiSCSIAttributes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceiSCSIAttributes' {Maybe Text
networkInterfaceId :: Maybe Text
$sel:networkInterfaceId:DeviceiSCSIAttributes' :: DeviceiSCSIAttributes -> Maybe Text
networkInterfaceId} -> Maybe Text
networkInterfaceId) (\s :: DeviceiSCSIAttributes
s@DeviceiSCSIAttributes' {} Maybe Text
a -> DeviceiSCSIAttributes
s {$sel:networkInterfaceId:DeviceiSCSIAttributes' :: Maybe Text
networkInterfaceId = Maybe Text
a} :: DeviceiSCSIAttributes)
deviceiSCSIAttributes_networkInterfacePort :: Lens.Lens' DeviceiSCSIAttributes (Prelude.Maybe Prelude.Int)
deviceiSCSIAttributes_networkInterfacePort :: (Maybe Int -> f (Maybe Int))
-> DeviceiSCSIAttributes -> f DeviceiSCSIAttributes
deviceiSCSIAttributes_networkInterfacePort = (DeviceiSCSIAttributes -> Maybe Int)
-> (DeviceiSCSIAttributes -> Maybe Int -> DeviceiSCSIAttributes)
-> Lens
DeviceiSCSIAttributes DeviceiSCSIAttributes (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceiSCSIAttributes' {Maybe Int
networkInterfacePort :: Maybe Int
$sel:networkInterfacePort:DeviceiSCSIAttributes' :: DeviceiSCSIAttributes -> Maybe Int
networkInterfacePort} -> Maybe Int
networkInterfacePort) (\s :: DeviceiSCSIAttributes
s@DeviceiSCSIAttributes' {} Maybe Int
a -> DeviceiSCSIAttributes
s {$sel:networkInterfacePort:DeviceiSCSIAttributes' :: Maybe Int
networkInterfacePort = Maybe Int
a} :: DeviceiSCSIAttributes)
instance Core.FromJSON DeviceiSCSIAttributes where
parseJSON :: Value -> Parser DeviceiSCSIAttributes
parseJSON =
String
-> (Object -> Parser DeviceiSCSIAttributes)
-> Value
-> Parser DeviceiSCSIAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DeviceiSCSIAttributes"
( \Object
x ->
Maybe Text
-> Maybe Bool -> Maybe Text -> Maybe Int -> DeviceiSCSIAttributes
DeviceiSCSIAttributes'
(Maybe Text
-> Maybe Bool -> Maybe Text -> Maybe Int -> DeviceiSCSIAttributes)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool -> Maybe Text -> Maybe Int -> DeviceiSCSIAttributes)
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
"TargetARN")
Parser
(Maybe Bool -> Maybe Text -> Maybe Int -> DeviceiSCSIAttributes)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Int -> DeviceiSCSIAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChapEnabled")
Parser (Maybe Text -> Maybe Int -> DeviceiSCSIAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> DeviceiSCSIAttributes)
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
"NetworkInterfaceId")
Parser (Maybe Int -> DeviceiSCSIAttributes)
-> Parser (Maybe Int) -> Parser DeviceiSCSIAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NetworkInterfacePort")
)
instance Prelude.Hashable DeviceiSCSIAttributes
instance Prelude.NFData DeviceiSCSIAttributes