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

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

-- | The S3 object that is the asset.
--
-- /See:/ 'newS3SnapshotAsset' smart constructor.
data S3SnapshotAsset = S3SnapshotAsset'
  { -- | The size of the S3 object that is the object.
    S3SnapshotAsset -> Double
size :: Prelude.Double
  }
  deriving (S3SnapshotAsset -> S3SnapshotAsset -> Bool
(S3SnapshotAsset -> S3SnapshotAsset -> Bool)
-> (S3SnapshotAsset -> S3SnapshotAsset -> Bool)
-> Eq S3SnapshotAsset
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]
(Int -> ReadS S3SnapshotAsset)
-> ReadS [S3SnapshotAsset]
-> ReadPrec S3SnapshotAsset
-> ReadPrec [S3SnapshotAsset]
-> Read 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
(Int -> S3SnapshotAsset -> ShowS)
-> (S3SnapshotAsset -> String)
-> ([S3SnapshotAsset] -> ShowS)
-> Show S3SnapshotAsset
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. S3SnapshotAsset -> Rep S3SnapshotAsset x)
-> (forall x. Rep S3SnapshotAsset x -> S3SnapshotAsset)
-> Generic S3SnapshotAsset
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 S3 object that is the object.
newS3SnapshotAsset ::
  -- | 'size'
  Prelude.Double ->
  S3SnapshotAsset
newS3SnapshotAsset :: Double -> S3SnapshotAsset
newS3SnapshotAsset Double
pSize_ =
  S3SnapshotAsset' :: Double -> S3SnapshotAsset
S3SnapshotAsset' {$sel:size:S3SnapshotAsset' :: Double
size = Double
pSize_}

-- | The size of the S3 object that is the object.
s3SnapshotAsset_size :: Lens.Lens' S3SnapshotAsset Prelude.Double
s3SnapshotAsset_size :: (Double -> f Double) -> S3SnapshotAsset -> f S3SnapshotAsset
s3SnapshotAsset_size = (S3SnapshotAsset -> Double)
-> (S3SnapshotAsset -> Double -> S3SnapshotAsset)
-> Lens S3SnapshotAsset S3SnapshotAsset Double Double
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 Core.FromJSON S3SnapshotAsset where
  parseJSON :: Value -> Parser S3SnapshotAsset
parseJSON =
    String
-> (Object -> Parser S3SnapshotAsset)
-> Value
-> Parser S3SnapshotAsset
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"S3SnapshotAsset"
      ( \Object
x ->
          Double -> S3SnapshotAsset
S3SnapshotAsset' (Double -> S3SnapshotAsset)
-> Parser Double -> Parser S3SnapshotAsset
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Size")
      )

instance Prelude.Hashable S3SnapshotAsset

instance Prelude.NFData S3SnapshotAsset