{-# 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.VolumeInfo
-- 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.VolumeInfo 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

-- | Describes a storage volume object.
--
-- /See:/ 'newVolumeInfo' smart constructor.
data VolumeInfo = VolumeInfo'
  { VolumeInfo -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier assigned to your gateway during activation. This
    -- ID becomes part of the gateway Amazon Resource Name (ARN), which you use
    -- as input for other operations.
    --
    -- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
    -- hyphens (-).
    VolumeInfo -> Maybe Text
gatewayId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the storage volume. For example, the
    -- following is a valid ARN:
    --
    -- @arn:aws:storagegateway:us-east-2:111122223333:gateway\/sgw-12A3456B\/volume\/vol-1122AABB@
    --
    -- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
    -- hyphens (-).
    VolumeInfo -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
    -- | One of the VolumeStatus values that indicates the state of the storage
    -- volume.
    VolumeInfo -> Maybe Text
volumeAttachmentStatus :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier assigned to the volume. This ID becomes part of
    -- the volume Amazon Resource Name (ARN), which you use as input for other
    -- operations.
    --
    -- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
    -- hyphens (-).
    VolumeInfo -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text,
    -- | The size of the volume in bytes.
    --
    -- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
    -- hyphens (-).
    VolumeInfo -> Maybe Integer
volumeSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | One of the VolumeType enumeration values describing the type of the
    -- volume.
    VolumeInfo -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text
  }
  deriving (VolumeInfo -> VolumeInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeInfo -> VolumeInfo -> Bool
$c/= :: VolumeInfo -> VolumeInfo -> Bool
== :: VolumeInfo -> VolumeInfo -> Bool
$c== :: VolumeInfo -> VolumeInfo -> Bool
Prelude.Eq, ReadPrec [VolumeInfo]
ReadPrec VolumeInfo
Int -> ReadS VolumeInfo
ReadS [VolumeInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeInfo]
$creadListPrec :: ReadPrec [VolumeInfo]
readPrec :: ReadPrec VolumeInfo
$creadPrec :: ReadPrec VolumeInfo
readList :: ReadS [VolumeInfo]
$creadList :: ReadS [VolumeInfo]
readsPrec :: Int -> ReadS VolumeInfo
$creadsPrec :: Int -> ReadS VolumeInfo
Prelude.Read, Int -> VolumeInfo -> ShowS
[VolumeInfo] -> ShowS
VolumeInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeInfo] -> ShowS
$cshowList :: [VolumeInfo] -> ShowS
show :: VolumeInfo -> String
$cshow :: VolumeInfo -> String
showsPrec :: Int -> VolumeInfo -> ShowS
$cshowsPrec :: Int -> VolumeInfo -> ShowS
Prelude.Show, forall x. Rep VolumeInfo x -> VolumeInfo
forall x. VolumeInfo -> Rep VolumeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeInfo x -> VolumeInfo
$cfrom :: forall x. VolumeInfo -> Rep VolumeInfo x
Prelude.Generic)

-- |
-- Create a value of 'VolumeInfo' 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:
--
-- 'gatewayARN', 'volumeInfo_gatewayARN' - Undocumented member.
--
-- 'gatewayId', 'volumeInfo_gatewayId' - The unique identifier assigned to your gateway during activation. This
-- ID becomes part of the gateway Amazon Resource Name (ARN), which you use
-- as input for other operations.
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
--
-- 'volumeARN', 'volumeInfo_volumeARN' - The Amazon Resource Name (ARN) for the storage volume. For example, the
-- following is a valid ARN:
--
-- @arn:aws:storagegateway:us-east-2:111122223333:gateway\/sgw-12A3456B\/volume\/vol-1122AABB@
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
--
-- 'volumeAttachmentStatus', 'volumeInfo_volumeAttachmentStatus' - One of the VolumeStatus values that indicates the state of the storage
-- volume.
--
-- 'volumeId', 'volumeInfo_volumeId' - The unique identifier assigned to the volume. This ID becomes part of
-- the volume Amazon Resource Name (ARN), which you use as input for other
-- operations.
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
--
-- 'volumeSizeInBytes', 'volumeInfo_volumeSizeInBytes' - The size of the volume in bytes.
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
--
-- 'volumeType', 'volumeInfo_volumeType' - One of the VolumeType enumeration values describing the type of the
-- volume.
newVolumeInfo ::
  VolumeInfo
newVolumeInfo :: VolumeInfo
newVolumeInfo =
  VolumeInfo'
    { $sel:gatewayARN:VolumeInfo' :: Maybe Text
gatewayARN = forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayId:VolumeInfo' :: Maybe Text
gatewayId = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeARN:VolumeInfo' :: Maybe Text
volumeARN = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeAttachmentStatus:VolumeInfo' :: Maybe Text
volumeAttachmentStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeId:VolumeInfo' :: Maybe Text
volumeId = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSizeInBytes:VolumeInfo' :: Maybe Integer
volumeSizeInBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:VolumeInfo' :: Maybe Text
volumeType = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The unique identifier assigned to your gateway during activation. This
-- ID becomes part of the gateway Amazon Resource Name (ARN), which you use
-- as input for other operations.
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
volumeInfo_gatewayId :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_gatewayId :: Lens' VolumeInfo (Maybe Text)
volumeInfo_gatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:VolumeInfo' :: VolumeInfo -> Maybe Text
gatewayId} -> Maybe Text
gatewayId) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:gatewayId:VolumeInfo' :: Maybe Text
gatewayId = Maybe Text
a} :: VolumeInfo)

-- | The Amazon Resource Name (ARN) for the storage volume. For example, the
-- following is a valid ARN:
--
-- @arn:aws:storagegateway:us-east-2:111122223333:gateway\/sgw-12A3456B\/volume\/vol-1122AABB@
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
volumeInfo_volumeARN :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeARN :: Lens' VolumeInfo (Maybe Text)
volumeInfo_volumeARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
volumeARN :: Maybe Text
$sel:volumeARN:VolumeInfo' :: VolumeInfo -> Maybe Text
volumeARN} -> Maybe Text
volumeARN) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:volumeARN:VolumeInfo' :: Maybe Text
volumeARN = Maybe Text
a} :: VolumeInfo)

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

-- | The unique identifier assigned to the volume. This ID becomes part of
-- the volume Amazon Resource Name (ARN), which you use as input for other
-- operations.
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
volumeInfo_volumeId :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeId :: Lens' VolumeInfo (Maybe Text)
volumeInfo_volumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:VolumeInfo' :: VolumeInfo -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:volumeId:VolumeInfo' :: Maybe Text
volumeId = Maybe Text
a} :: VolumeInfo)

-- | The size of the volume in bytes.
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
volumeInfo_volumeSizeInBytes :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Integer)
volumeInfo_volumeSizeInBytes :: Lens' VolumeInfo (Maybe Integer)
volumeInfo_volumeSizeInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Integer
volumeSizeInBytes :: Maybe Integer
$sel:volumeSizeInBytes:VolumeInfo' :: VolumeInfo -> Maybe Integer
volumeSizeInBytes} -> Maybe Integer
volumeSizeInBytes) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Integer
a -> VolumeInfo
s {$sel:volumeSizeInBytes:VolumeInfo' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
a} :: VolumeInfo)

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

instance Data.FromJSON VolumeInfo where
  parseJSON :: Value -> Parser VolumeInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VolumeInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> VolumeInfo
VolumeInfo'
            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
"GatewayARN")
            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
"GatewayId")
            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
"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
"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
"VolumeType")
      )

instance Prelude.Hashable VolumeInfo where
  hashWithSalt :: Int -> VolumeInfo -> Int
hashWithSalt Int
_salt VolumeInfo' {Maybe Integer
Maybe Text
volumeType :: Maybe Text
volumeSizeInBytes :: Maybe Integer
volumeId :: Maybe Text
volumeAttachmentStatus :: Maybe Text
volumeARN :: Maybe Text
gatewayId :: Maybe Text
gatewayARN :: Maybe Text
$sel:volumeType:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:volumeSizeInBytes:VolumeInfo' :: VolumeInfo -> Maybe Integer
$sel:volumeId:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:volumeAttachmentStatus:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:volumeARN:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:gatewayId:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:gatewayARN:VolumeInfo' :: VolumeInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayId
      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
volumeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
volumeSizeInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeType

instance Prelude.NFData VolumeInfo where
  rnf :: VolumeInfo -> ()
rnf VolumeInfo' {Maybe Integer
Maybe Text
volumeType :: Maybe Text
volumeSizeInBytes :: Maybe Integer
volumeId :: Maybe Text
volumeAttachmentStatus :: Maybe Text
volumeARN :: Maybe Text
gatewayId :: Maybe Text
gatewayARN :: Maybe Text
$sel:volumeType:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:volumeSizeInBytes:VolumeInfo' :: VolumeInfo -> Maybe Integer
$sel:volumeId:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:volumeAttachmentStatus:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:volumeARN:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:gatewayId:VolumeInfo' :: VolumeInfo -> Maybe Text
$sel:gatewayARN:VolumeInfo' :: VolumeInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayId
      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
volumeId
      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
volumeType