{-# 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.RequestPaymentConfiguration
-- 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.S3.Types.RequestPaymentConfiguration 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
import Amazonka.S3.Internal
import Amazonka.S3.Types.Payer

-- | Container for Payer.
--
-- /See:/ 'newRequestPaymentConfiguration' smart constructor.
data RequestPaymentConfiguration = RequestPaymentConfiguration'
  { -- | Specifies who pays for the download and request fees.
    RequestPaymentConfiguration -> Payer
payer :: Payer
  }
  deriving (RequestPaymentConfiguration -> RequestPaymentConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequestPaymentConfiguration -> RequestPaymentConfiguration -> Bool
$c/= :: RequestPaymentConfiguration -> RequestPaymentConfiguration -> Bool
== :: RequestPaymentConfiguration -> RequestPaymentConfiguration -> Bool
$c== :: RequestPaymentConfiguration -> RequestPaymentConfiguration -> Bool
Prelude.Eq, ReadPrec [RequestPaymentConfiguration]
ReadPrec RequestPaymentConfiguration
Int -> ReadS RequestPaymentConfiguration
ReadS [RequestPaymentConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RequestPaymentConfiguration]
$creadListPrec :: ReadPrec [RequestPaymentConfiguration]
readPrec :: ReadPrec RequestPaymentConfiguration
$creadPrec :: ReadPrec RequestPaymentConfiguration
readList :: ReadS [RequestPaymentConfiguration]
$creadList :: ReadS [RequestPaymentConfiguration]
readsPrec :: Int -> ReadS RequestPaymentConfiguration
$creadsPrec :: Int -> ReadS RequestPaymentConfiguration
Prelude.Read, Int -> RequestPaymentConfiguration -> ShowS
[RequestPaymentConfiguration] -> ShowS
RequestPaymentConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequestPaymentConfiguration] -> ShowS
$cshowList :: [RequestPaymentConfiguration] -> ShowS
show :: RequestPaymentConfiguration -> String
$cshow :: RequestPaymentConfiguration -> String
showsPrec :: Int -> RequestPaymentConfiguration -> ShowS
$cshowsPrec :: Int -> RequestPaymentConfiguration -> ShowS
Prelude.Show, forall x.
Rep RequestPaymentConfiguration x -> RequestPaymentConfiguration
forall x.
RequestPaymentConfiguration -> Rep RequestPaymentConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RequestPaymentConfiguration x -> RequestPaymentConfiguration
$cfrom :: forall x.
RequestPaymentConfiguration -> Rep RequestPaymentConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'RequestPaymentConfiguration' 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:
--
-- 'payer', 'requestPaymentConfiguration_payer' - Specifies who pays for the download and request fees.
newRequestPaymentConfiguration ::
  -- | 'payer'
  Payer ->
  RequestPaymentConfiguration
newRequestPaymentConfiguration :: Payer -> RequestPaymentConfiguration
newRequestPaymentConfiguration Payer
pPayer_ =
  RequestPaymentConfiguration' {$sel:payer:RequestPaymentConfiguration' :: Payer
payer = Payer
pPayer_}

-- | Specifies who pays for the download and request fees.
requestPaymentConfiguration_payer :: Lens.Lens' RequestPaymentConfiguration Payer
requestPaymentConfiguration_payer :: Lens' RequestPaymentConfiguration Payer
requestPaymentConfiguration_payer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestPaymentConfiguration' {Payer
payer :: Payer
$sel:payer:RequestPaymentConfiguration' :: RequestPaymentConfiguration -> Payer
payer} -> Payer
payer) (\s :: RequestPaymentConfiguration
s@RequestPaymentConfiguration' {} Payer
a -> RequestPaymentConfiguration
s {$sel:payer:RequestPaymentConfiguration' :: Payer
payer = Payer
a} :: RequestPaymentConfiguration)

instance Prelude.Hashable RequestPaymentConfiguration where
  hashWithSalt :: Int -> RequestPaymentConfiguration -> Int
hashWithSalt Int
_salt RequestPaymentConfiguration' {Payer
payer :: Payer
$sel:payer:RequestPaymentConfiguration' :: RequestPaymentConfiguration -> Payer
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Payer
payer

instance Prelude.NFData RequestPaymentConfiguration where
  rnf :: RequestPaymentConfiguration -> ()
rnf RequestPaymentConfiguration' {Payer
payer :: Payer
$sel:payer:RequestPaymentConfiguration' :: RequestPaymentConfiguration -> Payer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Payer
payer

instance Data.ToXML RequestPaymentConfiguration where
  toXML :: RequestPaymentConfiguration -> XML
toXML RequestPaymentConfiguration' {Payer
payer :: Payer
$sel:payer:RequestPaymentConfiguration' :: RequestPaymentConfiguration -> Payer
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"Payer" forall a. ToXML a => Name -> a -> XML
Data.@= Payer
payer]