{-# 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.StorediSCSIVolume
-- 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.StorediSCSIVolume 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.VolumeiSCSIAttributes

-- | Describes an iSCSI stored volume.
--
-- /See:/ 'newStorediSCSIVolume' smart constructor.
data StorediSCSIVolume = StorediSCSIVolume'
  { -- | The date the volume was created. Volumes created prior to March 28, 2017
    -- don’t have this timestamp.
    StorediSCSIVolume -> Maybe POSIX
createdDate :: Prelude.Maybe Data.POSIX,
    StorediSCSIVolume -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
    -- | Indicates if when the stored volume was created, existing data on the
    -- underlying local disk was preserved.
    --
    -- Valid Values: @true@ | @false@
    StorediSCSIVolume -> Maybe Bool
preservedExistingData :: Prelude.Maybe Prelude.Bool,
    -- | If the stored volume was created from a snapshot, this field contains
    -- the snapshot ID used, e.g. snap-78e22663. Otherwise, this field is not
    -- included.
    StorediSCSIVolume -> Maybe Text
sourceSnapshotId :: 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.
    StorediSCSIVolume -> Maybe Text
targetName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the storage volume.
    StorediSCSIVolume -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether a storage volume is attached to, detached
    -- from, or is in the process of detaching 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>.
    StorediSCSIVolume -> Maybe Text
volumeAttachmentStatus :: Prelude.Maybe Prelude.Text,
    -- | The ID of the local disk that was specified in the
    -- CreateStorediSCSIVolume operation.
    StorediSCSIVolume -> Maybe Text
volumeDiskId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the volume, e.g., vol-AE4B946D.
    StorediSCSIVolume -> Maybe Text
volumeId :: 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 stored volume is not
    -- restoring or bootstrapping.
    StorediSCSIVolume -> Maybe Double
volumeProgress :: Prelude.Maybe Prelude.Double,
    -- | The size of the volume in bytes.
    StorediSCSIVolume -> Maybe Integer
volumeSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | One of the VolumeStatus values that indicates the state of the storage
    -- volume.
    StorediSCSIVolume -> Maybe Text
volumeStatus :: Prelude.Maybe Prelude.Text,
    -- | One of the VolumeType enumeration values describing the type of the
    -- volume.
    StorediSCSIVolume -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text,
    -- | 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.
    StorediSCSIVolume -> Maybe Integer
volumeUsedInBytes :: Prelude.Maybe Prelude.Integer,
    -- | An VolumeiSCSIAttributes object that represents a collection of iSCSI
    -- attributes for one stored volume.
    StorediSCSIVolume -> Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes :: Prelude.Maybe VolumeiSCSIAttributes
  }
  deriving (StorediSCSIVolume -> StorediSCSIVolume -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StorediSCSIVolume -> StorediSCSIVolume -> Bool
$c/= :: StorediSCSIVolume -> StorediSCSIVolume -> Bool
== :: StorediSCSIVolume -> StorediSCSIVolume -> Bool
$c== :: StorediSCSIVolume -> StorediSCSIVolume -> Bool
Prelude.Eq, ReadPrec [StorediSCSIVolume]
ReadPrec StorediSCSIVolume
Int -> ReadS StorediSCSIVolume
ReadS [StorediSCSIVolume]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StorediSCSIVolume]
$creadListPrec :: ReadPrec [StorediSCSIVolume]
readPrec :: ReadPrec StorediSCSIVolume
$creadPrec :: ReadPrec StorediSCSIVolume
readList :: ReadS [StorediSCSIVolume]
$creadList :: ReadS [StorediSCSIVolume]
readsPrec :: Int -> ReadS StorediSCSIVolume
$creadsPrec :: Int -> ReadS StorediSCSIVolume
Prelude.Read, Int -> StorediSCSIVolume -> ShowS
[StorediSCSIVolume] -> ShowS
StorediSCSIVolume -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StorediSCSIVolume] -> ShowS
$cshowList :: [StorediSCSIVolume] -> ShowS
show :: StorediSCSIVolume -> String
$cshow :: StorediSCSIVolume -> String
showsPrec :: Int -> StorediSCSIVolume -> ShowS
$cshowsPrec :: Int -> StorediSCSIVolume -> ShowS
Prelude.Show, forall x. Rep StorediSCSIVolume x -> StorediSCSIVolume
forall x. StorediSCSIVolume -> Rep StorediSCSIVolume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StorediSCSIVolume x -> StorediSCSIVolume
$cfrom :: forall x. StorediSCSIVolume -> Rep StorediSCSIVolume x
Prelude.Generic)

-- |
-- Create a value of 'StorediSCSIVolume' 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:
--
-- 'createdDate', 'storediSCSIVolume_createdDate' - The date the volume was created. Volumes created prior to March 28, 2017
-- don’t have this timestamp.
--
-- 'kmsKey', 'storediSCSIVolume_kmsKey' - Undocumented member.
--
-- 'preservedExistingData', 'storediSCSIVolume_preservedExistingData' - Indicates if when the stored volume was created, existing data on the
-- underlying local disk was preserved.
--
-- Valid Values: @true@ | @false@
--
-- 'sourceSnapshotId', 'storediSCSIVolume_sourceSnapshotId' - If the stored volume was created from a snapshot, this field contains
-- the snapshot ID used, e.g. snap-78e22663. Otherwise, this field is not
-- included.
--
-- 'targetName', 'storediSCSIVolume_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.
--
-- 'volumeARN', 'storediSCSIVolume_volumeARN' - The Amazon Resource Name (ARN) of the storage volume.
--
-- 'volumeAttachmentStatus', 'storediSCSIVolume_volumeAttachmentStatus' - A value that indicates whether a storage volume is attached to, detached
-- from, or is in the process of detaching 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>.
--
-- 'volumeDiskId', 'storediSCSIVolume_volumeDiskId' - The ID of the local disk that was specified in the
-- CreateStorediSCSIVolume operation.
--
-- 'volumeId', 'storediSCSIVolume_volumeId' - The unique identifier of the volume, e.g., vol-AE4B946D.
--
-- 'volumeProgress', 'storediSCSIVolume_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 stored volume is not
-- restoring or bootstrapping.
--
-- 'volumeSizeInBytes', 'storediSCSIVolume_volumeSizeInBytes' - The size of the volume in bytes.
--
-- 'volumeStatus', 'storediSCSIVolume_volumeStatus' - One of the VolumeStatus values that indicates the state of the storage
-- volume.
--
-- 'volumeType', 'storediSCSIVolume_volumeType' - One of the VolumeType enumeration values describing the type of the
-- volume.
--
-- 'volumeUsedInBytes', 'storediSCSIVolume_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.
--
-- 'volumeiSCSIAttributes', 'storediSCSIVolume_volumeiSCSIAttributes' - An VolumeiSCSIAttributes object that represents a collection of iSCSI
-- attributes for one stored volume.
newStorediSCSIVolume ::
  StorediSCSIVolume
newStorediSCSIVolume :: StorediSCSIVolume
newStorediSCSIVolume =
  StorediSCSIVolume'
    { $sel:createdDate:StorediSCSIVolume' :: Maybe POSIX
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKey:StorediSCSIVolume' :: Maybe Text
kmsKey = forall a. Maybe a
Prelude.Nothing,
      $sel:preservedExistingData:StorediSCSIVolume' :: Maybe Bool
preservedExistingData = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceSnapshotId:StorediSCSIVolume' :: Maybe Text
sourceSnapshotId = forall a. Maybe a
Prelude.Nothing,
      $sel:targetName:StorediSCSIVolume' :: Maybe Text
targetName = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeARN:StorediSCSIVolume' :: Maybe Text
volumeARN = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeAttachmentStatus:StorediSCSIVolume' :: Maybe Text
volumeAttachmentStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeDiskId:StorediSCSIVolume' :: Maybe Text
volumeDiskId = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeId:StorediSCSIVolume' :: Maybe Text
volumeId = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeProgress:StorediSCSIVolume' :: Maybe Double
volumeProgress = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSizeInBytes:StorediSCSIVolume' :: Maybe Integer
volumeSizeInBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeStatus:StorediSCSIVolume' :: Maybe Text
volumeStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:StorediSCSIVolume' :: Maybe Text
volumeType = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeUsedInBytes:StorediSCSIVolume' :: Maybe Integer
volumeUsedInBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeiSCSIAttributes:StorediSCSIVolume' :: Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes = forall a. Maybe a
Prelude.Nothing
    }

-- | The date the volume was created. Volumes created prior to March 28, 2017
-- don’t have this timestamp.
storediSCSIVolume_createdDate :: Lens.Lens' StorediSCSIVolume (Prelude.Maybe Prelude.UTCTime)
storediSCSIVolume_createdDate :: Lens' StorediSCSIVolume (Maybe UTCTime)
storediSCSIVolume_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorediSCSIVolume' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: StorediSCSIVolume
s@StorediSCSIVolume' {} Maybe POSIX
a -> StorediSCSIVolume
s {$sel:createdDate:StorediSCSIVolume' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: StorediSCSIVolume) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

-- | Indicates if when the stored volume was created, existing data on the
-- underlying local disk was preserved.
--
-- Valid Values: @true@ | @false@
storediSCSIVolume_preservedExistingData :: Lens.Lens' StorediSCSIVolume (Prelude.Maybe Prelude.Bool)
storediSCSIVolume_preservedExistingData :: Lens' StorediSCSIVolume (Maybe Bool)
storediSCSIVolume_preservedExistingData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorediSCSIVolume' {Maybe Bool
preservedExistingData :: Maybe Bool
$sel:preservedExistingData:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Bool
preservedExistingData} -> Maybe Bool
preservedExistingData) (\s :: StorediSCSIVolume
s@StorediSCSIVolume' {} Maybe Bool
a -> StorediSCSIVolume
s {$sel:preservedExistingData:StorediSCSIVolume' :: Maybe Bool
preservedExistingData = Maybe Bool
a} :: StorediSCSIVolume)

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

-- | 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.
storediSCSIVolume_targetName :: Lens.Lens' StorediSCSIVolume (Prelude.Maybe Prelude.Text)
storediSCSIVolume_targetName :: Lens' StorediSCSIVolume (Maybe Text)
storediSCSIVolume_targetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorediSCSIVolume' {Maybe Text
targetName :: Maybe Text
$sel:targetName:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
targetName} -> Maybe Text
targetName) (\s :: StorediSCSIVolume
s@StorediSCSIVolume' {} Maybe Text
a -> StorediSCSIVolume
s {$sel:targetName:StorediSCSIVolume' :: Maybe Text
targetName = Maybe Text
a} :: StorediSCSIVolume)

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

-- | A value that indicates whether a storage volume is attached to, detached
-- from, or is in the process of detaching 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>.
storediSCSIVolume_volumeAttachmentStatus :: Lens.Lens' StorediSCSIVolume (Prelude.Maybe Prelude.Text)
storediSCSIVolume_volumeAttachmentStatus :: Lens' StorediSCSIVolume (Maybe Text)
storediSCSIVolume_volumeAttachmentStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorediSCSIVolume' {Maybe Text
volumeAttachmentStatus :: Maybe Text
$sel:volumeAttachmentStatus:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
volumeAttachmentStatus} -> Maybe Text
volumeAttachmentStatus) (\s :: StorediSCSIVolume
s@StorediSCSIVolume' {} Maybe Text
a -> StorediSCSIVolume
s {$sel:volumeAttachmentStatus:StorediSCSIVolume' :: Maybe Text
volumeAttachmentStatus = Maybe Text
a} :: StorediSCSIVolume)

-- | The ID of the local disk that was specified in the
-- CreateStorediSCSIVolume operation.
storediSCSIVolume_volumeDiskId :: Lens.Lens' StorediSCSIVolume (Prelude.Maybe Prelude.Text)
storediSCSIVolume_volumeDiskId :: Lens' StorediSCSIVolume (Maybe Text)
storediSCSIVolume_volumeDiskId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorediSCSIVolume' {Maybe Text
volumeDiskId :: Maybe Text
$sel:volumeDiskId:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
volumeDiskId} -> Maybe Text
volumeDiskId) (\s :: StorediSCSIVolume
s@StorediSCSIVolume' {} Maybe Text
a -> StorediSCSIVolume
s {$sel:volumeDiskId:StorediSCSIVolume' :: Maybe Text
volumeDiskId = Maybe Text
a} :: StorediSCSIVolume)

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

-- | 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 stored volume is not
-- restoring or bootstrapping.
storediSCSIVolume_volumeProgress :: Lens.Lens' StorediSCSIVolume (Prelude.Maybe Prelude.Double)
storediSCSIVolume_volumeProgress :: Lens' StorediSCSIVolume (Maybe Double)
storediSCSIVolume_volumeProgress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorediSCSIVolume' {Maybe Double
volumeProgress :: Maybe Double
$sel:volumeProgress:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Double
volumeProgress} -> Maybe Double
volumeProgress) (\s :: StorediSCSIVolume
s@StorediSCSIVolume' {} Maybe Double
a -> StorediSCSIVolume
s {$sel:volumeProgress:StorediSCSIVolume' :: Maybe Double
volumeProgress = Maybe Double
a} :: StorediSCSIVolume)

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

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

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

-- | 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.
storediSCSIVolume_volumeUsedInBytes :: Lens.Lens' StorediSCSIVolume (Prelude.Maybe Prelude.Integer)
storediSCSIVolume_volumeUsedInBytes :: Lens' StorediSCSIVolume (Maybe Integer)
storediSCSIVolume_volumeUsedInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorediSCSIVolume' {Maybe Integer
volumeUsedInBytes :: Maybe Integer
$sel:volumeUsedInBytes:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Integer
volumeUsedInBytes} -> Maybe Integer
volumeUsedInBytes) (\s :: StorediSCSIVolume
s@StorediSCSIVolume' {} Maybe Integer
a -> StorediSCSIVolume
s {$sel:volumeUsedInBytes:StorediSCSIVolume' :: Maybe Integer
volumeUsedInBytes = Maybe Integer
a} :: StorediSCSIVolume)

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

instance Data.FromJSON StorediSCSIVolume where
  parseJSON :: Value -> Parser StorediSCSIVolume
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StorediSCSIVolume"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe VolumeiSCSIAttributes
-> StorediSCSIVolume
StorediSCSIVolume'
            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
"CreatedDate")
            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
"KMSKey")
            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
"PreservedExistingData")
            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
"SourceSnapshotId")
            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
"TargetName")
            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
"VolumeARN")
            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
"VolumeAttachmentStatus")
            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
"VolumeDiskId")
            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
"VolumeId")
            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
"VolumeProgress")
            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
"VolumeSizeInBytes")
            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
"VolumeStatus")
            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
"VolumeType")
            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
"VolumeUsedInBytes")
            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
"VolumeiSCSIAttributes")
      )

instance Prelude.Hashable StorediSCSIVolume where
  hashWithSalt :: Int -> StorediSCSIVolume -> Int
hashWithSalt Int
_salt StorediSCSIVolume' {Maybe Bool
Maybe Double
Maybe Integer
Maybe Text
Maybe POSIX
Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes :: Maybe VolumeiSCSIAttributes
volumeUsedInBytes :: Maybe Integer
volumeType :: Maybe Text
volumeStatus :: Maybe Text
volumeSizeInBytes :: Maybe Integer
volumeProgress :: Maybe Double
volumeId :: Maybe Text
volumeDiskId :: Maybe Text
volumeAttachmentStatus :: Maybe Text
volumeARN :: Maybe Text
targetName :: Maybe Text
sourceSnapshotId :: Maybe Text
preservedExistingData :: Maybe Bool
kmsKey :: Maybe Text
createdDate :: Maybe POSIX
$sel:volumeiSCSIAttributes:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe VolumeiSCSIAttributes
$sel:volumeUsedInBytes:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Integer
$sel:volumeType:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeStatus:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeSizeInBytes:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Integer
$sel:volumeProgress:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Double
$sel:volumeId:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeDiskId:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeAttachmentStatus:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeARN:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:targetName:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:sourceSnapshotId:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:preservedExistingData:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Bool
$sel:kmsKey:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:createdDate:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
preservedExistingData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceSnapshotId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeAttachmentStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeDiskId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
volumeProgress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
volumeSizeInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
volumeUsedInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes

instance Prelude.NFData StorediSCSIVolume where
  rnf :: StorediSCSIVolume -> ()
rnf StorediSCSIVolume' {Maybe Bool
Maybe Double
Maybe Integer
Maybe Text
Maybe POSIX
Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes :: Maybe VolumeiSCSIAttributes
volumeUsedInBytes :: Maybe Integer
volumeType :: Maybe Text
volumeStatus :: Maybe Text
volumeSizeInBytes :: Maybe Integer
volumeProgress :: Maybe Double
volumeId :: Maybe Text
volumeDiskId :: Maybe Text
volumeAttachmentStatus :: Maybe Text
volumeARN :: Maybe Text
targetName :: Maybe Text
sourceSnapshotId :: Maybe Text
preservedExistingData :: Maybe Bool
kmsKey :: Maybe Text
createdDate :: Maybe POSIX
$sel:volumeiSCSIAttributes:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe VolumeiSCSIAttributes
$sel:volumeUsedInBytes:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Integer
$sel:volumeType:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeStatus:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeSizeInBytes:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Integer
$sel:volumeProgress:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Double
$sel:volumeId:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeDiskId:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeAttachmentStatus:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:volumeARN:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:targetName:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:sourceSnapshotId:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:preservedExistingData:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Bool
$sel:kmsKey:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe Text
$sel:createdDate:StorediSCSIVolume' :: StorediSCSIVolume -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
preservedExistingData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceSnapshotId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeAttachmentStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeDiskId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
volumeProgress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
volumeSizeInBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
volumeUsedInBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VolumeiSCSIAttributes
volumeiSCSIAttributes