{-# 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.CommonPrefix where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data CommonPrefix = CommonPrefix'
{
CommonPrefix -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text
}
deriving (CommonPrefix -> CommonPrefix -> Bool
(CommonPrefix -> CommonPrefix -> Bool)
-> (CommonPrefix -> CommonPrefix -> Bool) -> Eq CommonPrefix
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommonPrefix -> CommonPrefix -> Bool
$c/= :: CommonPrefix -> CommonPrefix -> Bool
== :: CommonPrefix -> CommonPrefix -> Bool
$c== :: CommonPrefix -> CommonPrefix -> Bool
Prelude.Eq, ReadPrec [CommonPrefix]
ReadPrec CommonPrefix
Int -> ReadS CommonPrefix
ReadS [CommonPrefix]
(Int -> ReadS CommonPrefix)
-> ReadS [CommonPrefix]
-> ReadPrec CommonPrefix
-> ReadPrec [CommonPrefix]
-> Read CommonPrefix
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommonPrefix]
$creadListPrec :: ReadPrec [CommonPrefix]
readPrec :: ReadPrec CommonPrefix
$creadPrec :: ReadPrec CommonPrefix
readList :: ReadS [CommonPrefix]
$creadList :: ReadS [CommonPrefix]
readsPrec :: Int -> ReadS CommonPrefix
$creadsPrec :: Int -> ReadS CommonPrefix
Prelude.Read, Int -> CommonPrefix -> ShowS
[CommonPrefix] -> ShowS
CommonPrefix -> String
(Int -> CommonPrefix -> ShowS)
-> (CommonPrefix -> String)
-> ([CommonPrefix] -> ShowS)
-> Show CommonPrefix
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommonPrefix] -> ShowS
$cshowList :: [CommonPrefix] -> ShowS
show :: CommonPrefix -> String
$cshow :: CommonPrefix -> String
showsPrec :: Int -> CommonPrefix -> ShowS
$cshowsPrec :: Int -> CommonPrefix -> ShowS
Prelude.Show, (forall x. CommonPrefix -> Rep CommonPrefix x)
-> (forall x. Rep CommonPrefix x -> CommonPrefix)
-> Generic CommonPrefix
forall x. Rep CommonPrefix x -> CommonPrefix
forall x. CommonPrefix -> Rep CommonPrefix x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommonPrefix x -> CommonPrefix
$cfrom :: forall x. CommonPrefix -> Rep CommonPrefix x
Prelude.Generic)
newCommonPrefix ::
CommonPrefix
newCommonPrefix :: CommonPrefix
newCommonPrefix =
CommonPrefix' :: Maybe Text -> CommonPrefix
CommonPrefix' {$sel:prefix:CommonPrefix' :: Maybe Text
prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing}
commonPrefix_prefix :: Lens.Lens' CommonPrefix (Prelude.Maybe Prelude.Text)
commonPrefix_prefix :: (Maybe Text -> f (Maybe Text)) -> CommonPrefix -> f CommonPrefix
commonPrefix_prefix = (CommonPrefix -> Maybe Text)
-> (CommonPrefix -> Maybe Text -> CommonPrefix)
-> Lens CommonPrefix CommonPrefix (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommonPrefix' {Maybe Text
prefix :: Maybe Text
$sel:prefix:CommonPrefix' :: CommonPrefix -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: CommonPrefix
s@CommonPrefix' {} Maybe Text
a -> CommonPrefix
s {$sel:prefix:CommonPrefix' :: Maybe Text
prefix = Maybe Text
a} :: CommonPrefix)
instance Core.FromXML CommonPrefix where
parseXML :: [Node] -> Either String CommonPrefix
parseXML [Node]
x =
Maybe Text -> CommonPrefix
CommonPrefix' (Maybe Text -> CommonPrefix)
-> Either String (Maybe Text) -> Either String CommonPrefix
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Prefix")
instance Prelude.Hashable CommonPrefix
instance Prelude.NFData CommonPrefix