{-# 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 #-}
module Amazonka.S3.Types.CORSConfiguration 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.CORSRule
data CORSConfiguration = CORSConfiguration'
{
CORSConfiguration -> [CORSRule]
cORSRules :: [CORSRule]
}
deriving (CORSConfiguration -> CORSConfiguration -> Bool
(CORSConfiguration -> CORSConfiguration -> Bool)
-> (CORSConfiguration -> CORSConfiguration -> Bool)
-> Eq CORSConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CORSConfiguration -> CORSConfiguration -> Bool
$c/= :: CORSConfiguration -> CORSConfiguration -> Bool
== :: CORSConfiguration -> CORSConfiguration -> Bool
$c== :: CORSConfiguration -> CORSConfiguration -> Bool
Prelude.Eq, ReadPrec [CORSConfiguration]
ReadPrec CORSConfiguration
Int -> ReadS CORSConfiguration
ReadS [CORSConfiguration]
(Int -> ReadS CORSConfiguration)
-> ReadS [CORSConfiguration]
-> ReadPrec CORSConfiguration
-> ReadPrec [CORSConfiguration]
-> Read CORSConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CORSConfiguration]
$creadListPrec :: ReadPrec [CORSConfiguration]
readPrec :: ReadPrec CORSConfiguration
$creadPrec :: ReadPrec CORSConfiguration
readList :: ReadS [CORSConfiguration]
$creadList :: ReadS [CORSConfiguration]
readsPrec :: Int -> ReadS CORSConfiguration
$creadsPrec :: Int -> ReadS CORSConfiguration
Prelude.Read, Int -> CORSConfiguration -> ShowS
[CORSConfiguration] -> ShowS
CORSConfiguration -> String
(Int -> CORSConfiguration -> ShowS)
-> (CORSConfiguration -> String)
-> ([CORSConfiguration] -> ShowS)
-> Show CORSConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CORSConfiguration] -> ShowS
$cshowList :: [CORSConfiguration] -> ShowS
show :: CORSConfiguration -> String
$cshow :: CORSConfiguration -> String
showsPrec :: Int -> CORSConfiguration -> ShowS
$cshowsPrec :: Int -> CORSConfiguration -> ShowS
Prelude.Show, (forall x. CORSConfiguration -> Rep CORSConfiguration x)
-> (forall x. Rep CORSConfiguration x -> CORSConfiguration)
-> Generic CORSConfiguration
forall x. Rep CORSConfiguration x -> CORSConfiguration
forall x. CORSConfiguration -> Rep CORSConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CORSConfiguration x -> CORSConfiguration
$cfrom :: forall x. CORSConfiguration -> Rep CORSConfiguration x
Prelude.Generic)
newCORSConfiguration ::
CORSConfiguration
newCORSConfiguration :: CORSConfiguration
newCORSConfiguration =
CORSConfiguration' :: [CORSRule] -> CORSConfiguration
CORSConfiguration' {$sel:cORSRules:CORSConfiguration' :: [CORSRule]
cORSRules = [CORSRule]
forall a. Monoid a => a
Prelude.mempty}
cORSConfiguration_cORSRules :: Lens.Lens' CORSConfiguration [CORSRule]
cORSConfiguration_cORSRules :: ([CORSRule] -> f [CORSRule])
-> CORSConfiguration -> f CORSConfiguration
cORSConfiguration_cORSRules = (CORSConfiguration -> [CORSRule])
-> (CORSConfiguration -> [CORSRule] -> CORSConfiguration)
-> Lens CORSConfiguration CORSConfiguration [CORSRule] [CORSRule]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CORSConfiguration' {[CORSRule]
cORSRules :: [CORSRule]
$sel:cORSRules:CORSConfiguration' :: CORSConfiguration -> [CORSRule]
cORSRules} -> [CORSRule]
cORSRules) (\s :: CORSConfiguration
s@CORSConfiguration' {} [CORSRule]
a -> CORSConfiguration
s {$sel:cORSRules:CORSConfiguration' :: [CORSRule]
cORSRules = [CORSRule]
a} :: CORSConfiguration) (([CORSRule] -> f [CORSRule])
-> CORSConfiguration -> f CORSConfiguration)
-> (([CORSRule] -> f [CORSRule]) -> [CORSRule] -> f [CORSRule])
-> ([CORSRule] -> f [CORSRule])
-> CORSConfiguration
-> f CORSConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CORSRule] -> f [CORSRule]) -> [CORSRule] -> f [CORSRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable CORSConfiguration
instance Prelude.NFData CORSConfiguration
instance Core.ToXML CORSConfiguration where
toXML :: CORSConfiguration -> XML
toXML CORSConfiguration' {[CORSRule]
cORSRules :: [CORSRule]
$sel:cORSRules:CORSConfiguration' :: CORSConfiguration -> [CORSRule]
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name -> [CORSRule] -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"CORSRule" [CORSRule]
cORSRules]