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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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,
    -- | One of the VolumeStatus values that indicates the state of the storage
    -- volume.
    VolumeInfo -> Maybe Text
volumeAttachmentStatus :: 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,
    -- | 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,
    -- | 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 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,
    -- | One of the VolumeType enumeration values describing the type of the
    -- volume.
    VolumeInfo -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text
  }
  deriving (VolumeInfo -> VolumeInfo -> Bool
(VolumeInfo -> VolumeInfo -> Bool)
-> (VolumeInfo -> VolumeInfo -> Bool) -> Eq VolumeInfo
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]
(Int -> ReadS VolumeInfo)
-> ReadS [VolumeInfo]
-> ReadPrec VolumeInfo
-> ReadPrec [VolumeInfo]
-> Read 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
(Int -> VolumeInfo -> ShowS)
-> (VolumeInfo -> String)
-> ([VolumeInfo] -> ShowS)
-> Show VolumeInfo
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. VolumeInfo -> Rep VolumeInfo x)
-> (forall x. Rep VolumeInfo x -> VolumeInfo) -> Generic VolumeInfo
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.
--
-- 'volumeAttachmentStatus', 'volumeInfo_volumeAttachmentStatus' - One of the VolumeStatus values that indicates the state of the storage
-- volume.
--
-- '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 (-).
--
-- 'volumeSizeInBytes', 'volumeInfo_volumeSizeInBytes' - The size of the volume in bytes.
--
-- Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and
-- hyphens (-).
--
-- '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 (-).
--
-- '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 (-).
--
-- 'volumeType', 'volumeInfo_volumeType' - One of the VolumeType enumeration values describing the type of the
-- volume.
newVolumeInfo ::
  VolumeInfo
newVolumeInfo :: VolumeInfo
newVolumeInfo =
  VolumeInfo' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo
VolumeInfo'
    { $sel:gatewayARN:VolumeInfo' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeAttachmentStatus:VolumeInfo' :: Maybe Text
volumeAttachmentStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeARN:VolumeInfo' :: Maybe Text
volumeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSizeInBytes:VolumeInfo' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeId:VolumeInfo' :: Maybe Text
volumeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayId:VolumeInfo' :: Maybe Text
gatewayId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:VolumeInfo' :: Maybe Text
volumeType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
volumeInfo_gatewayARN :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_gatewayARN :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_gatewayARN = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
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)

-- | One of the VolumeStatus values that indicates the state of the storage
-- volume.
volumeInfo_volumeAttachmentStatus :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeAttachmentStatus :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeAttachmentStatus = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeARN = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Integer -> f (Maybe Integer)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeSizeInBytes = (VolumeInfo -> Maybe Integer)
-> (VolumeInfo -> Maybe Integer -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Integer) (Maybe Integer)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeId = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_gatewayId = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
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)

-- | One of the VolumeType enumeration values describing the type of the
-- volume.
volumeInfo_volumeType :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeType :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeType = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
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 Core.FromJSON VolumeInfo where
  parseJSON :: Value -> Parser VolumeInfo
parseJSON =
    String
-> (Object -> Parser VolumeInfo) -> Value -> Parser VolumeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VolumeInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo
VolumeInfo'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> VolumeInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> VolumeInfo)
forall (f :: * -> *) a b. Functor 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
"GatewayARN")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> VolumeInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> VolumeInfo)
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 Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> VolumeInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe Text -> Maybe Text -> Maybe Text -> VolumeInfo)
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 Integer
   -> Maybe Text -> Maybe Text -> Maybe Text -> VolumeInfo)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> VolumeInfo)
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 Text -> Maybe Text -> Maybe Text -> VolumeInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> VolumeInfo)
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 -> VolumeInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> VolumeInfo)
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
"GatewayId")
            Parser (Maybe Text -> VolumeInfo)
-> Parser (Maybe Text) -> Parser VolumeInfo
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")
      )

instance Prelude.Hashable VolumeInfo

instance Prelude.NFData VolumeInfo