{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.S3.Types.ObjectOwnership
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.S3.Types.ObjectOwnership
  ( ObjectOwnership
      ( ..,
        ObjectOwnership_BucketOwnerPreferred,
        ObjectOwnership_ObjectWriter
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal

-- | The container element for object ownership for a bucket\'s ownership
-- controls.
--
-- BucketOwnerPreferred - Objects uploaded to the bucket change ownership
-- to the bucket owner if the objects are uploaded with the
-- @bucket-owner-full-control@ canned ACL.
--
-- ObjectWriter - The uploading account will own the object if the object
-- is uploaded with the @bucket-owner-full-control@ canned ACL.
newtype ObjectOwnership = ObjectOwnership'
  { ObjectOwnership -> Text
fromObjectOwnership ::
      Core.Text
  }
  deriving stock
    ( Int -> ObjectOwnership -> ShowS
[ObjectOwnership] -> ShowS
ObjectOwnership -> String
(Int -> ObjectOwnership -> ShowS)
-> (ObjectOwnership -> String)
-> ([ObjectOwnership] -> ShowS)
-> Show ObjectOwnership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectOwnership] -> ShowS
$cshowList :: [ObjectOwnership] -> ShowS
show :: ObjectOwnership -> String
$cshow :: ObjectOwnership -> String
showsPrec :: Int -> ObjectOwnership -> ShowS
$cshowsPrec :: Int -> ObjectOwnership -> ShowS
Prelude.Show,
      ReadPrec [ObjectOwnership]
ReadPrec ObjectOwnership
Int -> ReadS ObjectOwnership
ReadS [ObjectOwnership]
(Int -> ReadS ObjectOwnership)
-> ReadS [ObjectOwnership]
-> ReadPrec ObjectOwnership
-> ReadPrec [ObjectOwnership]
-> Read ObjectOwnership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ObjectOwnership]
$creadListPrec :: ReadPrec [ObjectOwnership]
readPrec :: ReadPrec ObjectOwnership
$creadPrec :: ReadPrec ObjectOwnership
readList :: ReadS [ObjectOwnership]
$creadList :: ReadS [ObjectOwnership]
readsPrec :: Int -> ReadS ObjectOwnership
$creadsPrec :: Int -> ReadS ObjectOwnership
Prelude.Read,
      ObjectOwnership -> ObjectOwnership -> Bool
(ObjectOwnership -> ObjectOwnership -> Bool)
-> (ObjectOwnership -> ObjectOwnership -> Bool)
-> Eq ObjectOwnership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectOwnership -> ObjectOwnership -> Bool
$c/= :: ObjectOwnership -> ObjectOwnership -> Bool
== :: ObjectOwnership -> ObjectOwnership -> Bool
$c== :: ObjectOwnership -> ObjectOwnership -> Bool
Prelude.Eq,
      Eq ObjectOwnership
Eq ObjectOwnership
-> (ObjectOwnership -> ObjectOwnership -> Ordering)
-> (ObjectOwnership -> ObjectOwnership -> Bool)
-> (ObjectOwnership -> ObjectOwnership -> Bool)
-> (ObjectOwnership -> ObjectOwnership -> Bool)
-> (ObjectOwnership -> ObjectOwnership -> Bool)
-> (ObjectOwnership -> ObjectOwnership -> ObjectOwnership)
-> (ObjectOwnership -> ObjectOwnership -> ObjectOwnership)
-> Ord ObjectOwnership
ObjectOwnership -> ObjectOwnership -> Bool
ObjectOwnership -> ObjectOwnership -> Ordering
ObjectOwnership -> ObjectOwnership -> ObjectOwnership
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ObjectOwnership -> ObjectOwnership -> ObjectOwnership
$cmin :: ObjectOwnership -> ObjectOwnership -> ObjectOwnership
max :: ObjectOwnership -> ObjectOwnership -> ObjectOwnership
$cmax :: ObjectOwnership -> ObjectOwnership -> ObjectOwnership
>= :: ObjectOwnership -> ObjectOwnership -> Bool
$c>= :: ObjectOwnership -> ObjectOwnership -> Bool
> :: ObjectOwnership -> ObjectOwnership -> Bool
$c> :: ObjectOwnership -> ObjectOwnership -> Bool
<= :: ObjectOwnership -> ObjectOwnership -> Bool
$c<= :: ObjectOwnership -> ObjectOwnership -> Bool
< :: ObjectOwnership -> ObjectOwnership -> Bool
$c< :: ObjectOwnership -> ObjectOwnership -> Bool
compare :: ObjectOwnership -> ObjectOwnership -> Ordering
$ccompare :: ObjectOwnership -> ObjectOwnership -> Ordering
$cp1Ord :: Eq ObjectOwnership
Prelude.Ord,
      (forall x. ObjectOwnership -> Rep ObjectOwnership x)
-> (forall x. Rep ObjectOwnership x -> ObjectOwnership)
-> Generic ObjectOwnership
forall x. Rep ObjectOwnership x -> ObjectOwnership
forall x. ObjectOwnership -> Rep ObjectOwnership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ObjectOwnership x -> ObjectOwnership
$cfrom :: forall x. ObjectOwnership -> Rep ObjectOwnership x
Prelude.Generic
    )
  deriving newtype
    ( Int -> ObjectOwnership -> Int
ObjectOwnership -> Int
(Int -> ObjectOwnership -> Int)
-> (ObjectOwnership -> Int) -> Hashable ObjectOwnership
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ObjectOwnership -> Int
$chash :: ObjectOwnership -> Int
hashWithSalt :: Int -> ObjectOwnership -> Int
$chashWithSalt :: Int -> ObjectOwnership -> Int
Prelude.Hashable,
      ObjectOwnership -> ()
(ObjectOwnership -> ()) -> NFData ObjectOwnership
forall a. (a -> ()) -> NFData a
rnf :: ObjectOwnership -> ()
$crnf :: ObjectOwnership -> ()
Prelude.NFData,
      Text -> Either String ObjectOwnership
(Text -> Either String ObjectOwnership) -> FromText ObjectOwnership
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String ObjectOwnership
$cfromText :: Text -> Either String ObjectOwnership
Core.FromText,
      ObjectOwnership -> Text
(ObjectOwnership -> Text) -> ToText ObjectOwnership
forall a. (a -> Text) -> ToText a
toText :: ObjectOwnership -> Text
$ctoText :: ObjectOwnership -> Text
Core.ToText,
      ObjectOwnership -> ByteString
(ObjectOwnership -> ByteString) -> ToByteString ObjectOwnership
forall a. (a -> ByteString) -> ToByteString a
toBS :: ObjectOwnership -> ByteString
$ctoBS :: ObjectOwnership -> ByteString
Core.ToByteString,
      ObjectOwnership -> ByteStringBuilder
(ObjectOwnership -> ByteStringBuilder) -> ToLog ObjectOwnership
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: ObjectOwnership -> ByteStringBuilder
$cbuild :: ObjectOwnership -> ByteStringBuilder
Core.ToLog,
      HeaderName -> ObjectOwnership -> [Header]
(HeaderName -> ObjectOwnership -> [Header])
-> ToHeader ObjectOwnership
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> ObjectOwnership -> [Header]
$ctoHeader :: HeaderName -> ObjectOwnership -> [Header]
Core.ToHeader,
      ObjectOwnership -> QueryString
(ObjectOwnership -> QueryString) -> ToQuery ObjectOwnership
forall a. (a -> QueryString) -> ToQuery a
toQuery :: ObjectOwnership -> QueryString
$ctoQuery :: ObjectOwnership -> QueryString
Core.ToQuery,
      Value -> Parser [ObjectOwnership]
Value -> Parser ObjectOwnership
(Value -> Parser ObjectOwnership)
-> (Value -> Parser [ObjectOwnership]) -> FromJSON ObjectOwnership
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ObjectOwnership]
$cparseJSONList :: Value -> Parser [ObjectOwnership]
parseJSON :: Value -> Parser ObjectOwnership
$cparseJSON :: Value -> Parser ObjectOwnership
Core.FromJSON,
      FromJSONKeyFunction [ObjectOwnership]
FromJSONKeyFunction ObjectOwnership
FromJSONKeyFunction ObjectOwnership
-> FromJSONKeyFunction [ObjectOwnership]
-> FromJSONKey ObjectOwnership
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [ObjectOwnership]
$cfromJSONKeyList :: FromJSONKeyFunction [ObjectOwnership]
fromJSONKey :: FromJSONKeyFunction ObjectOwnership
$cfromJSONKey :: FromJSONKeyFunction ObjectOwnership
Core.FromJSONKey,
      [ObjectOwnership] -> Encoding
[ObjectOwnership] -> Value
ObjectOwnership -> Encoding
ObjectOwnership -> Value
(ObjectOwnership -> Value)
-> (ObjectOwnership -> Encoding)
-> ([ObjectOwnership] -> Value)
-> ([ObjectOwnership] -> Encoding)
-> ToJSON ObjectOwnership
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ObjectOwnership] -> Encoding
$ctoEncodingList :: [ObjectOwnership] -> Encoding
toJSONList :: [ObjectOwnership] -> Value
$ctoJSONList :: [ObjectOwnership] -> Value
toEncoding :: ObjectOwnership -> Encoding
$ctoEncoding :: ObjectOwnership -> Encoding
toJSON :: ObjectOwnership -> Value
$ctoJSON :: ObjectOwnership -> Value
Core.ToJSON,
      ToJSONKeyFunction [ObjectOwnership]
ToJSONKeyFunction ObjectOwnership
ToJSONKeyFunction ObjectOwnership
-> ToJSONKeyFunction [ObjectOwnership] -> ToJSONKey ObjectOwnership
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [ObjectOwnership]
$ctoJSONKeyList :: ToJSONKeyFunction [ObjectOwnership]
toJSONKey :: ToJSONKeyFunction ObjectOwnership
$ctoJSONKey :: ToJSONKeyFunction ObjectOwnership
Core.ToJSONKey,
      [Node] -> Either String ObjectOwnership
([Node] -> Either String ObjectOwnership)
-> FromXML ObjectOwnership
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String ObjectOwnership
$cparseXML :: [Node] -> Either String ObjectOwnership
Core.FromXML,
      ObjectOwnership -> XML
(ObjectOwnership -> XML) -> ToXML ObjectOwnership
forall a. (a -> XML) -> ToXML a
toXML :: ObjectOwnership -> XML
$ctoXML :: ObjectOwnership -> XML
Core.ToXML
    )

pattern ObjectOwnership_BucketOwnerPreferred :: ObjectOwnership
pattern $bObjectOwnership_BucketOwnerPreferred :: ObjectOwnership
$mObjectOwnership_BucketOwnerPreferred :: forall r. ObjectOwnership -> (Void# -> r) -> (Void# -> r) -> r
ObjectOwnership_BucketOwnerPreferred = ObjectOwnership' "BucketOwnerPreferred"

pattern ObjectOwnership_ObjectWriter :: ObjectOwnership
pattern $bObjectOwnership_ObjectWriter :: ObjectOwnership
$mObjectOwnership_ObjectWriter :: forall r. ObjectOwnership -> (Void# -> r) -> (Void# -> r) -> r
ObjectOwnership_ObjectWriter = ObjectOwnership' "ObjectWriter"

{-# COMPLETE
  ObjectOwnership_BucketOwnerPreferred,
  ObjectOwnership_ObjectWriter,
  ObjectOwnership'
  #-}