{-# 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.DataExchange.Types.S3SnapshotAsset
-- 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.DataExchange.Types.S3SnapshotAsset 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

-- | The Amazon S3 object that is the asset.
--
-- /See:/ 'newS3SnapshotAsset' smart constructor.
data S3SnapshotAsset = S3SnapshotAsset'
  { -- | The size of the Amazon S3 object that is the object.
    S3SnapshotAsset -> Double
size :: Prelude.Double
  }
  deriving (S3SnapshotAsset -> S3SnapshotAsset -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3SnapshotAsset -> S3SnapshotAsset -> Bool
$c/= :: S3SnapshotAsset -> S3SnapshotAsset -> Bool
== :: S3SnapshotAsset -> S3SnapshotAsset -> Bool
$c== :: S3SnapshotAsset -> S3SnapshotAsset -> Bool
Prelude.Eq, ReadPrec [S3SnapshotAsset]
ReadPrec S3SnapshotAsset
Int -> ReadS S3SnapshotAsset
ReadS [S3SnapshotAsset]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3SnapshotAsset]
$creadListPrec :: ReadPrec [S3SnapshotAsset]
readPrec :: ReadPrec S3SnapshotAsset
$creadPrec :: ReadPrec S3SnapshotAsset
readList :: ReadS [S3SnapshotAsset]
$creadList :: ReadS [S3SnapshotAsset]
readsPrec :: Int -> ReadS S3SnapshotAsset
$creadsPrec :: Int -> ReadS S3SnapshotAsset
Prelude.Read, Int -> S3SnapshotAsset -> ShowS
[S3SnapshotAsset] -> ShowS
S3SnapshotAsset -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3SnapshotAsset] -> ShowS
$cshowList :: [S3SnapshotAsset] -> ShowS
show :: S3SnapshotAsset -> String
$cshow :: S3SnapshotAsset -> String
showsPrec :: Int -> S3SnapshotAsset -> ShowS
$cshowsPrec :: Int -> S3SnapshotAsset -> ShowS
Prelude.Show, forall x. Rep S3SnapshotAsset x -> S3SnapshotAsset
forall x. S3SnapshotAsset -> Rep S3SnapshotAsset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3SnapshotAsset x -> S3SnapshotAsset
$cfrom :: forall x. S3SnapshotAsset -> Rep S3SnapshotAsset x
Prelude.Generic)

-- |
-- Create a value of 'S3SnapshotAsset' 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:
--
-- 'size', 's3SnapshotAsset_size' - The size of the Amazon S3 object that is the object.
newS3SnapshotAsset ::
  -- | 'size'
  Prelude.Double ->
  S3SnapshotAsset
newS3SnapshotAsset :: Double -> S3SnapshotAsset
newS3SnapshotAsset Double
pSize_ =
  S3SnapshotAsset' {$sel:size:S3SnapshotAsset' :: Double
size = Double
pSize_}

-- | The size of the Amazon S3 object that is the object.
s3SnapshotAsset_size :: Lens.Lens' S3SnapshotAsset Prelude.Double
s3SnapshotAsset_size :: Lens' S3SnapshotAsset Double
s3SnapshotAsset_size = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3SnapshotAsset' {Double
size :: Double
$sel:size:S3SnapshotAsset' :: S3SnapshotAsset -> Double
size} -> Double
size) (\s :: S3SnapshotAsset
s@S3SnapshotAsset' {} Double
a -> S3SnapshotAsset
s {$sel:size:S3SnapshotAsset' :: Double
size = Double
a} :: S3SnapshotAsset)

instance Data.FromJSON S3SnapshotAsset where
  parseJSON :: Value -> Parser S3SnapshotAsset
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"S3SnapshotAsset"
      ( \Object
x ->
          Double -> S3SnapshotAsset
S3SnapshotAsset' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Size")
      )

instance Prelude.Hashable S3SnapshotAsset where
  hashWithSalt :: Int -> S3SnapshotAsset -> Int
hashWithSalt Int
_salt S3SnapshotAsset' {Double
size :: Double
$sel:size:S3SnapshotAsset' :: S3SnapshotAsset -> Double
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
size

instance Prelude.NFData S3SnapshotAsset where
  rnf :: S3SnapshotAsset -> ()
rnf S3SnapshotAsset' {Double
size :: Double
$sel:size:S3SnapshotAsset' :: S3SnapshotAsset -> Double
..} = forall a. NFData a => a -> ()
Prelude.rnf Double
size