{-# 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.S3.Types.AccelerateConfiguration
-- 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.S3.Types.AccelerateConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.BucketAccelerateStatus

-- | Configures the transfer acceleration state for an Amazon S3 bucket. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html Amazon S3 Transfer Acceleration>
-- in the /Amazon S3 User Guide/.
--
-- /See:/ 'newAccelerateConfiguration' smart constructor.
data AccelerateConfiguration = AccelerateConfiguration'
  { -- | Specifies the transfer acceleration status of the bucket.
    AccelerateConfiguration -> Maybe BucketAccelerateStatus
status :: Prelude.Maybe BucketAccelerateStatus
  }
  deriving (AccelerateConfiguration -> AccelerateConfiguration -> Bool
(AccelerateConfiguration -> AccelerateConfiguration -> Bool)
-> (AccelerateConfiguration -> AccelerateConfiguration -> Bool)
-> Eq AccelerateConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerateConfiguration -> AccelerateConfiguration -> Bool
$c/= :: AccelerateConfiguration -> AccelerateConfiguration -> Bool
== :: AccelerateConfiguration -> AccelerateConfiguration -> Bool
$c== :: AccelerateConfiguration -> AccelerateConfiguration -> Bool
Prelude.Eq, ReadPrec [AccelerateConfiguration]
ReadPrec AccelerateConfiguration
Int -> ReadS AccelerateConfiguration
ReadS [AccelerateConfiguration]
(Int -> ReadS AccelerateConfiguration)
-> ReadS [AccelerateConfiguration]
-> ReadPrec AccelerateConfiguration
-> ReadPrec [AccelerateConfiguration]
-> Read AccelerateConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccelerateConfiguration]
$creadListPrec :: ReadPrec [AccelerateConfiguration]
readPrec :: ReadPrec AccelerateConfiguration
$creadPrec :: ReadPrec AccelerateConfiguration
readList :: ReadS [AccelerateConfiguration]
$creadList :: ReadS [AccelerateConfiguration]
readsPrec :: Int -> ReadS AccelerateConfiguration
$creadsPrec :: Int -> ReadS AccelerateConfiguration
Prelude.Read, Int -> AccelerateConfiguration -> ShowS
[AccelerateConfiguration] -> ShowS
AccelerateConfiguration -> String
(Int -> AccelerateConfiguration -> ShowS)
-> (AccelerateConfiguration -> String)
-> ([AccelerateConfiguration] -> ShowS)
-> Show AccelerateConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccelerateConfiguration] -> ShowS
$cshowList :: [AccelerateConfiguration] -> ShowS
show :: AccelerateConfiguration -> String
$cshow :: AccelerateConfiguration -> String
showsPrec :: Int -> AccelerateConfiguration -> ShowS
$cshowsPrec :: Int -> AccelerateConfiguration -> ShowS
Prelude.Show, (forall x.
 AccelerateConfiguration -> Rep AccelerateConfiguration x)
-> (forall x.
    Rep AccelerateConfiguration x -> AccelerateConfiguration)
-> Generic AccelerateConfiguration
forall x. Rep AccelerateConfiguration x -> AccelerateConfiguration
forall x. AccelerateConfiguration -> Rep AccelerateConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccelerateConfiguration x -> AccelerateConfiguration
$cfrom :: forall x. AccelerateConfiguration -> Rep AccelerateConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AccelerateConfiguration' 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:
--
-- 'status', 'accelerateConfiguration_status' - Specifies the transfer acceleration status of the bucket.
newAccelerateConfiguration ::
  AccelerateConfiguration
newAccelerateConfiguration :: AccelerateConfiguration
newAccelerateConfiguration =
  AccelerateConfiguration' :: Maybe BucketAccelerateStatus -> AccelerateConfiguration
AccelerateConfiguration' {$sel:status:AccelerateConfiguration' :: Maybe BucketAccelerateStatus
status = Maybe BucketAccelerateStatus
forall a. Maybe a
Prelude.Nothing}

-- | Specifies the transfer acceleration status of the bucket.
accelerateConfiguration_status :: Lens.Lens' AccelerateConfiguration (Prelude.Maybe BucketAccelerateStatus)
accelerateConfiguration_status :: (Maybe BucketAccelerateStatus -> f (Maybe BucketAccelerateStatus))
-> AccelerateConfiguration -> f AccelerateConfiguration
accelerateConfiguration_status = (AccelerateConfiguration -> Maybe BucketAccelerateStatus)
-> (AccelerateConfiguration
    -> Maybe BucketAccelerateStatus -> AccelerateConfiguration)
-> Lens
     AccelerateConfiguration
     AccelerateConfiguration
     (Maybe BucketAccelerateStatus)
     (Maybe BucketAccelerateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccelerateConfiguration' {Maybe BucketAccelerateStatus
status :: Maybe BucketAccelerateStatus
$sel:status:AccelerateConfiguration' :: AccelerateConfiguration -> Maybe BucketAccelerateStatus
status} -> Maybe BucketAccelerateStatus
status) (\s :: AccelerateConfiguration
s@AccelerateConfiguration' {} Maybe BucketAccelerateStatus
a -> AccelerateConfiguration
s {$sel:status:AccelerateConfiguration' :: Maybe BucketAccelerateStatus
status = Maybe BucketAccelerateStatus
a} :: AccelerateConfiguration)

instance Prelude.Hashable AccelerateConfiguration

instance Prelude.NFData AccelerateConfiguration

instance Core.ToXML AccelerateConfiguration where
  toXML :: AccelerateConfiguration -> XML
toXML AccelerateConfiguration' {Maybe BucketAccelerateStatus
status :: Maybe BucketAccelerateStatus
$sel:status:AccelerateConfiguration' :: AccelerateConfiguration -> Maybe BucketAccelerateStatus
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"Status" Name -> Maybe BucketAccelerateStatus -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe BucketAccelerateStatus
status]