{-# 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.CreateBucketConfiguration
-- 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.CreateBucketConfiguration 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

-- | The configuration information for the bucket.
--
-- /See:/ 'newCreateBucketConfiguration' smart constructor.
data CreateBucketConfiguration = CreateBucketConfiguration'
  { -- | Specifies the Region where the bucket will be created. If you don\'t
    -- specify a Region, the bucket is created in the US East (N. Virginia)
    -- Region (us-east-1).
    CreateBucketConfiguration -> Maybe LocationConstraint
locationConstraint :: Prelude.Maybe LocationConstraint
  }
  deriving (CreateBucketConfiguration -> CreateBucketConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBucketConfiguration -> CreateBucketConfiguration -> Bool
$c/= :: CreateBucketConfiguration -> CreateBucketConfiguration -> Bool
== :: CreateBucketConfiguration -> CreateBucketConfiguration -> Bool
$c== :: CreateBucketConfiguration -> CreateBucketConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateBucketConfiguration]
ReadPrec CreateBucketConfiguration
Int -> ReadS CreateBucketConfiguration
ReadS [CreateBucketConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBucketConfiguration]
$creadListPrec :: ReadPrec [CreateBucketConfiguration]
readPrec :: ReadPrec CreateBucketConfiguration
$creadPrec :: ReadPrec CreateBucketConfiguration
readList :: ReadS [CreateBucketConfiguration]
$creadList :: ReadS [CreateBucketConfiguration]
readsPrec :: Int -> ReadS CreateBucketConfiguration
$creadsPrec :: Int -> ReadS CreateBucketConfiguration
Prelude.Read, Int -> CreateBucketConfiguration -> ShowS
[CreateBucketConfiguration] -> ShowS
CreateBucketConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBucketConfiguration] -> ShowS
$cshowList :: [CreateBucketConfiguration] -> ShowS
show :: CreateBucketConfiguration -> String
$cshow :: CreateBucketConfiguration -> String
showsPrec :: Int -> CreateBucketConfiguration -> ShowS
$cshowsPrec :: Int -> CreateBucketConfiguration -> ShowS
Prelude.Show, forall x.
Rep CreateBucketConfiguration x -> CreateBucketConfiguration
forall x.
CreateBucketConfiguration -> Rep CreateBucketConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateBucketConfiguration x -> CreateBucketConfiguration
$cfrom :: forall x.
CreateBucketConfiguration -> Rep CreateBucketConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateBucketConfiguration' 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:
--
-- 'locationConstraint', 'createBucketConfiguration_locationConstraint' - Specifies the Region where the bucket will be created. If you don\'t
-- specify a Region, the bucket is created in the US East (N. Virginia)
-- Region (us-east-1).
newCreateBucketConfiguration ::
  CreateBucketConfiguration
newCreateBucketConfiguration :: CreateBucketConfiguration
newCreateBucketConfiguration =
  CreateBucketConfiguration'
    { $sel:locationConstraint:CreateBucketConfiguration' :: Maybe LocationConstraint
locationConstraint =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the Region where the bucket will be created. If you don\'t
-- specify a Region, the bucket is created in the US East (N. Virginia)
-- Region (us-east-1).
createBucketConfiguration_locationConstraint :: Lens.Lens' CreateBucketConfiguration (Prelude.Maybe LocationConstraint)
createBucketConfiguration_locationConstraint :: Lens' CreateBucketConfiguration (Maybe LocationConstraint)
createBucketConfiguration_locationConstraint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucketConfiguration' {Maybe LocationConstraint
locationConstraint :: Maybe LocationConstraint
$sel:locationConstraint:CreateBucketConfiguration' :: CreateBucketConfiguration -> Maybe LocationConstraint
locationConstraint} -> Maybe LocationConstraint
locationConstraint) (\s :: CreateBucketConfiguration
s@CreateBucketConfiguration' {} Maybe LocationConstraint
a -> CreateBucketConfiguration
s {$sel:locationConstraint:CreateBucketConfiguration' :: Maybe LocationConstraint
locationConstraint = Maybe LocationConstraint
a} :: CreateBucketConfiguration)

instance Prelude.Hashable CreateBucketConfiguration where
  hashWithSalt :: Int -> CreateBucketConfiguration -> Int
hashWithSalt Int
_salt CreateBucketConfiguration' {Maybe LocationConstraint
locationConstraint :: Maybe LocationConstraint
$sel:locationConstraint:CreateBucketConfiguration' :: CreateBucketConfiguration -> Maybe LocationConstraint
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LocationConstraint
locationConstraint

instance Prelude.NFData CreateBucketConfiguration where
  rnf :: CreateBucketConfiguration -> ()
rnf CreateBucketConfiguration' {Maybe LocationConstraint
locationConstraint :: Maybe LocationConstraint
$sel:locationConstraint:CreateBucketConfiguration' :: CreateBucketConfiguration -> Maybe LocationConstraint
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LocationConstraint
locationConstraint

instance Data.ToXML CreateBucketConfiguration where
  toXML :: CreateBucketConfiguration -> XML
toXML CreateBucketConfiguration' {Maybe LocationConstraint
locationConstraint :: Maybe LocationConstraint
$sel:locationConstraint:CreateBucketConfiguration' :: CreateBucketConfiguration -> Maybe LocationConstraint
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [Name
"LocationConstraint" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe LocationConstraint
locationConstraint]