{-# 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.OpsWorks.Types.Volume
-- 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.OpsWorks.Types.Volume where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an instance\'s Amazon EBS volume.
--
-- /See:/ 'newVolume' smart constructor.
data Volume = Volume'
  { -- | The instance ID.
    Volume -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | The value returned by
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVolumes.html DescribeVolumes>.
    Volume -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The volume size.
    Volume -> Maybe Int
size :: Prelude.Maybe Prelude.Int,
    -- | For PIOPS volumes, the IOPS per disk.
    Volume -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
    -- | The device name.
    Volume -> Maybe Text
device :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether an Amazon EBS volume is encrypted. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html Amazon EBS Encryption>.
    Volume -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | The volume Availability Zone. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
    Volume -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The volume name.
    Volume -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The RAID array ID.
    Volume -> Maybe Text
raidArrayId :: Prelude.Maybe Prelude.Text,
    -- | The volume ID.
    Volume -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text,
    -- | The AWS region. For more information about AWS regions, see
    -- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
    Volume -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The volume type. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS Volume Types>.
    --
    -- -   @standard@ - Magnetic. Magnetic volumes must have a minimum size of
    --     1 GiB and a maximum size of 1024 GiB.
    --
    -- -   @io1@ - Provisioned IOPS (SSD). PIOPS volumes must have a minimum
    --     size of 4 GiB and a maximum size of 16384 GiB.
    --
    -- -   @gp2@ - General Purpose (SSD). General purpose volumes must have a
    --     minimum size of 1 GiB and a maximum size of 16384 GiB.
    --
    -- -   @st1@ - Throughput Optimized hard disk drive (HDD). Throughput
    --     optimized HDD volumes must have a minimum size of 500 GiB and a
    --     maximum size of 16384 GiB.
    --
    -- -   @sc1@ - Cold HDD. Cold HDD volumes must have a minimum size of 500
    --     GiB and a maximum size of 16384 GiB.
    Volume -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text,
    -- | The Amazon EC2 volume ID.
    Volume -> Maybe Text
ec2VolumeId :: Prelude.Maybe Prelude.Text,
    -- | The volume mount point. For example, \"\/mnt\/disk1\".
    Volume -> Maybe Text
mountPoint :: Prelude.Maybe Prelude.Text
  }
  deriving (Volume -> Volume -> Bool
(Volume -> Volume -> Bool)
-> (Volume -> Volume -> Bool) -> Eq Volume
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Volume -> Volume -> Bool
$c/= :: Volume -> Volume -> Bool
== :: Volume -> Volume -> Bool
$c== :: Volume -> Volume -> Bool
Prelude.Eq, ReadPrec [Volume]
ReadPrec Volume
Int -> ReadS Volume
ReadS [Volume]
(Int -> ReadS Volume)
-> ReadS [Volume]
-> ReadPrec Volume
-> ReadPrec [Volume]
-> Read Volume
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Volume]
$creadListPrec :: ReadPrec [Volume]
readPrec :: ReadPrec Volume
$creadPrec :: ReadPrec Volume
readList :: ReadS [Volume]
$creadList :: ReadS [Volume]
readsPrec :: Int -> ReadS Volume
$creadsPrec :: Int -> ReadS Volume
Prelude.Read, Int -> Volume -> ShowS
[Volume] -> ShowS
Volume -> String
(Int -> Volume -> ShowS)
-> (Volume -> String) -> ([Volume] -> ShowS) -> Show Volume
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Volume] -> ShowS
$cshowList :: [Volume] -> ShowS
show :: Volume -> String
$cshow :: Volume -> String
showsPrec :: Int -> Volume -> ShowS
$cshowsPrec :: Int -> Volume -> ShowS
Prelude.Show, (forall x. Volume -> Rep Volume x)
-> (forall x. Rep Volume x -> Volume) -> Generic Volume
forall x. Rep Volume x -> Volume
forall x. Volume -> Rep Volume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Volume x -> Volume
$cfrom :: forall x. Volume -> Rep Volume x
Prelude.Generic)

-- |
-- Create a value of 'Volume' 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:
--
-- 'instanceId', 'volume_instanceId' - The instance ID.
--
-- 'status', 'volume_status' - The value returned by
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVolumes.html DescribeVolumes>.
--
-- 'size', 'volume_size' - The volume size.
--
-- 'iops', 'volume_iops' - For PIOPS volumes, the IOPS per disk.
--
-- 'device', 'volume_device' - The device name.
--
-- 'encrypted', 'volume_encrypted' - Specifies whether an Amazon EBS volume is encrypted. For more
-- information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html Amazon EBS Encryption>.
--
-- 'availabilityZone', 'volume_availabilityZone' - The volume Availability Zone. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
--
-- 'name', 'volume_name' - The volume name.
--
-- 'raidArrayId', 'volume_raidArrayId' - The RAID array ID.
--
-- 'volumeId', 'volume_volumeId' - The volume ID.
--
-- 'region', 'volume_region' - The AWS region. For more information about AWS regions, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
--
-- 'volumeType', 'volume_volumeType' - The volume type. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS Volume Types>.
--
-- -   @standard@ - Magnetic. Magnetic volumes must have a minimum size of
--     1 GiB and a maximum size of 1024 GiB.
--
-- -   @io1@ - Provisioned IOPS (SSD). PIOPS volumes must have a minimum
--     size of 4 GiB and a maximum size of 16384 GiB.
--
-- -   @gp2@ - General Purpose (SSD). General purpose volumes must have a
--     minimum size of 1 GiB and a maximum size of 16384 GiB.
--
-- -   @st1@ - Throughput Optimized hard disk drive (HDD). Throughput
--     optimized HDD volumes must have a minimum size of 500 GiB and a
--     maximum size of 16384 GiB.
--
-- -   @sc1@ - Cold HDD. Cold HDD volumes must have a minimum size of 500
--     GiB and a maximum size of 16384 GiB.
--
-- 'ec2VolumeId', 'volume_ec2VolumeId' - The Amazon EC2 volume ID.
--
-- 'mountPoint', 'volume_mountPoint' - The volume mount point. For example, \"\/mnt\/disk1\".
newVolume ::
  Volume
newVolume :: Volume
newVolume =
  Volume' :: Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Volume
Volume'
    { $sel:instanceId:Volume' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:Volume' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:size:Volume' :: Maybe Int
size = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:iops:Volume' :: Maybe Int
iops = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:device:Volume' :: Maybe Text
device = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:Volume' :: Maybe Bool
encrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:Volume' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Volume' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:raidArrayId:Volume' :: Maybe Text
raidArrayId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeId:Volume' :: Maybe Text
volumeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:Volume' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:Volume' :: Maybe Text
volumeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2VolumeId:Volume' :: Maybe Text
ec2VolumeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mountPoint:Volume' :: Maybe Text
mountPoint = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The instance ID.
volume_instanceId :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_instanceId :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_instanceId = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:Volume' :: Volume -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:instanceId:Volume' :: Maybe Text
instanceId = Maybe Text
a} :: Volume)

-- | The value returned by
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVolumes.html DescribeVolumes>.
volume_status :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_status :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_status = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
status :: Maybe Text
$sel:status:Volume' :: Volume -> Maybe Text
status} -> Maybe Text
status) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:status:Volume' :: Maybe Text
status = Maybe Text
a} :: Volume)

-- | The volume size.
volume_size :: Lens.Lens' Volume (Prelude.Maybe Prelude.Int)
volume_size :: (Maybe Int -> f (Maybe Int)) -> Volume -> f Volume
volume_size = (Volume -> Maybe Int)
-> (Volume -> Maybe Int -> Volume)
-> Lens Volume Volume (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Int
size :: Maybe Int
$sel:size:Volume' :: Volume -> Maybe Int
size} -> Maybe Int
size) (\s :: Volume
s@Volume' {} Maybe Int
a -> Volume
s {$sel:size:Volume' :: Maybe Int
size = Maybe Int
a} :: Volume)

-- | For PIOPS volumes, the IOPS per disk.
volume_iops :: Lens.Lens' Volume (Prelude.Maybe Prelude.Int)
volume_iops :: (Maybe Int -> f (Maybe Int)) -> Volume -> f Volume
volume_iops = (Volume -> Maybe Int)
-> (Volume -> Maybe Int -> Volume)
-> Lens Volume Volume (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Int
iops :: Maybe Int
$sel:iops:Volume' :: Volume -> Maybe Int
iops} -> Maybe Int
iops) (\s :: Volume
s@Volume' {} Maybe Int
a -> Volume
s {$sel:iops:Volume' :: Maybe Int
iops = Maybe Int
a} :: Volume)

-- | The device name.
volume_device :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_device :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_device = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
device :: Maybe Text
$sel:device:Volume' :: Volume -> Maybe Text
device} -> Maybe Text
device) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:device:Volume' :: Maybe Text
device = Maybe Text
a} :: Volume)

-- | Specifies whether an Amazon EBS volume is encrypted. For more
-- information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html Amazon EBS Encryption>.
volume_encrypted :: Lens.Lens' Volume (Prelude.Maybe Prelude.Bool)
volume_encrypted :: (Maybe Bool -> f (Maybe Bool)) -> Volume -> f Volume
volume_encrypted = (Volume -> Maybe Bool)
-> (Volume -> Maybe Bool -> Volume)
-> Lens Volume Volume (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:Volume' :: Volume -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: Volume
s@Volume' {} Maybe Bool
a -> Volume
s {$sel:encrypted:Volume' :: Maybe Bool
encrypted = Maybe Bool
a} :: Volume)

-- | The volume Availability Zone. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
volume_availabilityZone :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_availabilityZone = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:Volume' :: Volume -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:availabilityZone:Volume' :: Maybe Text
availabilityZone = Maybe Text
a} :: Volume)

-- | The volume name.
volume_name :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_name :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_name = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
name :: Maybe Text
$sel:name:Volume' :: Volume -> Maybe Text
name} -> Maybe Text
name) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:name:Volume' :: Maybe Text
name = Maybe Text
a} :: Volume)

-- | The RAID array ID.
volume_raidArrayId :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_raidArrayId :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_raidArrayId = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
raidArrayId :: Maybe Text
$sel:raidArrayId:Volume' :: Volume -> Maybe Text
raidArrayId} -> Maybe Text
raidArrayId) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:raidArrayId:Volume' :: Maybe Text
raidArrayId = Maybe Text
a} :: Volume)

-- | The volume ID.
volume_volumeId :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_volumeId :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_volumeId = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:Volume' :: Volume -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:volumeId:Volume' :: Maybe Text
volumeId = Maybe Text
a} :: Volume)

-- | The AWS region. For more information about AWS regions, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
volume_region :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_region :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_region = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
region :: Maybe Text
$sel:region:Volume' :: Volume -> Maybe Text
region} -> Maybe Text
region) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:region:Volume' :: Maybe Text
region = Maybe Text
a} :: Volume)

-- | The volume type. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS Volume Types>.
--
-- -   @standard@ - Magnetic. Magnetic volumes must have a minimum size of
--     1 GiB and a maximum size of 1024 GiB.
--
-- -   @io1@ - Provisioned IOPS (SSD). PIOPS volumes must have a minimum
--     size of 4 GiB and a maximum size of 16384 GiB.
--
-- -   @gp2@ - General Purpose (SSD). General purpose volumes must have a
--     minimum size of 1 GiB and a maximum size of 16384 GiB.
--
-- -   @st1@ - Throughput Optimized hard disk drive (HDD). Throughput
--     optimized HDD volumes must have a minimum size of 500 GiB and a
--     maximum size of 16384 GiB.
--
-- -   @sc1@ - Cold HDD. Cold HDD volumes must have a minimum size of 500
--     GiB and a maximum size of 16384 GiB.
volume_volumeType :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_volumeType :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_volumeType = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
volumeType :: Maybe Text
$sel:volumeType:Volume' :: Volume -> Maybe Text
volumeType} -> Maybe Text
volumeType) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:volumeType:Volume' :: Maybe Text
volumeType = Maybe Text
a} :: Volume)

-- | The Amazon EC2 volume ID.
volume_ec2VolumeId :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_ec2VolumeId :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_ec2VolumeId = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
ec2VolumeId :: Maybe Text
$sel:ec2VolumeId:Volume' :: Volume -> Maybe Text
ec2VolumeId} -> Maybe Text
ec2VolumeId) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:ec2VolumeId:Volume' :: Maybe Text
ec2VolumeId = Maybe Text
a} :: Volume)

-- | The volume mount point. For example, \"\/mnt\/disk1\".
volume_mountPoint :: Lens.Lens' Volume (Prelude.Maybe Prelude.Text)
volume_mountPoint :: (Maybe Text -> f (Maybe Text)) -> Volume -> f Volume
volume_mountPoint = (Volume -> Maybe Text)
-> (Volume -> Maybe Text -> Volume)
-> Lens Volume Volume (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Volume' {Maybe Text
mountPoint :: Maybe Text
$sel:mountPoint:Volume' :: Volume -> Maybe Text
mountPoint} -> Maybe Text
mountPoint) (\s :: Volume
s@Volume' {} Maybe Text
a -> Volume
s {$sel:mountPoint:Volume' :: Maybe Text
mountPoint = Maybe Text
a} :: Volume)

instance Core.FromJSON Volume where
  parseJSON :: Value -> Parser Volume
parseJSON =
    String -> (Object -> Parser Volume) -> Value -> Parser Volume
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Volume"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Volume
Volume'
            (Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Volume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
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
"InstanceId")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
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
"Status")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Size")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Iops")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
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
"Device")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Encrypted")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
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
"AvailabilityZone")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Volume)
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
"Name")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Volume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Volume)
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
"RaidArrayId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Volume)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Volume)
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 -> Maybe Text -> Maybe Text -> Volume)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Volume)
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
"Region")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> Volume)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Volume)
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 -> Maybe Text -> Volume)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Volume)
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
"Ec2VolumeId")
            Parser (Maybe Text -> Volume)
-> Parser (Maybe Text) -> Parser Volume
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
"MountPoint")
      )

instance Prelude.Hashable Volume

instance Prelude.NFData Volume