{-# 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.VolumeConfiguration
-- 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.OpsWorks.Types.VolumeConfiguration 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 an Amazon EBS volume configuration.
--
-- /See:/ 'newVolumeConfiguration' smart constructor.
data VolumeConfiguration = VolumeConfiguration'
  { -- | 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>.
    VolumeConfiguration -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | For PIOPS volumes, the IOPS per disk.
    VolumeConfiguration -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
    -- | The volume
    -- <http://en.wikipedia.org/wiki/Standard_RAID_levels RAID level>.
    VolumeConfiguration -> Maybe Int
raidLevel :: Prelude.Maybe Prelude.Int,
    -- | 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.
    VolumeConfiguration -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text,
    -- | The volume mount point. For example \"\/dev\/sdh\".
    VolumeConfiguration -> Text
mountPoint :: Prelude.Text,
    -- | The number of disks in the volume.
    VolumeConfiguration -> Int
numberOfDisks :: Prelude.Int,
    -- | The volume size.
    VolumeConfiguration -> Int
size :: Prelude.Int
  }
  deriving (VolumeConfiguration -> VolumeConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeConfiguration -> VolumeConfiguration -> Bool
$c/= :: VolumeConfiguration -> VolumeConfiguration -> Bool
== :: VolumeConfiguration -> VolumeConfiguration -> Bool
$c== :: VolumeConfiguration -> VolumeConfiguration -> Bool
Prelude.Eq, ReadPrec [VolumeConfiguration]
ReadPrec VolumeConfiguration
Int -> ReadS VolumeConfiguration
ReadS [VolumeConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeConfiguration]
$creadListPrec :: ReadPrec [VolumeConfiguration]
readPrec :: ReadPrec VolumeConfiguration
$creadPrec :: ReadPrec VolumeConfiguration
readList :: ReadS [VolumeConfiguration]
$creadList :: ReadS [VolumeConfiguration]
readsPrec :: Int -> ReadS VolumeConfiguration
$creadsPrec :: Int -> ReadS VolumeConfiguration
Prelude.Read, Int -> VolumeConfiguration -> ShowS
[VolumeConfiguration] -> ShowS
VolumeConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeConfiguration] -> ShowS
$cshowList :: [VolumeConfiguration] -> ShowS
show :: VolumeConfiguration -> String
$cshow :: VolumeConfiguration -> String
showsPrec :: Int -> VolumeConfiguration -> ShowS
$cshowsPrec :: Int -> VolumeConfiguration -> ShowS
Prelude.Show, forall x. Rep VolumeConfiguration x -> VolumeConfiguration
forall x. VolumeConfiguration -> Rep VolumeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeConfiguration x -> VolumeConfiguration
$cfrom :: forall x. VolumeConfiguration -> Rep VolumeConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'VolumeConfiguration' 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:
--
-- 'encrypted', 'volumeConfiguration_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>.
--
-- 'iops', 'volumeConfiguration_iops' - For PIOPS volumes, the IOPS per disk.
--
-- 'raidLevel', 'volumeConfiguration_raidLevel' - The volume
-- <http://en.wikipedia.org/wiki/Standard_RAID_levels RAID level>.
--
-- 'volumeType', 'volumeConfiguration_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.
--
-- 'mountPoint', 'volumeConfiguration_mountPoint' - The volume mount point. For example \"\/dev\/sdh\".
--
-- 'numberOfDisks', 'volumeConfiguration_numberOfDisks' - The number of disks in the volume.
--
-- 'size', 'volumeConfiguration_size' - The volume size.
newVolumeConfiguration ::
  -- | 'mountPoint'
  Prelude.Text ->
  -- | 'numberOfDisks'
  Prelude.Int ->
  -- | 'size'
  Prelude.Int ->
  VolumeConfiguration
newVolumeConfiguration :: Text -> Int -> Int -> VolumeConfiguration
newVolumeConfiguration
  Text
pMountPoint_
  Int
pNumberOfDisks_
  Int
pSize_ =
    VolumeConfiguration'
      { $sel:encrypted:VolumeConfiguration' :: Maybe Bool
encrypted = forall a. Maybe a
Prelude.Nothing,
        $sel:iops:VolumeConfiguration' :: Maybe Int
iops = forall a. Maybe a
Prelude.Nothing,
        $sel:raidLevel:VolumeConfiguration' :: Maybe Int
raidLevel = forall a. Maybe a
Prelude.Nothing,
        $sel:volumeType:VolumeConfiguration' :: Maybe Text
volumeType = forall a. Maybe a
Prelude.Nothing,
        $sel:mountPoint:VolumeConfiguration' :: Text
mountPoint = Text
pMountPoint_,
        $sel:numberOfDisks:VolumeConfiguration' :: Int
numberOfDisks = Int
pNumberOfDisks_,
        $sel:size:VolumeConfiguration' :: Int
size = Int
pSize_
      }

-- | 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>.
volumeConfiguration_encrypted :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Bool)
volumeConfiguration_encrypted :: Lens' VolumeConfiguration (Maybe Bool)
volumeConfiguration_encrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Bool
a -> VolumeConfiguration
s {$sel:encrypted:VolumeConfiguration' :: Maybe Bool
encrypted = Maybe Bool
a} :: VolumeConfiguration)

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

-- | The volume
-- <http://en.wikipedia.org/wiki/Standard_RAID_levels RAID level>.
volumeConfiguration_raidLevel :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_raidLevel :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_raidLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
raidLevel :: Maybe Int
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
raidLevel} -> Maybe Int
raidLevel) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:raidLevel:VolumeConfiguration' :: Maybe Int
raidLevel = Maybe Int
a} :: VolumeConfiguration)

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

-- | The volume mount point. For example \"\/dev\/sdh\".
volumeConfiguration_mountPoint :: Lens.Lens' VolumeConfiguration Prelude.Text
volumeConfiguration_mountPoint :: Lens' VolumeConfiguration Text
volumeConfiguration_mountPoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Text
mountPoint :: Text
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
mountPoint} -> Text
mountPoint) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Text
a -> VolumeConfiguration
s {$sel:mountPoint:VolumeConfiguration' :: Text
mountPoint = Text
a} :: VolumeConfiguration)

-- | The number of disks in the volume.
volumeConfiguration_numberOfDisks :: Lens.Lens' VolumeConfiguration Prelude.Int
volumeConfiguration_numberOfDisks :: Lens' VolumeConfiguration Int
volumeConfiguration_numberOfDisks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Int
numberOfDisks :: Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
numberOfDisks} -> Int
numberOfDisks) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Int
a -> VolumeConfiguration
s {$sel:numberOfDisks:VolumeConfiguration' :: Int
numberOfDisks = Int
a} :: VolumeConfiguration)

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

instance Data.FromJSON VolumeConfiguration where
  parseJSON :: Value -> Parser VolumeConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VolumeConfiguration"
      ( \Object
x ->
          Maybe Bool
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Text
-> Int
-> Int
-> VolumeConfiguration
VolumeConfiguration'
            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
"Encrypted")
            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
"Iops")
            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
"RaidLevel")
            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 a
Data..: Key
"MountPoint")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"NumberOfDisks")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Size")
      )

instance Prelude.Hashable VolumeConfiguration where
  hashWithSalt :: Int -> VolumeConfiguration -> Int
hashWithSalt Int
_salt VolumeConfiguration' {Int
Maybe Bool
Maybe Int
Maybe Text
Text
size :: Int
numberOfDisks :: Int
mountPoint :: Text
volumeType :: Maybe Text
raidLevel :: Maybe Int
iops :: Maybe Int
encrypted :: Maybe Bool
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encrypted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
iops
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
raidLevel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
mountPoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
numberOfDisks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
size

instance Prelude.NFData VolumeConfiguration where
  rnf :: VolumeConfiguration -> ()
rnf VolumeConfiguration' {Int
Maybe Bool
Maybe Int
Maybe Text
Text
size :: Int
numberOfDisks :: Int
mountPoint :: Text
volumeType :: Maybe Text
raidLevel :: Maybe Int
iops :: Maybe Int
encrypted :: Maybe Bool
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encrypted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
iops
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
raidLevel
      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 Text
mountPoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
numberOfDisks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
size

instance Data.ToJSON VolumeConfiguration where
  toJSON :: VolumeConfiguration -> Value
toJSON VolumeConfiguration' {Int
Maybe Bool
Maybe Int
Maybe Text
Text
size :: Int
numberOfDisks :: Int
mountPoint :: Text
volumeType :: Maybe Text
raidLevel :: Maybe Int
iops :: Maybe Int
encrypted :: Maybe Bool
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Encrypted" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
encrypted,
            (Key
"Iops" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
iops,
            (Key
"RaidLevel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
raidLevel,
            (Key
"VolumeType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
volumeType,
            forall a. a -> Maybe a
Prelude.Just (Key
"MountPoint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
mountPoint),
            forall a. a -> Maybe a
Prelude.Just (Key
"NumberOfDisks" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
numberOfDisks),
            forall a. a -> Maybe a
Prelude.Just (Key
"Size" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
size)
          ]
      )