{-# 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.Omics.Types.FileInformation
-- 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.Omics.Types.FileInformation 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

-- | Details about a file.
--
-- /See:/ 'newFileInformation' smart constructor.
data FileInformation = FileInformation'
  { -- | The file\'s content length.
    FileInformation -> Maybe Natural
contentLength :: Prelude.Maybe Prelude.Natural,
    -- | The file\'s part size.
    FileInformation -> Maybe Natural
partSize :: Prelude.Maybe Prelude.Natural,
    -- | The file\'s total parts.
    FileInformation -> Maybe Natural
totalParts :: Prelude.Maybe Prelude.Natural
  }
  deriving (FileInformation -> FileInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileInformation -> FileInformation -> Bool
$c/= :: FileInformation -> FileInformation -> Bool
== :: FileInformation -> FileInformation -> Bool
$c== :: FileInformation -> FileInformation -> Bool
Prelude.Eq, ReadPrec [FileInformation]
ReadPrec FileInformation
Int -> ReadS FileInformation
ReadS [FileInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileInformation]
$creadListPrec :: ReadPrec [FileInformation]
readPrec :: ReadPrec FileInformation
$creadPrec :: ReadPrec FileInformation
readList :: ReadS [FileInformation]
$creadList :: ReadS [FileInformation]
readsPrec :: Int -> ReadS FileInformation
$creadsPrec :: Int -> ReadS FileInformation
Prelude.Read, Int -> FileInformation -> ShowS
[FileInformation] -> ShowS
FileInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileInformation] -> ShowS
$cshowList :: [FileInformation] -> ShowS
show :: FileInformation -> String
$cshow :: FileInformation -> String
showsPrec :: Int -> FileInformation -> ShowS
$cshowsPrec :: Int -> FileInformation -> ShowS
Prelude.Show, forall x. Rep FileInformation x -> FileInformation
forall x. FileInformation -> Rep FileInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FileInformation x -> FileInformation
$cfrom :: forall x. FileInformation -> Rep FileInformation x
Prelude.Generic)

-- |
-- Create a value of 'FileInformation' 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:
--
-- 'contentLength', 'fileInformation_contentLength' - The file\'s content length.
--
-- 'partSize', 'fileInformation_partSize' - The file\'s part size.
--
-- 'totalParts', 'fileInformation_totalParts' - The file\'s total parts.
newFileInformation ::
  FileInformation
newFileInformation :: FileInformation
newFileInformation =
  FileInformation'
    { $sel:contentLength:FileInformation' :: Maybe Natural
contentLength = forall a. Maybe a
Prelude.Nothing,
      $sel:partSize:FileInformation' :: Maybe Natural
partSize = forall a. Maybe a
Prelude.Nothing,
      $sel:totalParts:FileInformation' :: Maybe Natural
totalParts = forall a. Maybe a
Prelude.Nothing
    }

-- | The file\'s content length.
fileInformation_contentLength :: Lens.Lens' FileInformation (Prelude.Maybe Prelude.Natural)
fileInformation_contentLength :: Lens' FileInformation (Maybe Natural)
fileInformation_contentLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileInformation' {Maybe Natural
contentLength :: Maybe Natural
$sel:contentLength:FileInformation' :: FileInformation -> Maybe Natural
contentLength} -> Maybe Natural
contentLength) (\s :: FileInformation
s@FileInformation' {} Maybe Natural
a -> FileInformation
s {$sel:contentLength:FileInformation' :: Maybe Natural
contentLength = Maybe Natural
a} :: FileInformation)

-- | The file\'s part size.
fileInformation_partSize :: Lens.Lens' FileInformation (Prelude.Maybe Prelude.Natural)
fileInformation_partSize :: Lens' FileInformation (Maybe Natural)
fileInformation_partSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileInformation' {Maybe Natural
partSize :: Maybe Natural
$sel:partSize:FileInformation' :: FileInformation -> Maybe Natural
partSize} -> Maybe Natural
partSize) (\s :: FileInformation
s@FileInformation' {} Maybe Natural
a -> FileInformation
s {$sel:partSize:FileInformation' :: Maybe Natural
partSize = Maybe Natural
a} :: FileInformation)

-- | The file\'s total parts.
fileInformation_totalParts :: Lens.Lens' FileInformation (Prelude.Maybe Prelude.Natural)
fileInformation_totalParts :: Lens' FileInformation (Maybe Natural)
fileInformation_totalParts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileInformation' {Maybe Natural
totalParts :: Maybe Natural
$sel:totalParts:FileInformation' :: FileInformation -> Maybe Natural
totalParts} -> Maybe Natural
totalParts) (\s :: FileInformation
s@FileInformation' {} Maybe Natural
a -> FileInformation
s {$sel:totalParts:FileInformation' :: Maybe Natural
totalParts = Maybe Natural
a} :: FileInformation)

instance Data.FromJSON FileInformation where
  parseJSON :: Value -> Parser FileInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FileInformation"
      ( \Object
x ->
          Maybe Natural -> Maybe Natural -> Maybe Natural -> FileInformation
FileInformation'
            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
"contentLength")
            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
"partSize")
            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
"totalParts")
      )

instance Prelude.Hashable FileInformation where
  hashWithSalt :: Int -> FileInformation -> Int
hashWithSalt Int
_salt FileInformation' {Maybe Natural
totalParts :: Maybe Natural
partSize :: Maybe Natural
contentLength :: Maybe Natural
$sel:totalParts:FileInformation' :: FileInformation -> Maybe Natural
$sel:partSize:FileInformation' :: FileInformation -> Maybe Natural
$sel:contentLength:FileInformation' :: FileInformation -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
contentLength
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
partSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
totalParts

instance Prelude.NFData FileInformation where
  rnf :: FileInformation -> ()
rnf FileInformation' {Maybe Natural
totalParts :: Maybe Natural
partSize :: Maybe Natural
contentLength :: Maybe Natural
$sel:totalParts:FileInformation' :: FileInformation -> Maybe Natural
$sel:partSize:FileInformation' :: FileInformation -> Maybe Natural
$sel:contentLength:FileInformation' :: FileInformation -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
contentLength
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
partSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
totalParts