{-# 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.SecurityHub.Types.AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-- 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.SecurityHub.Types.AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails where

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

-- | Information about what Amazon S3 does when a multipart upload is
-- incomplete.
--
-- /See:/ 'newAwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' smart constructor.
data AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails = AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails'
  { -- | The number of days after which Amazon S3 cancels an incomplete multipart
    -- upload.
    AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Maybe Int
daysAfterInitiation :: Prelude.Maybe Prelude.Int
  }
  deriving (AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Bool
(AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
 -> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
 -> Bool)
-> (AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
    -> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
    -> Bool)
-> Eq
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Bool
$c/= :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Bool
== :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Bool
$c== :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
ReadPrec
  AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
Int
-> ReadS
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
ReadS
  [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
(Int
 -> ReadS
      AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails)
-> ReadS
     [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
-> ReadPrec
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> ReadPrec
     [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
-> Read
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
$creadListPrec :: ReadPrec
  [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
readPrec :: ReadPrec
  AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
$creadPrec :: ReadPrec
  AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
readList :: ReadS
  [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
$creadList :: ReadS
  [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
readsPrec :: Int
-> ReadS
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
$creadsPrec :: Int
-> ReadS
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
Prelude.Read, Int
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> ShowS
[AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
-> ShowS
AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> String
(Int
 -> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
 -> ShowS)
-> (AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
    -> String)
-> ([AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
    -> ShowS)
-> Show
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
-> ShowS
$cshowList :: [AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails]
-> ShowS
show :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> String
$cshow :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> String
showsPrec :: Int
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> ShowS
$cshowsPrec :: Int
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> ShowS
Prelude.Show, (forall x.
 AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
 -> Rep
      AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
      x)
-> (forall x.
    Rep
      AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
      x
    -> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails)
-> Generic
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
forall x.
Rep
  AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
  x
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
forall x.
AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Rep
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
     x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep
  AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
  x
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
$cfrom :: forall x.
AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Rep
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
     x
Prelude.Generic)

-- |
-- Create a value of 'AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' 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:
--
-- 'daysAfterInitiation', 'awsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails_daysAfterInitiation' - The number of days after which Amazon S3 cancels an incomplete multipart
-- upload.
newAwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails ::
  AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
newAwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
newAwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails =
  AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' :: Maybe Int
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails'
    { $sel:daysAfterInitiation:AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' :: Maybe Int
daysAfterInitiation =
        Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of days after which Amazon S3 cancels an incomplete multipart
-- upload.
awsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails_daysAfterInitiation :: Lens.Lens' AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails (Prelude.Maybe Prelude.Int)
awsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails_daysAfterInitiation :: (Maybe Int -> f (Maybe Int))
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> f AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
awsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails_daysAfterInitiation = (AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
 -> Maybe Int)
-> (AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
    -> Maybe Int
    -> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails)
-> Lens
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' {Maybe Int
daysAfterInitiation :: Maybe Int
$sel:daysAfterInitiation:AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Maybe Int
daysAfterInitiation} -> Maybe Int
daysAfterInitiation) (\s :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
s@AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' {} Maybe Int
a -> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
s {$sel:daysAfterInitiation:AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' :: Maybe Int
daysAfterInitiation = Maybe Int
a} :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails)

instance
  Core.FromJSON
    AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
  where
  parseJSON :: Value
-> Parser
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
parseJSON =
    String
-> (Object
    -> Parser
         AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails)
-> Value
-> Parser
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails"
      ( \Object
x ->
          Maybe Int
-> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails'
            (Maybe Int
 -> AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails)
-> Parser (Maybe Int)
-> Parser
     AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
forall (f :: * -> *) a b. Functor 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
"DaysAfterInitiation")
      )

instance
  Prelude.Hashable
    AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails

instance
  Prelude.NFData
    AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails

instance
  Core.ToJSON
    AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
  where
  toJSON :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Value
toJSON
    AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' {Maybe Int
daysAfterInitiation :: Maybe Int
$sel:daysAfterInitiation:AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails' :: AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails
-> Maybe Int
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"DaysAfterInitiation" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
daysAfterInitiation
            ]
        )