{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:prefix:CommonPrefix' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing}
commonPrefix_prefix :: Lens.Lens' CommonPrefix (Prelude.Maybe Prelude.Text)
commonPrefix_prefix :: Lens' CommonPrefix (Maybe Text)
commonPrefix_prefix = 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 Data.FromXML CommonPrefix where
parseXML :: [Node] -> Either String CommonPrefix
parseXML [Node]
x =
Maybe Text -> CommonPrefix
CommonPrefix' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Prefix")
instance Prelude.Hashable CommonPrefix where
hashWithSalt :: Int -> CommonPrefix -> Int
hashWithSalt Int
_salt CommonPrefix' {Maybe Text
prefix :: Maybe Text
$sel:prefix:CommonPrefix' :: CommonPrefix -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefix
instance Prelude.NFData CommonPrefix where
rnf :: CommonPrefix -> ()
rnf CommonPrefix' {Maybe Text
prefix :: Maybe Text
$sel:prefix:CommonPrefix' :: CommonPrefix -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefix