{-# 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.CodeBuild.Types.BucketOwnerAccess
-- 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.CodeBuild.Types.BucketOwnerAccess
  ( BucketOwnerAccess
      ( ..,
        BucketOwnerAccess_FULL,
        BucketOwnerAccess_NONE,
        BucketOwnerAccess_READ_ONLY
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude

-- | Specifies the bucket owner\'s access for objects that another account
-- uploads to their Amazon S3 bucket. By default, only the account that
-- uploads the objects to the bucket has access to these objects. This
-- property allows you to give the bucket owner access to these objects.
--
-- To use this property, your CodeBuild service role must have the
-- @s3:PutBucketAcl@ permission. This permission allows CodeBuild to modify
-- the access control list for the bucket.
--
-- This property can be one of the following values:
--
-- [NONE]
--     The bucket owner does not have access to the objects. This is the
--     default.
--
-- [READ_ONLY]
--     The bucket owner has read-only access to the objects. The uploading
--     account retains ownership of the objects.
--
-- [FULL]
--     The bucket owner has full access to the objects. Object ownership is
--     determined by the following criteria:
--
--     -   If the bucket is configured with the __Bucket owner preferred__
--         setting, the bucket owner owns the objects. The uploading
--         account will have object access as specified by the bucket\'s
--         policy.
--
--     -   Otherwise, the uploading account retains ownership of the
--         objects.
--
--     For more information about Amazon S3 object ownership, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html Controlling ownership of uploaded objects using S3 Object Ownership>
--     in the /Amazon Simple Storage Service User Guide/.
newtype BucketOwnerAccess = BucketOwnerAccess'
  { BucketOwnerAccess -> Text
fromBucketOwnerAccess ::
      Core.Text
  }
  deriving stock
    ( Int -> BucketOwnerAccess -> ShowS
[BucketOwnerAccess] -> ShowS
BucketOwnerAccess -> String
(Int -> BucketOwnerAccess -> ShowS)
-> (BucketOwnerAccess -> String)
-> ([BucketOwnerAccess] -> ShowS)
-> Show BucketOwnerAccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketOwnerAccess] -> ShowS
$cshowList :: [BucketOwnerAccess] -> ShowS
show :: BucketOwnerAccess -> String
$cshow :: BucketOwnerAccess -> String
showsPrec :: Int -> BucketOwnerAccess -> ShowS
$cshowsPrec :: Int -> BucketOwnerAccess -> ShowS
Prelude.Show,
      ReadPrec [BucketOwnerAccess]
ReadPrec BucketOwnerAccess
Int -> ReadS BucketOwnerAccess
ReadS [BucketOwnerAccess]
(Int -> ReadS BucketOwnerAccess)
-> ReadS [BucketOwnerAccess]
-> ReadPrec BucketOwnerAccess
-> ReadPrec [BucketOwnerAccess]
-> Read BucketOwnerAccess
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketOwnerAccess]
$creadListPrec :: ReadPrec [BucketOwnerAccess]
readPrec :: ReadPrec BucketOwnerAccess
$creadPrec :: ReadPrec BucketOwnerAccess
readList :: ReadS [BucketOwnerAccess]
$creadList :: ReadS [BucketOwnerAccess]
readsPrec :: Int -> ReadS BucketOwnerAccess
$creadsPrec :: Int -> ReadS BucketOwnerAccess
Prelude.Read,
      BucketOwnerAccess -> BucketOwnerAccess -> Bool
(BucketOwnerAccess -> BucketOwnerAccess -> Bool)
-> (BucketOwnerAccess -> BucketOwnerAccess -> Bool)
-> Eq BucketOwnerAccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
$c/= :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
== :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
$c== :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
Prelude.Eq,
      Eq BucketOwnerAccess
Eq BucketOwnerAccess
-> (BucketOwnerAccess -> BucketOwnerAccess -> Ordering)
-> (BucketOwnerAccess -> BucketOwnerAccess -> Bool)
-> (BucketOwnerAccess -> BucketOwnerAccess -> Bool)
-> (BucketOwnerAccess -> BucketOwnerAccess -> Bool)
-> (BucketOwnerAccess -> BucketOwnerAccess -> Bool)
-> (BucketOwnerAccess -> BucketOwnerAccess -> BucketOwnerAccess)
-> (BucketOwnerAccess -> BucketOwnerAccess -> BucketOwnerAccess)
-> Ord BucketOwnerAccess
BucketOwnerAccess -> BucketOwnerAccess -> Bool
BucketOwnerAccess -> BucketOwnerAccess -> Ordering
BucketOwnerAccess -> BucketOwnerAccess -> BucketOwnerAccess
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 :: BucketOwnerAccess -> BucketOwnerAccess -> BucketOwnerAccess
$cmin :: BucketOwnerAccess -> BucketOwnerAccess -> BucketOwnerAccess
max :: BucketOwnerAccess -> BucketOwnerAccess -> BucketOwnerAccess
$cmax :: BucketOwnerAccess -> BucketOwnerAccess -> BucketOwnerAccess
>= :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
$c>= :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
> :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
$c> :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
<= :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
$c<= :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
< :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
$c< :: BucketOwnerAccess -> BucketOwnerAccess -> Bool
compare :: BucketOwnerAccess -> BucketOwnerAccess -> Ordering
$ccompare :: BucketOwnerAccess -> BucketOwnerAccess -> Ordering
$cp1Ord :: Eq BucketOwnerAccess
Prelude.Ord,
      (forall x. BucketOwnerAccess -> Rep BucketOwnerAccess x)
-> (forall x. Rep BucketOwnerAccess x -> BucketOwnerAccess)
-> Generic BucketOwnerAccess
forall x. Rep BucketOwnerAccess x -> BucketOwnerAccess
forall x. BucketOwnerAccess -> Rep BucketOwnerAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BucketOwnerAccess x -> BucketOwnerAccess
$cfrom :: forall x. BucketOwnerAccess -> Rep BucketOwnerAccess x
Prelude.Generic
    )
  deriving newtype
    ( Int -> BucketOwnerAccess -> Int
BucketOwnerAccess -> Int
(Int -> BucketOwnerAccess -> Int)
-> (BucketOwnerAccess -> Int) -> Hashable BucketOwnerAccess
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: BucketOwnerAccess -> Int
$chash :: BucketOwnerAccess -> Int
hashWithSalt :: Int -> BucketOwnerAccess -> Int
$chashWithSalt :: Int -> BucketOwnerAccess -> Int
Prelude.Hashable,
      BucketOwnerAccess -> ()
(BucketOwnerAccess -> ()) -> NFData BucketOwnerAccess
forall a. (a -> ()) -> NFData a
rnf :: BucketOwnerAccess -> ()
$crnf :: BucketOwnerAccess -> ()
Prelude.NFData,
      Text -> Either String BucketOwnerAccess
(Text -> Either String BucketOwnerAccess)
-> FromText BucketOwnerAccess
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String BucketOwnerAccess
$cfromText :: Text -> Either String BucketOwnerAccess
Core.FromText,
      BucketOwnerAccess -> Text
(BucketOwnerAccess -> Text) -> ToText BucketOwnerAccess
forall a. (a -> Text) -> ToText a
toText :: BucketOwnerAccess -> Text
$ctoText :: BucketOwnerAccess -> Text
Core.ToText,
      BucketOwnerAccess -> ByteString
(BucketOwnerAccess -> ByteString) -> ToByteString BucketOwnerAccess
forall a. (a -> ByteString) -> ToByteString a
toBS :: BucketOwnerAccess -> ByteString
$ctoBS :: BucketOwnerAccess -> ByteString
Core.ToByteString,
      BucketOwnerAccess -> ByteStringBuilder
(BucketOwnerAccess -> ByteStringBuilder) -> ToLog BucketOwnerAccess
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: BucketOwnerAccess -> ByteStringBuilder
$cbuild :: BucketOwnerAccess -> ByteStringBuilder
Core.ToLog,
      HeaderName -> BucketOwnerAccess -> [Header]
(HeaderName -> BucketOwnerAccess -> [Header])
-> ToHeader BucketOwnerAccess
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> BucketOwnerAccess -> [Header]
$ctoHeader :: HeaderName -> BucketOwnerAccess -> [Header]
Core.ToHeader,
      BucketOwnerAccess -> QueryString
(BucketOwnerAccess -> QueryString) -> ToQuery BucketOwnerAccess
forall a. (a -> QueryString) -> ToQuery a
toQuery :: BucketOwnerAccess -> QueryString
$ctoQuery :: BucketOwnerAccess -> QueryString
Core.ToQuery,
      Value -> Parser [BucketOwnerAccess]
Value -> Parser BucketOwnerAccess
(Value -> Parser BucketOwnerAccess)
-> (Value -> Parser [BucketOwnerAccess])
-> FromJSON BucketOwnerAccess
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [BucketOwnerAccess]
$cparseJSONList :: Value -> Parser [BucketOwnerAccess]
parseJSON :: Value -> Parser BucketOwnerAccess
$cparseJSON :: Value -> Parser BucketOwnerAccess
Core.FromJSON,
      FromJSONKeyFunction [BucketOwnerAccess]
FromJSONKeyFunction BucketOwnerAccess
FromJSONKeyFunction BucketOwnerAccess
-> FromJSONKeyFunction [BucketOwnerAccess]
-> FromJSONKey BucketOwnerAccess
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [BucketOwnerAccess]
$cfromJSONKeyList :: FromJSONKeyFunction [BucketOwnerAccess]
fromJSONKey :: FromJSONKeyFunction BucketOwnerAccess
$cfromJSONKey :: FromJSONKeyFunction BucketOwnerAccess
Core.FromJSONKey,
      [BucketOwnerAccess] -> Encoding
[BucketOwnerAccess] -> Value
BucketOwnerAccess -> Encoding
BucketOwnerAccess -> Value
(BucketOwnerAccess -> Value)
-> (BucketOwnerAccess -> Encoding)
-> ([BucketOwnerAccess] -> Value)
-> ([BucketOwnerAccess] -> Encoding)
-> ToJSON BucketOwnerAccess
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [BucketOwnerAccess] -> Encoding
$ctoEncodingList :: [BucketOwnerAccess] -> Encoding
toJSONList :: [BucketOwnerAccess] -> Value
$ctoJSONList :: [BucketOwnerAccess] -> Value
toEncoding :: BucketOwnerAccess -> Encoding
$ctoEncoding :: BucketOwnerAccess -> Encoding
toJSON :: BucketOwnerAccess -> Value
$ctoJSON :: BucketOwnerAccess -> Value
Core.ToJSON,
      ToJSONKeyFunction [BucketOwnerAccess]
ToJSONKeyFunction BucketOwnerAccess
ToJSONKeyFunction BucketOwnerAccess
-> ToJSONKeyFunction [BucketOwnerAccess]
-> ToJSONKey BucketOwnerAccess
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [BucketOwnerAccess]
$ctoJSONKeyList :: ToJSONKeyFunction [BucketOwnerAccess]
toJSONKey :: ToJSONKeyFunction BucketOwnerAccess
$ctoJSONKey :: ToJSONKeyFunction BucketOwnerAccess
Core.ToJSONKey,
      [Node] -> Either String BucketOwnerAccess
([Node] -> Either String BucketOwnerAccess)
-> FromXML BucketOwnerAccess
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String BucketOwnerAccess
$cparseXML :: [Node] -> Either String BucketOwnerAccess
Core.FromXML,
      BucketOwnerAccess -> XML
(BucketOwnerAccess -> XML) -> ToXML BucketOwnerAccess
forall a. (a -> XML) -> ToXML a
toXML :: BucketOwnerAccess -> XML
$ctoXML :: BucketOwnerAccess -> XML
Core.ToXML
    )

pattern BucketOwnerAccess_FULL :: BucketOwnerAccess
pattern $bBucketOwnerAccess_FULL :: BucketOwnerAccess
$mBucketOwnerAccess_FULL :: forall r. BucketOwnerAccess -> (Void# -> r) -> (Void# -> r) -> r
BucketOwnerAccess_FULL = BucketOwnerAccess' "FULL"

pattern BucketOwnerAccess_NONE :: BucketOwnerAccess
pattern $bBucketOwnerAccess_NONE :: BucketOwnerAccess
$mBucketOwnerAccess_NONE :: forall r. BucketOwnerAccess -> (Void# -> r) -> (Void# -> r) -> r
BucketOwnerAccess_NONE = BucketOwnerAccess' "NONE"

pattern BucketOwnerAccess_READ_ONLY :: BucketOwnerAccess
pattern $bBucketOwnerAccess_READ_ONLY :: BucketOwnerAccess
$mBucketOwnerAccess_READ_ONLY :: forall r. BucketOwnerAccess -> (Void# -> r) -> (Void# -> r) -> r
BucketOwnerAccess_READ_ONLY = BucketOwnerAccess' "READ_ONLY"

{-# COMPLETE
  BucketOwnerAccess_FULL,
  BucketOwnerAccess_NONE,
  BucketOwnerAccess_READ_ONLY,
  BucketOwnerAccess'
  #-}