{-# 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.VTLDevice
-- 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.VTLDevice where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.StorageGateway.Types.DeviceiSCSIAttributes

-- | Represents a device object associated with a tape gateway.
--
-- /See:/ 'newVTLDevice' smart constructor.
data VTLDevice = VTLDevice'
  { -- | A list of iSCSI information about a VTL device.
    VTLDevice -> Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes :: Prelude.Maybe DeviceiSCSIAttributes,
    -- | Specifies the vendor of the device that the VTL device object emulates.
    VTLDevice -> Maybe Text
vTLDeviceVendor :: Prelude.Maybe Prelude.Text,
    -- | Specifies the unique Amazon Resource Name (ARN) of the device (tape
    -- drive or media changer).
    VTLDevice -> Maybe Text
vTLDeviceARN :: Prelude.Maybe Prelude.Text,
    -- | Specifies the type of device that the VTL device emulates.
    VTLDevice -> Maybe Text
vTLDeviceType :: Prelude.Maybe Prelude.Text,
    -- | Specifies the model number of device that the VTL device emulates.
    VTLDevice -> Maybe Text
vTLDeviceProductIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (VTLDevice -> VTLDevice -> Bool
(VTLDevice -> VTLDevice -> Bool)
-> (VTLDevice -> VTLDevice -> Bool) -> Eq VTLDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VTLDevice -> VTLDevice -> Bool
$c/= :: VTLDevice -> VTLDevice -> Bool
== :: VTLDevice -> VTLDevice -> Bool
$c== :: VTLDevice -> VTLDevice -> Bool
Prelude.Eq, ReadPrec [VTLDevice]
ReadPrec VTLDevice
Int -> ReadS VTLDevice
ReadS [VTLDevice]
(Int -> ReadS VTLDevice)
-> ReadS [VTLDevice]
-> ReadPrec VTLDevice
-> ReadPrec [VTLDevice]
-> Read VTLDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VTLDevice]
$creadListPrec :: ReadPrec [VTLDevice]
readPrec :: ReadPrec VTLDevice
$creadPrec :: ReadPrec VTLDevice
readList :: ReadS [VTLDevice]
$creadList :: ReadS [VTLDevice]
readsPrec :: Int -> ReadS VTLDevice
$creadsPrec :: Int -> ReadS VTLDevice
Prelude.Read, Int -> VTLDevice -> ShowS
[VTLDevice] -> ShowS
VTLDevice -> String
(Int -> VTLDevice -> ShowS)
-> (VTLDevice -> String)
-> ([VTLDevice] -> ShowS)
-> Show VTLDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VTLDevice] -> ShowS
$cshowList :: [VTLDevice] -> ShowS
show :: VTLDevice -> String
$cshow :: VTLDevice -> String
showsPrec :: Int -> VTLDevice -> ShowS
$cshowsPrec :: Int -> VTLDevice -> ShowS
Prelude.Show, (forall x. VTLDevice -> Rep VTLDevice x)
-> (forall x. Rep VTLDevice x -> VTLDevice) -> Generic VTLDevice
forall x. Rep VTLDevice x -> VTLDevice
forall x. VTLDevice -> Rep VTLDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VTLDevice x -> VTLDevice
$cfrom :: forall x. VTLDevice -> Rep VTLDevice x
Prelude.Generic)

-- |
-- Create a value of 'VTLDevice' 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:
--
-- 'deviceiSCSIAttributes', 'vTLDevice_deviceiSCSIAttributes' - A list of iSCSI information about a VTL device.
--
-- 'vTLDeviceVendor', 'vTLDevice_vTLDeviceVendor' - Specifies the vendor of the device that the VTL device object emulates.
--
-- 'vTLDeviceARN', 'vTLDevice_vTLDeviceARN' - Specifies the unique Amazon Resource Name (ARN) of the device (tape
-- drive or media changer).
--
-- 'vTLDeviceType', 'vTLDevice_vTLDeviceType' - Specifies the type of device that the VTL device emulates.
--
-- 'vTLDeviceProductIdentifier', 'vTLDevice_vTLDeviceProductIdentifier' - Specifies the model number of device that the VTL device emulates.
newVTLDevice ::
  VTLDevice
newVTLDevice :: VTLDevice
newVTLDevice =
  VTLDevice' :: Maybe DeviceiSCSIAttributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VTLDevice
VTLDevice'
    { $sel:deviceiSCSIAttributes:VTLDevice' :: Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes = Maybe DeviceiSCSIAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceVendor:VTLDevice' :: Maybe Text
vTLDeviceVendor = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceARN:VTLDevice' :: Maybe Text
vTLDeviceARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceType:VTLDevice' :: Maybe Text
vTLDeviceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceProductIdentifier:VTLDevice' :: Maybe Text
vTLDeviceProductIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of iSCSI information about a VTL device.
vTLDevice_deviceiSCSIAttributes :: Lens.Lens' VTLDevice (Prelude.Maybe DeviceiSCSIAttributes)
vTLDevice_deviceiSCSIAttributes :: (Maybe DeviceiSCSIAttributes -> f (Maybe DeviceiSCSIAttributes))
-> VTLDevice -> f VTLDevice
vTLDevice_deviceiSCSIAttributes = (VTLDevice -> Maybe DeviceiSCSIAttributes)
-> (VTLDevice -> Maybe DeviceiSCSIAttributes -> VTLDevice)
-> Lens
     VTLDevice
     VTLDevice
     (Maybe DeviceiSCSIAttributes)
     (Maybe DeviceiSCSIAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VTLDevice' {Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes :: Maybe DeviceiSCSIAttributes
$sel:deviceiSCSIAttributes:VTLDevice' :: VTLDevice -> Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes} -> Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes) (\s :: VTLDevice
s@VTLDevice' {} Maybe DeviceiSCSIAttributes
a -> VTLDevice
s {$sel:deviceiSCSIAttributes:VTLDevice' :: Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes = Maybe DeviceiSCSIAttributes
a} :: VTLDevice)

-- | Specifies the vendor of the device that the VTL device object emulates.
vTLDevice_vTLDeviceVendor :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceVendor :: (Maybe Text -> f (Maybe Text)) -> VTLDevice -> f VTLDevice
vTLDevice_vTLDeviceVendor = (VTLDevice -> Maybe Text)
-> (VTLDevice -> Maybe Text -> VTLDevice)
-> Lens VTLDevice VTLDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VTLDevice' {Maybe Text
vTLDeviceVendor :: Maybe Text
$sel:vTLDeviceVendor:VTLDevice' :: VTLDevice -> Maybe Text
vTLDeviceVendor} -> Maybe Text
vTLDeviceVendor) (\s :: VTLDevice
s@VTLDevice' {} Maybe Text
a -> VTLDevice
s {$sel:vTLDeviceVendor:VTLDevice' :: Maybe Text
vTLDeviceVendor = Maybe Text
a} :: VTLDevice)

-- | Specifies the unique Amazon Resource Name (ARN) of the device (tape
-- drive or media changer).
vTLDevice_vTLDeviceARN :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceARN :: (Maybe Text -> f (Maybe Text)) -> VTLDevice -> f VTLDevice
vTLDevice_vTLDeviceARN = (VTLDevice -> Maybe Text)
-> (VTLDevice -> Maybe Text -> VTLDevice)
-> Lens VTLDevice VTLDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VTLDevice' {Maybe Text
vTLDeviceARN :: Maybe Text
$sel:vTLDeviceARN:VTLDevice' :: VTLDevice -> Maybe Text
vTLDeviceARN} -> Maybe Text
vTLDeviceARN) (\s :: VTLDevice
s@VTLDevice' {} Maybe Text
a -> VTLDevice
s {$sel:vTLDeviceARN:VTLDevice' :: Maybe Text
vTLDeviceARN = Maybe Text
a} :: VTLDevice)

-- | Specifies the type of device that the VTL device emulates.
vTLDevice_vTLDeviceType :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceType :: (Maybe Text -> f (Maybe Text)) -> VTLDevice -> f VTLDevice
vTLDevice_vTLDeviceType = (VTLDevice -> Maybe Text)
-> (VTLDevice -> Maybe Text -> VTLDevice)
-> Lens VTLDevice VTLDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VTLDevice' {Maybe Text
vTLDeviceType :: Maybe Text
$sel:vTLDeviceType:VTLDevice' :: VTLDevice -> Maybe Text
vTLDeviceType} -> Maybe Text
vTLDeviceType) (\s :: VTLDevice
s@VTLDevice' {} Maybe Text
a -> VTLDevice
s {$sel:vTLDeviceType:VTLDevice' :: Maybe Text
vTLDeviceType = Maybe Text
a} :: VTLDevice)

-- | Specifies the model number of device that the VTL device emulates.
vTLDevice_vTLDeviceProductIdentifier :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceProductIdentifier :: (Maybe Text -> f (Maybe Text)) -> VTLDevice -> f VTLDevice
vTLDevice_vTLDeviceProductIdentifier = (VTLDevice -> Maybe Text)
-> (VTLDevice -> Maybe Text -> VTLDevice)
-> Lens VTLDevice VTLDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VTLDevice' {Maybe Text
vTLDeviceProductIdentifier :: Maybe Text
$sel:vTLDeviceProductIdentifier:VTLDevice' :: VTLDevice -> Maybe Text
vTLDeviceProductIdentifier} -> Maybe Text
vTLDeviceProductIdentifier) (\s :: VTLDevice
s@VTLDevice' {} Maybe Text
a -> VTLDevice
s {$sel:vTLDeviceProductIdentifier:VTLDevice' :: Maybe Text
vTLDeviceProductIdentifier = Maybe Text
a} :: VTLDevice)

instance Core.FromJSON VTLDevice where
  parseJSON :: Value -> Parser VTLDevice
parseJSON =
    String -> (Object -> Parser VTLDevice) -> Value -> Parser VTLDevice
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VTLDevice"
      ( \Object
x ->
          Maybe DeviceiSCSIAttributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VTLDevice
VTLDevice'
            (Maybe DeviceiSCSIAttributes
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> VTLDevice)
-> Parser (Maybe DeviceiSCSIAttributes)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> VTLDevice)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DeviceiSCSIAttributes)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeviceiSCSIAttributes")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> VTLDevice)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> VTLDevice)
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
"VTLDeviceVendor")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> VTLDevice)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> VTLDevice)
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
"VTLDeviceARN")
            Parser (Maybe Text -> Maybe Text -> VTLDevice)
-> Parser (Maybe Text) -> Parser (Maybe Text -> VTLDevice)
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
"VTLDeviceType")
            Parser (Maybe Text -> VTLDevice)
-> Parser (Maybe Text) -> Parser VTLDevice
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
"VTLDeviceProductIdentifier")
      )

instance Prelude.Hashable VTLDevice

instance Prelude.NFData VTLDevice