{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.StorageGateway.Types.VolumeiSCSIAttributes
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.StorageGateway.Types.VolumeiSCSIAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Lists iSCSI information about a volume.
--
-- /See:/ 'newVolumeiSCSIAttributes' smart constructor.
data VolumeiSCSIAttributes = VolumeiSCSIAttributes'
  { -- | The logical disk number.
    VolumeiSCSIAttributes -> Maybe Natural
lunNumber :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the volume target.
    VolumeiSCSIAttributes -> Maybe Text
targetARN :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether mutual CHAP is enabled for the iSCSI target.
    VolumeiSCSIAttributes -> Maybe Bool
chapEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The network interface identifier.
    VolumeiSCSIAttributes -> Maybe Text
networkInterfaceId :: Prelude.Maybe Prelude.Text,
    -- | The port used to communicate with iSCSI targets.
    VolumeiSCSIAttributes -> Maybe Int
networkInterfacePort :: Prelude.Maybe Prelude.Int
  }
  deriving (VolumeiSCSIAttributes -> VolumeiSCSIAttributes -> Bool
(VolumeiSCSIAttributes -> VolumeiSCSIAttributes -> Bool)
-> (VolumeiSCSIAttributes -> VolumeiSCSIAttributes -> Bool)
-> Eq VolumeiSCSIAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeiSCSIAttributes -> VolumeiSCSIAttributes -> Bool
$c/= :: VolumeiSCSIAttributes -> VolumeiSCSIAttributes -> Bool
== :: VolumeiSCSIAttributes -> VolumeiSCSIAttributes -> Bool
$c== :: VolumeiSCSIAttributes -> VolumeiSCSIAttributes -> Bool
Prelude.Eq, ReadPrec [VolumeiSCSIAttributes]
ReadPrec VolumeiSCSIAttributes
Int -> ReadS VolumeiSCSIAttributes
ReadS [VolumeiSCSIAttributes]
(Int -> ReadS VolumeiSCSIAttributes)
-> ReadS [VolumeiSCSIAttributes]
-> ReadPrec VolumeiSCSIAttributes
-> ReadPrec [VolumeiSCSIAttributes]
-> Read VolumeiSCSIAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeiSCSIAttributes]
$creadListPrec :: ReadPrec [VolumeiSCSIAttributes]
readPrec :: ReadPrec VolumeiSCSIAttributes
$creadPrec :: ReadPrec VolumeiSCSIAttributes
readList :: ReadS [VolumeiSCSIAttributes]
$creadList :: ReadS [VolumeiSCSIAttributes]
readsPrec :: Int -> ReadS VolumeiSCSIAttributes
$creadsPrec :: Int -> ReadS VolumeiSCSIAttributes
Prelude.Read, Int -> VolumeiSCSIAttributes -> ShowS
[VolumeiSCSIAttributes] -> ShowS
VolumeiSCSIAttributes -> String
(Int -> VolumeiSCSIAttributes -> ShowS)
-> (VolumeiSCSIAttributes -> String)
-> ([VolumeiSCSIAttributes] -> ShowS)
-> Show VolumeiSCSIAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeiSCSIAttributes] -> ShowS
$cshowList :: [VolumeiSCSIAttributes] -> ShowS
show :: VolumeiSCSIAttributes -> String
$cshow :: VolumeiSCSIAttributes -> String
showsPrec :: Int -> VolumeiSCSIAttributes -> ShowS
$cshowsPrec :: Int -> VolumeiSCSIAttributes -> ShowS
Prelude.Show, (forall x. VolumeiSCSIAttributes -> Rep VolumeiSCSIAttributes x)
-> (forall x. Rep VolumeiSCSIAttributes x -> VolumeiSCSIAttributes)
-> Generic VolumeiSCSIAttributes
forall x. Rep VolumeiSCSIAttributes x -> VolumeiSCSIAttributes
forall x. VolumeiSCSIAttributes -> Rep VolumeiSCSIAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeiSCSIAttributes x -> VolumeiSCSIAttributes
$cfrom :: forall x. VolumeiSCSIAttributes -> Rep VolumeiSCSIAttributes x
Prelude.Generic)

-- |
-- Create a value of 'VolumeiSCSIAttributes' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lunNumber', 'volumeiSCSIAttributes_lunNumber' - The logical disk number.
--
-- 'targetARN', 'volumeiSCSIAttributes_targetARN' - The Amazon Resource Name (ARN) of the volume target.
--
-- 'chapEnabled', 'volumeiSCSIAttributes_chapEnabled' - Indicates whether mutual CHAP is enabled for the iSCSI target.
--
-- 'networkInterfaceId', 'volumeiSCSIAttributes_networkInterfaceId' - The network interface identifier.
--
-- 'networkInterfacePort', 'volumeiSCSIAttributes_networkInterfacePort' - The port used to communicate with iSCSI targets.
newVolumeiSCSIAttributes ::
  VolumeiSCSIAttributes
newVolumeiSCSIAttributes :: VolumeiSCSIAttributes
newVolumeiSCSIAttributes =
  VolumeiSCSIAttributes' :: Maybe Natural
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> VolumeiSCSIAttributes
VolumeiSCSIAttributes'
    { $sel:lunNumber:VolumeiSCSIAttributes' :: Maybe Natural
lunNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:targetARN:VolumeiSCSIAttributes' :: Maybe Text
targetARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:chapEnabled:VolumeiSCSIAttributes' :: Maybe Bool
chapEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaceId:VolumeiSCSIAttributes' :: Maybe Text
networkInterfaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfacePort:VolumeiSCSIAttributes' :: Maybe Int
networkInterfacePort = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The logical disk number.
volumeiSCSIAttributes_lunNumber :: Lens.Lens' VolumeiSCSIAttributes (Prelude.Maybe Prelude.Natural)
volumeiSCSIAttributes_lunNumber :: (Maybe Natural -> f (Maybe Natural))
-> VolumeiSCSIAttributes -> f VolumeiSCSIAttributes
volumeiSCSIAttributes_lunNumber = (VolumeiSCSIAttributes -> Maybe Natural)
-> (VolumeiSCSIAttributes
    -> Maybe Natural -> VolumeiSCSIAttributes)
-> Lens
     VolumeiSCSIAttributes
     VolumeiSCSIAttributes
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeiSCSIAttributes' {Maybe Natural
lunNumber :: Maybe Natural
$sel:lunNumber:VolumeiSCSIAttributes' :: VolumeiSCSIAttributes -> Maybe Natural
lunNumber} -> Maybe Natural
lunNumber) (\s :: VolumeiSCSIAttributes
s@VolumeiSCSIAttributes' {} Maybe Natural
a -> VolumeiSCSIAttributes
s {$sel:lunNumber:VolumeiSCSIAttributes' :: Maybe Natural
lunNumber = Maybe Natural
a} :: VolumeiSCSIAttributes)

-- | The Amazon Resource Name (ARN) of the volume target.
volumeiSCSIAttributes_targetARN :: Lens.Lens' VolumeiSCSIAttributes (Prelude.Maybe Prelude.Text)
volumeiSCSIAttributes_targetARN :: (Maybe Text -> f (Maybe Text))
-> VolumeiSCSIAttributes -> f VolumeiSCSIAttributes
volumeiSCSIAttributes_targetARN = (VolumeiSCSIAttributes -> Maybe Text)
-> (VolumeiSCSIAttributes -> Maybe Text -> VolumeiSCSIAttributes)
-> Lens
     VolumeiSCSIAttributes
     VolumeiSCSIAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeiSCSIAttributes' {Maybe Text
targetARN :: Maybe Text
$sel:targetARN:VolumeiSCSIAttributes' :: VolumeiSCSIAttributes -> Maybe Text
targetARN} -> Maybe Text
targetARN) (\s :: VolumeiSCSIAttributes
s@VolumeiSCSIAttributes' {} Maybe Text
a -> VolumeiSCSIAttributes
s {$sel:targetARN:VolumeiSCSIAttributes' :: Maybe Text
targetARN = Maybe Text
a} :: VolumeiSCSIAttributes)

-- | Indicates whether mutual CHAP is enabled for the iSCSI target.
volumeiSCSIAttributes_chapEnabled :: Lens.Lens' VolumeiSCSIAttributes (Prelude.Maybe Prelude.Bool)
volumeiSCSIAttributes_chapEnabled :: (Maybe Bool -> f (Maybe Bool))
-> VolumeiSCSIAttributes -> f VolumeiSCSIAttributes
volumeiSCSIAttributes_chapEnabled = (VolumeiSCSIAttributes -> Maybe Bool)
-> (VolumeiSCSIAttributes -> Maybe Bool -> VolumeiSCSIAttributes)
-> Lens
     VolumeiSCSIAttributes
     VolumeiSCSIAttributes
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeiSCSIAttributes' {Maybe Bool
chapEnabled :: Maybe Bool
$sel:chapEnabled:VolumeiSCSIAttributes' :: VolumeiSCSIAttributes -> Maybe Bool
chapEnabled} -> Maybe Bool
chapEnabled) (\s :: VolumeiSCSIAttributes
s@VolumeiSCSIAttributes' {} Maybe Bool
a -> VolumeiSCSIAttributes
s {$sel:chapEnabled:VolumeiSCSIAttributes' :: Maybe Bool
chapEnabled = Maybe Bool
a} :: VolumeiSCSIAttributes)

-- | The network interface identifier.
volumeiSCSIAttributes_networkInterfaceId :: Lens.Lens' VolumeiSCSIAttributes (Prelude.Maybe Prelude.Text)
volumeiSCSIAttributes_networkInterfaceId :: (Maybe Text -> f (Maybe Text))
-> VolumeiSCSIAttributes -> f VolumeiSCSIAttributes
volumeiSCSIAttributes_networkInterfaceId = (VolumeiSCSIAttributes -> Maybe Text)
-> (VolumeiSCSIAttributes -> Maybe Text -> VolumeiSCSIAttributes)
-> Lens
     VolumeiSCSIAttributes
     VolumeiSCSIAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeiSCSIAttributes' {Maybe Text
networkInterfaceId :: Maybe Text
$sel:networkInterfaceId:VolumeiSCSIAttributes' :: VolumeiSCSIAttributes -> Maybe Text
networkInterfaceId} -> Maybe Text
networkInterfaceId) (\s :: VolumeiSCSIAttributes
s@VolumeiSCSIAttributes' {} Maybe Text
a -> VolumeiSCSIAttributes
s {$sel:networkInterfaceId:VolumeiSCSIAttributes' :: Maybe Text
networkInterfaceId = Maybe Text
a} :: VolumeiSCSIAttributes)

-- | The port used to communicate with iSCSI targets.
volumeiSCSIAttributes_networkInterfacePort :: Lens.Lens' VolumeiSCSIAttributes (Prelude.Maybe Prelude.Int)
volumeiSCSIAttributes_networkInterfacePort :: (Maybe Int -> f (Maybe Int))
-> VolumeiSCSIAttributes -> f VolumeiSCSIAttributes
volumeiSCSIAttributes_networkInterfacePort = (VolumeiSCSIAttributes -> Maybe Int)
-> (VolumeiSCSIAttributes -> Maybe Int -> VolumeiSCSIAttributes)
-> Lens
     VolumeiSCSIAttributes VolumeiSCSIAttributes (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeiSCSIAttributes' {Maybe Int
networkInterfacePort :: Maybe Int
$sel:networkInterfacePort:VolumeiSCSIAttributes' :: VolumeiSCSIAttributes -> Maybe Int
networkInterfacePort} -> Maybe Int
networkInterfacePort) (\s :: VolumeiSCSIAttributes
s@VolumeiSCSIAttributes' {} Maybe Int
a -> VolumeiSCSIAttributes
s {$sel:networkInterfacePort:VolumeiSCSIAttributes' :: Maybe Int
networkInterfacePort = Maybe Int
a} :: VolumeiSCSIAttributes)

instance Core.FromJSON VolumeiSCSIAttributes where
  parseJSON :: Value -> Parser VolumeiSCSIAttributes
parseJSON =
    String
-> (Object -> Parser VolumeiSCSIAttributes)
-> Value
-> Parser VolumeiSCSIAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VolumeiSCSIAttributes"
      ( \Object
x ->
          Maybe Natural
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> VolumeiSCSIAttributes
VolumeiSCSIAttributes'
            (Maybe Natural
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Int
 -> VolumeiSCSIAttributes)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Text
      -> Maybe Bool -> Maybe Text -> Maybe Int -> VolumeiSCSIAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LunNumber")
            Parser
  (Maybe Text
   -> Maybe Bool -> Maybe Text -> Maybe Int -> VolumeiSCSIAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool -> Maybe Text -> Maybe Int -> VolumeiSCSIAttributes)
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
"TargetARN")
            Parser
  (Maybe Bool -> Maybe Text -> Maybe Int -> VolumeiSCSIAttributes)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Int -> VolumeiSCSIAttributes)
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 -> VolumeiSCSIAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> VolumeiSCSIAttributes)
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 -> VolumeiSCSIAttributes)
-> Parser (Maybe Int) -> Parser VolumeiSCSIAttributes
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 VolumeiSCSIAttributes

instance Prelude.NFData VolumeiSCSIAttributes