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

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

-- | Describes an iSCSI cached volume.
--
-- /See:/ 'newCachediSCSIVolume' smart constructor.
data CachediSCSIVolume = CachediSCSIVolume'
  { -- | An VolumeiSCSIAttributes object that represents a collection of iSCSI
    -- attributes for one stored volume.
    CachediSCSIVolume -> Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes :: Prelude.Maybe VolumeiSCSIAttributes,
    -- | One of the VolumeStatus values that indicates the state of the storage
    -- volume.
    CachediSCSIVolume -> Maybe Text
volumeStatus :: Prelude.Maybe Prelude.Text,
    -- | If the cached volume was created from a snapshot, this field contains
    -- the snapshot ID used, e.g., snap-78e22663. Otherwise, this field is not
    -- included.
    CachediSCSIVolume -> Maybe Text
sourceSnapshotId :: Prelude.Maybe Prelude.Text,
    CachediSCSIVolume -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether a storage volume is attached to or
    -- detached from a gateway. For more information, see
    -- <https://docs.aws.amazon.com/storagegateway/latest/userguide/managing-volumes.html#attach-detach-volume Moving your volumes to a different gateway>.
    CachediSCSIVolume -> Maybe Text
volumeAttachmentStatus :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the storage volume.
    CachediSCSIVolume -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
    -- | Represents the percentage complete if the volume is restoring or
    -- bootstrapping that represents the percent of data transferred. This
    -- field does not appear in the response if the cached volume is not
    -- restoring or bootstrapping.
    CachediSCSIVolume -> Maybe Double
volumeProgress :: Prelude.Maybe Prelude.Double,
    -- | The size, in bytes, of the volume capacity.
    CachediSCSIVolume -> Maybe Integer
volumeSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The size of the data stored on the volume in bytes. This value is
    -- calculated based on the number of blocks that are touched, instead of
    -- the actual amount of data written. This value can be useful for
    -- sequential write patterns but less accurate for random write patterns.
    -- @VolumeUsedInBytes@ is different from the compressed size of the volume,
    -- which is the value that is used to calculate your bill.
    --
    -- This value is not available for volumes created prior to May 13, 2015,
    -- until you store data on the volume.
    CachediSCSIVolume -> Maybe Integer
volumeUsedInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The date the volume was created. Volumes created prior to March 28, 2017
    -- don’t have this timestamp.
    CachediSCSIVolume -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The unique identifier of the volume, e.g., vol-AE4B946D.
    CachediSCSIVolume -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text,
    -- | One of the VolumeType enumeration values that describes the type of the
    -- volume.
    CachediSCSIVolume -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text,
    -- | The name of the iSCSI target used by an initiator to connect to a volume
    -- and used as a suffix for the target ARN. For example, specifying
    -- @TargetName@ as /myvolume/ results in the target ARN of
    -- @arn:aws:storagegateway:us-east-2:111122223333:gateway\/sgw-12A3456B\/target\/iqn.1997-05.com.amazon:myvolume@.
    -- The target name must be unique across all volumes on a gateway.
    --
    -- If you don\'t specify a value, Storage Gateway uses the value that was
    -- previously used for this volume as the new target name.
    CachediSCSIVolume -> Maybe Text
targetName :: Prelude.Maybe Prelude.Text
  }
  deriving (CachediSCSIVolume -> CachediSCSIVolume -> Bool
(CachediSCSIVolume -> CachediSCSIVolume -> Bool)
-> (CachediSCSIVolume -> CachediSCSIVolume -> Bool)
-> Eq CachediSCSIVolume
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CachediSCSIVolume -> CachediSCSIVolume -> Bool
$c/= :: CachediSCSIVolume -> CachediSCSIVolume -> Bool
== :: CachediSCSIVolume -> CachediSCSIVolume -> Bool
$c== :: CachediSCSIVolume -> CachediSCSIVolume -> Bool
Prelude.Eq, ReadPrec [CachediSCSIVolume]
ReadPrec CachediSCSIVolume
Int -> ReadS CachediSCSIVolume
ReadS [CachediSCSIVolume]
(Int -> ReadS CachediSCSIVolume)
-> ReadS [CachediSCSIVolume]
-> ReadPrec CachediSCSIVolume
-> ReadPrec [CachediSCSIVolume]
-> Read CachediSCSIVolume
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CachediSCSIVolume]
$creadListPrec :: ReadPrec [CachediSCSIVolume]
readPrec :: ReadPrec CachediSCSIVolume
$creadPrec :: ReadPrec CachediSCSIVolume
readList :: ReadS [CachediSCSIVolume]
$creadList :: ReadS [CachediSCSIVolume]
readsPrec :: Int -> ReadS CachediSCSIVolume
$creadsPrec :: Int -> ReadS CachediSCSIVolume
Prelude.Read, Int -> CachediSCSIVolume -> ShowS
[CachediSCSIVolume] -> ShowS
CachediSCSIVolume -> String
(Int -> CachediSCSIVolume -> ShowS)
-> (CachediSCSIVolume -> String)
-> ([CachediSCSIVolume] -> ShowS)
-> Show CachediSCSIVolume
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CachediSCSIVolume] -> ShowS
$cshowList :: [CachediSCSIVolume] -> ShowS
show :: CachediSCSIVolume -> String
$cshow :: CachediSCSIVolume -> String
showsPrec :: Int -> CachediSCSIVolume -> ShowS
$cshowsPrec :: Int -> CachediSCSIVolume -> ShowS
Prelude.Show, (forall x. CachediSCSIVolume -> Rep CachediSCSIVolume x)
-> (forall x. Rep CachediSCSIVolume x -> CachediSCSIVolume)
-> Generic CachediSCSIVolume
forall x. Rep CachediSCSIVolume x -> CachediSCSIVolume
forall x. CachediSCSIVolume -> Rep CachediSCSIVolume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CachediSCSIVolume x -> CachediSCSIVolume
$cfrom :: forall x. CachediSCSIVolume -> Rep CachediSCSIVolume x
Prelude.Generic)

-- |
-- Create a value of 'CachediSCSIVolume' 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:
--
-- 'volumeiSCSIAttributes', 'cachediSCSIVolume_volumeiSCSIAttributes' - An VolumeiSCSIAttributes object that represents a collection of iSCSI
-- attributes for one stored volume.
--
-- 'volumeStatus', 'cachediSCSIVolume_volumeStatus' - One of the VolumeStatus values that indicates the state of the storage
-- volume.
--
-- 'sourceSnapshotId', 'cachediSCSIVolume_sourceSnapshotId' - If the cached volume was created from a snapshot, this field contains
-- the snapshot ID used, e.g., snap-78e22663. Otherwise, this field is not
-- included.
--
-- 'kmsKey', 'cachediSCSIVolume_kmsKey' - Undocumented member.
--
-- 'volumeAttachmentStatus', 'cachediSCSIVolume_volumeAttachmentStatus' - A value that indicates whether a storage volume is attached to or
-- detached from a gateway. For more information, see
-- <https://docs.aws.amazon.com/storagegateway/latest/userguide/managing-volumes.html#attach-detach-volume Moving your volumes to a different gateway>.
--
-- 'volumeARN', 'cachediSCSIVolume_volumeARN' - The Amazon Resource Name (ARN) of the storage volume.
--
-- 'volumeProgress', 'cachediSCSIVolume_volumeProgress' - Represents the percentage complete if the volume is restoring or
-- bootstrapping that represents the percent of data transferred. This
-- field does not appear in the response if the cached volume is not
-- restoring or bootstrapping.
--
-- 'volumeSizeInBytes', 'cachediSCSIVolume_volumeSizeInBytes' - The size, in bytes, of the volume capacity.
--
-- 'volumeUsedInBytes', 'cachediSCSIVolume_volumeUsedInBytes' - The size of the data stored on the volume in bytes. This value is
-- calculated based on the number of blocks that are touched, instead of
-- the actual amount of data written. This value can be useful for
-- sequential write patterns but less accurate for random write patterns.
-- @VolumeUsedInBytes@ is different from the compressed size of the volume,
-- which is the value that is used to calculate your bill.
--
-- This value is not available for volumes created prior to May 13, 2015,
-- until you store data on the volume.
--
-- 'createdDate', 'cachediSCSIVolume_createdDate' - The date the volume was created. Volumes created prior to March 28, 2017
-- don’t have this timestamp.
--
-- 'volumeId', 'cachediSCSIVolume_volumeId' - The unique identifier of the volume, e.g., vol-AE4B946D.
--
-- 'volumeType', 'cachediSCSIVolume_volumeType' - One of the VolumeType enumeration values that describes the type of the
-- volume.
--
-- 'targetName', 'cachediSCSIVolume_targetName' - The name of the iSCSI target used by an initiator to connect to a volume
-- and used as a suffix for the target ARN. For example, specifying
-- @TargetName@ as /myvolume/ results in the target ARN of
-- @arn:aws:storagegateway:us-east-2:111122223333:gateway\/sgw-12A3456B\/target\/iqn.1997-05.com.amazon:myvolume@.
-- The target name must be unique across all volumes on a gateway.
--
-- If you don\'t specify a value, Storage Gateway uses the value that was
-- previously used for this volume as the new target name.
newCachediSCSIVolume ::
  CachediSCSIVolume
newCachediSCSIVolume :: CachediSCSIVolume
newCachediSCSIVolume =
  CachediSCSIVolume' :: Maybe VolumeiSCSIAttributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CachediSCSIVolume
CachediSCSIVolume'
    { $sel:volumeiSCSIAttributes:CachediSCSIVolume' :: Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes =
        Maybe VolumeiSCSIAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeStatus:CachediSCSIVolume' :: Maybe Text
volumeStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceSnapshotId:CachediSCSIVolume' :: Maybe Text
sourceSnapshotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKey:CachediSCSIVolume' :: Maybe Text
kmsKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeAttachmentStatus:CachediSCSIVolume' :: Maybe Text
volumeAttachmentStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeARN:CachediSCSIVolume' :: Maybe Text
volumeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeProgress:CachediSCSIVolume' :: Maybe Double
volumeProgress = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSizeInBytes:CachediSCSIVolume' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeUsedInBytes:CachediSCSIVolume' :: Maybe Integer
volumeUsedInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:CachediSCSIVolume' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeId:CachediSCSIVolume' :: Maybe Text
volumeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:CachediSCSIVolume' :: Maybe Text
volumeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetName:CachediSCSIVolume' :: Maybe Text
targetName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | An VolumeiSCSIAttributes object that represents a collection of iSCSI
-- attributes for one stored volume.
cachediSCSIVolume_volumeiSCSIAttributes :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe VolumeiSCSIAttributes)
cachediSCSIVolume_volumeiSCSIAttributes :: (Maybe VolumeiSCSIAttributes -> f (Maybe VolumeiSCSIAttributes))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeiSCSIAttributes = (CachediSCSIVolume -> Maybe VolumeiSCSIAttributes)
-> (CachediSCSIVolume
    -> Maybe VolumeiSCSIAttributes -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume
     CachediSCSIVolume
     (Maybe VolumeiSCSIAttributes)
     (Maybe VolumeiSCSIAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes :: Maybe VolumeiSCSIAttributes
$sel:volumeiSCSIAttributes:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes} -> Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe VolumeiSCSIAttributes
a -> CachediSCSIVolume
s {$sel:volumeiSCSIAttributes:CachediSCSIVolume' :: Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes = Maybe VolumeiSCSIAttributes
a} :: CachediSCSIVolume)

-- | One of the VolumeStatus values that indicates the state of the storage
-- volume.
cachediSCSIVolume_volumeStatus :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Text)
cachediSCSIVolume_volumeStatus :: (Maybe Text -> f (Maybe Text))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeStatus = (CachediSCSIVolume -> Maybe Text)
-> (CachediSCSIVolume -> Maybe Text -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Text
volumeStatus :: Maybe Text
$sel:volumeStatus:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Text
volumeStatus} -> Maybe Text
volumeStatus) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Text
a -> CachediSCSIVolume
s {$sel:volumeStatus:CachediSCSIVolume' :: Maybe Text
volumeStatus = Maybe Text
a} :: CachediSCSIVolume)

-- | If the cached volume was created from a snapshot, this field contains
-- the snapshot ID used, e.g., snap-78e22663. Otherwise, this field is not
-- included.
cachediSCSIVolume_sourceSnapshotId :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Text)
cachediSCSIVolume_sourceSnapshotId :: (Maybe Text -> f (Maybe Text))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_sourceSnapshotId = (CachediSCSIVolume -> Maybe Text)
-> (CachediSCSIVolume -> Maybe Text -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Text
sourceSnapshotId :: Maybe Text
$sel:sourceSnapshotId:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Text
sourceSnapshotId} -> Maybe Text
sourceSnapshotId) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Text
a -> CachediSCSIVolume
s {$sel:sourceSnapshotId:CachediSCSIVolume' :: Maybe Text
sourceSnapshotId = Maybe Text
a} :: CachediSCSIVolume)

-- | Undocumented member.
cachediSCSIVolume_kmsKey :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Text)
cachediSCSIVolume_kmsKey :: (Maybe Text -> f (Maybe Text))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_kmsKey = (CachediSCSIVolume -> Maybe Text)
-> (CachediSCSIVolume -> Maybe Text -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Text
a -> CachediSCSIVolume
s {$sel:kmsKey:CachediSCSIVolume' :: Maybe Text
kmsKey = Maybe Text
a} :: CachediSCSIVolume)

-- | A value that indicates whether a storage volume is attached to or
-- detached from a gateway. For more information, see
-- <https://docs.aws.amazon.com/storagegateway/latest/userguide/managing-volumes.html#attach-detach-volume Moving your volumes to a different gateway>.
cachediSCSIVolume_volumeAttachmentStatus :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Text)
cachediSCSIVolume_volumeAttachmentStatus :: (Maybe Text -> f (Maybe Text))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeAttachmentStatus = (CachediSCSIVolume -> Maybe Text)
-> (CachediSCSIVolume -> Maybe Text -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Text
volumeAttachmentStatus :: Maybe Text
$sel:volumeAttachmentStatus:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Text
volumeAttachmentStatus} -> Maybe Text
volumeAttachmentStatus) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Text
a -> CachediSCSIVolume
s {$sel:volumeAttachmentStatus:CachediSCSIVolume' :: Maybe Text
volumeAttachmentStatus = Maybe Text
a} :: CachediSCSIVolume)

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

-- | Represents the percentage complete if the volume is restoring or
-- bootstrapping that represents the percent of data transferred. This
-- field does not appear in the response if the cached volume is not
-- restoring or bootstrapping.
cachediSCSIVolume_volumeProgress :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Double)
cachediSCSIVolume_volumeProgress :: (Maybe Double -> f (Maybe Double))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeProgress = (CachediSCSIVolume -> Maybe Double)
-> (CachediSCSIVolume -> Maybe Double -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Double
volumeProgress :: Maybe Double
$sel:volumeProgress:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Double
volumeProgress} -> Maybe Double
volumeProgress) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Double
a -> CachediSCSIVolume
s {$sel:volumeProgress:CachediSCSIVolume' :: Maybe Double
volumeProgress = Maybe Double
a} :: CachediSCSIVolume)

-- | The size, in bytes, of the volume capacity.
cachediSCSIVolume_volumeSizeInBytes :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Integer)
cachediSCSIVolume_volumeSizeInBytes :: (Maybe Integer -> f (Maybe Integer))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeSizeInBytes = (CachediSCSIVolume -> Maybe Integer)
-> (CachediSCSIVolume -> Maybe Integer -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Integer
volumeSizeInBytes :: Maybe Integer
$sel:volumeSizeInBytes:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Integer
volumeSizeInBytes} -> Maybe Integer
volumeSizeInBytes) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Integer
a -> CachediSCSIVolume
s {$sel:volumeSizeInBytes:CachediSCSIVolume' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
a} :: CachediSCSIVolume)

-- | The size of the data stored on the volume in bytes. This value is
-- calculated based on the number of blocks that are touched, instead of
-- the actual amount of data written. This value can be useful for
-- sequential write patterns but less accurate for random write patterns.
-- @VolumeUsedInBytes@ is different from the compressed size of the volume,
-- which is the value that is used to calculate your bill.
--
-- This value is not available for volumes created prior to May 13, 2015,
-- until you store data on the volume.
cachediSCSIVolume_volumeUsedInBytes :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Integer)
cachediSCSIVolume_volumeUsedInBytes :: (Maybe Integer -> f (Maybe Integer))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeUsedInBytes = (CachediSCSIVolume -> Maybe Integer)
-> (CachediSCSIVolume -> Maybe Integer -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Integer
volumeUsedInBytes :: Maybe Integer
$sel:volumeUsedInBytes:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Integer
volumeUsedInBytes} -> Maybe Integer
volumeUsedInBytes) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Integer
a -> CachediSCSIVolume
s {$sel:volumeUsedInBytes:CachediSCSIVolume' :: Maybe Integer
volumeUsedInBytes = Maybe Integer
a} :: CachediSCSIVolume)

-- | The date the volume was created. Volumes created prior to March 28, 2017
-- don’t have this timestamp.
cachediSCSIVolume_createdDate :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.UTCTime)
cachediSCSIVolume_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_createdDate = (CachediSCSIVolume -> Maybe POSIX)
-> (CachediSCSIVolume -> Maybe POSIX -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe POSIX
a -> CachediSCSIVolume
s {$sel:createdDate:CachediSCSIVolume' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: CachediSCSIVolume) ((Maybe POSIX -> f (Maybe POSIX))
 -> CachediSCSIVolume -> f CachediSCSIVolume)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CachediSCSIVolume
-> f CachediSCSIVolume
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The unique identifier of the volume, e.g., vol-AE4B946D.
cachediSCSIVolume_volumeId :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Text)
cachediSCSIVolume_volumeId :: (Maybe Text -> f (Maybe Text))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeId = (CachediSCSIVolume -> Maybe Text)
-> (CachediSCSIVolume -> Maybe Text -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Text
a -> CachediSCSIVolume
s {$sel:volumeId:CachediSCSIVolume' :: Maybe Text
volumeId = Maybe Text
a} :: CachediSCSIVolume)

-- | One of the VolumeType enumeration values that describes the type of the
-- volume.
cachediSCSIVolume_volumeType :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Text)
cachediSCSIVolume_volumeType :: (Maybe Text -> f (Maybe Text))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_volumeType = (CachediSCSIVolume -> Maybe Text)
-> (CachediSCSIVolume -> Maybe Text -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Text
volumeType :: Maybe Text
$sel:volumeType:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Text
volumeType} -> Maybe Text
volumeType) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Text
a -> CachediSCSIVolume
s {$sel:volumeType:CachediSCSIVolume' :: Maybe Text
volumeType = Maybe Text
a} :: CachediSCSIVolume)

-- | The name of the iSCSI target used by an initiator to connect to a volume
-- and used as a suffix for the target ARN. For example, specifying
-- @TargetName@ as /myvolume/ results in the target ARN of
-- @arn:aws:storagegateway:us-east-2:111122223333:gateway\/sgw-12A3456B\/target\/iqn.1997-05.com.amazon:myvolume@.
-- The target name must be unique across all volumes on a gateway.
--
-- If you don\'t specify a value, Storage Gateway uses the value that was
-- previously used for this volume as the new target name.
cachediSCSIVolume_targetName :: Lens.Lens' CachediSCSIVolume (Prelude.Maybe Prelude.Text)
cachediSCSIVolume_targetName :: (Maybe Text -> f (Maybe Text))
-> CachediSCSIVolume -> f CachediSCSIVolume
cachediSCSIVolume_targetName = (CachediSCSIVolume -> Maybe Text)
-> (CachediSCSIVolume -> Maybe Text -> CachediSCSIVolume)
-> Lens
     CachediSCSIVolume CachediSCSIVolume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachediSCSIVolume' {Maybe Text
targetName :: Maybe Text
$sel:targetName:CachediSCSIVolume' :: CachediSCSIVolume -> Maybe Text
targetName} -> Maybe Text
targetName) (\s :: CachediSCSIVolume
s@CachediSCSIVolume' {} Maybe Text
a -> CachediSCSIVolume
s {$sel:targetName:CachediSCSIVolume' :: Maybe Text
targetName = Maybe Text
a} :: CachediSCSIVolume)

instance Core.FromJSON CachediSCSIVolume where
  parseJSON :: Value -> Parser CachediSCSIVolume
parseJSON =
    String
-> (Object -> Parser CachediSCSIVolume)
-> Value
-> Parser CachediSCSIVolume
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CachediSCSIVolume"
      ( \Object
x ->
          Maybe VolumeiSCSIAttributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CachediSCSIVolume
CachediSCSIVolume'
            (Maybe VolumeiSCSIAttributes
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Double
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> CachediSCSIVolume)
-> Parser (Maybe VolumeiSCSIAttributes)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe VolumeiSCSIAttributes)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeiSCSIAttributes")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
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
"VolumeStatus")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
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
"SourceSnapshotId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
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
"KMSKey")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
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
"VolumeAttachmentStatus")
            Parser
  (Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
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
"VolumeARN")
            Parser
  (Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Double)
-> Parser
     (Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeProgress")
            Parser
  (Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CachediSCSIVolume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeSizeInBytes")
            Parser
  (Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CachediSCSIVolume)
-> Parser (Maybe Integer)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> Maybe Text -> CachediSCSIVolume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeUsedInBytes")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> Maybe Text -> CachediSCSIVolume)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> CachediSCSIVolume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedDate")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> CachediSCSIVolume)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> CachediSCSIVolume)
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
"VolumeId")
            Parser (Maybe Text -> Maybe Text -> CachediSCSIVolume)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CachediSCSIVolume)
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
"VolumeType")
            Parser (Maybe Text -> CachediSCSIVolume)
-> Parser (Maybe Text) -> Parser CachediSCSIVolume
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
"TargetName")
      )

instance Prelude.Hashable CachediSCSIVolume

instance Prelude.NFData CachediSCSIVolume