{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.StorageGateway.Types.VTLDevice where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 unique Amazon Resource Name (ARN) of the device (tape
    -- drive or media changer).
    VTLDevice -> Maybe Text
vTLDeviceARN :: Prelude.Maybe Prelude.Text,
    -- | Specifies the model number of device that the VTL device emulates.
    VTLDevice -> Maybe Text
vTLDeviceProductIdentifier :: Prelude.Maybe Prelude.Text,
    -- | Specifies the type of device that the VTL device emulates.
    VTLDevice -> Maybe Text
vTLDeviceType :: Prelude.Maybe Prelude.Text,
    -- | Specifies the vendor of the device that the VTL device object emulates.
    VTLDevice -> Maybe Text
vTLDeviceVendor :: Prelude.Maybe Prelude.Text
  }
  deriving (VTLDevice -> VTLDevice -> Bool
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]
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
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. 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.
--
-- 'vTLDeviceARN', 'vTLDevice_vTLDeviceARN' - Specifies the unique Amazon Resource Name (ARN) of the device (tape
-- drive or media changer).
--
-- 'vTLDeviceProductIdentifier', 'vTLDevice_vTLDeviceProductIdentifier' - Specifies the model number of device that the VTL device emulates.
--
-- 'vTLDeviceType', 'vTLDevice_vTLDeviceType' - Specifies the type of device that the VTL device emulates.
--
-- 'vTLDeviceVendor', 'vTLDevice_vTLDeviceVendor' - Specifies the vendor of the device that the VTL device object emulates.
newVTLDevice ::
  VTLDevice
newVTLDevice :: VTLDevice
newVTLDevice =
  VTLDevice'
    { $sel:deviceiSCSIAttributes:VTLDevice' :: Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceARN:VTLDevice' :: Maybe Text
vTLDeviceARN = forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceProductIdentifier:VTLDevice' :: Maybe Text
vTLDeviceProductIdentifier = forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceType:VTLDevice' :: Maybe Text
vTLDeviceType = forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceVendor:VTLDevice' :: Maybe Text
vTLDeviceVendor = 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 :: Lens' VTLDevice (Maybe DeviceiSCSIAttributes)
vTLDevice_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 unique Amazon Resource Name (ARN) of the device (tape
-- drive or media changer).
vTLDevice_vTLDeviceARN :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceARN :: Lens' VTLDevice (Maybe Text)
vTLDevice_vTLDeviceARN = 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 model number of device that the VTL device emulates.
vTLDevice_vTLDeviceProductIdentifier :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceProductIdentifier :: Lens' VTLDevice (Maybe Text)
vTLDevice_vTLDeviceProductIdentifier = 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)

-- | Specifies the type of device that the VTL device emulates.
vTLDevice_vTLDeviceType :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceType :: Lens' VTLDevice (Maybe Text)
vTLDevice_vTLDeviceType = 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 vendor of the device that the VTL device object emulates.
vTLDevice_vTLDeviceVendor :: Lens.Lens' VTLDevice (Prelude.Maybe Prelude.Text)
vTLDevice_vTLDeviceVendor :: Lens' VTLDevice (Maybe Text)
vTLDevice_vTLDeviceVendor = 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)

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

instance Prelude.Hashable VTLDevice where
  hashWithSalt :: Int -> VTLDevice -> Int
hashWithSalt Int
_salt VTLDevice' {Maybe Text
Maybe DeviceiSCSIAttributes
vTLDeviceVendor :: Maybe Text
vTLDeviceType :: Maybe Text
vTLDeviceProductIdentifier :: Maybe Text
vTLDeviceARN :: Maybe Text
deviceiSCSIAttributes :: Maybe DeviceiSCSIAttributes
$sel:vTLDeviceVendor:VTLDevice' :: VTLDevice -> Maybe Text
$sel:vTLDeviceType:VTLDevice' :: VTLDevice -> Maybe Text
$sel:vTLDeviceProductIdentifier:VTLDevice' :: VTLDevice -> Maybe Text
$sel:vTLDeviceARN:VTLDevice' :: VTLDevice -> Maybe Text
$sel:deviceiSCSIAttributes:VTLDevice' :: VTLDevice -> Maybe DeviceiSCSIAttributes
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vTLDeviceARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vTLDeviceProductIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vTLDeviceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vTLDeviceVendor

instance Prelude.NFData VTLDevice where
  rnf :: VTLDevice -> ()
rnf VTLDevice' {Maybe Text
Maybe DeviceiSCSIAttributes
vTLDeviceVendor :: Maybe Text
vTLDeviceType :: Maybe Text
vTLDeviceProductIdentifier :: Maybe Text
vTLDeviceARN :: Maybe Text
deviceiSCSIAttributes :: Maybe DeviceiSCSIAttributes
$sel:vTLDeviceVendor:VTLDevice' :: VTLDevice -> Maybe Text
$sel:vTLDeviceType:VTLDevice' :: VTLDevice -> Maybe Text
$sel:vTLDeviceProductIdentifier:VTLDevice' :: VTLDevice -> Maybe Text
$sel:vTLDeviceARN:VTLDevice' :: VTLDevice -> Maybe Text
$sel:deviceiSCSIAttributes:VTLDevice' :: VTLDevice -> Maybe DeviceiSCSIAttributes
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceiSCSIAttributes
deviceiSCSIAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vTLDeviceARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vTLDeviceProductIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vTLDeviceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vTLDeviceVendor