{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.S3.GetObjectAcl
-- 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)
--
-- Returns the access control list (ACL) of an object. To use this
-- operation, you must have @READ_ACP@ access to the object.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- __Versioning__
--
-- By default, GET returns ACL information about the current version of an
-- object. To return ACL information about a different version, use the
-- versionId subresource.
--
-- The following operations are related to @GetObjectAcl@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html DeleteObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html PutObject>
module Amazonka.S3.GetObjectAcl
  ( -- * Creating a Request
    GetObjectAcl (..),
    newGetObjectAcl,

    -- * Request Lenses
    getObjectAcl_versionId,
    getObjectAcl_requestPayer,
    getObjectAcl_expectedBucketOwner,
    getObjectAcl_bucket,
    getObjectAcl_key,

    -- * Destructuring the Response
    GetObjectAclResponse (..),
    newGetObjectAclResponse,

    -- * Response Lenses
    getObjectAclResponse_requestCharged,
    getObjectAclResponse_grants,
    getObjectAclResponse_owner,
    getObjectAclResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3.Types

-- | /See:/ 'newGetObjectAcl' smart constructor.
data GetObjectAcl = GetObjectAcl'
  { -- | VersionId used to reference a specific version of the object.
    GetObjectAcl -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    GetObjectAcl -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    GetObjectAcl -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The bucket name that contains the object for which to get the ACL
    -- information.
    --
    -- When using this action with an access point, you must direct requests to
    -- the access point hostname. The access point hostname takes the form
    -- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
    -- When using this action with an access point through the Amazon Web
    -- Services SDKs, you provide the access point ARN in place of the bucket
    -- name. For more information about access point ARNs, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
    -- in the /Amazon S3 User Guide/.
    GetObjectAcl -> BucketName
bucket :: BucketName,
    -- | The key of the object for which to get the ACL information.
    GetObjectAcl -> ObjectKey
key :: ObjectKey
  }
  deriving (GetObjectAcl -> GetObjectAcl -> Bool
(GetObjectAcl -> GetObjectAcl -> Bool)
-> (GetObjectAcl -> GetObjectAcl -> Bool) -> Eq GetObjectAcl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObjectAcl -> GetObjectAcl -> Bool
$c/= :: GetObjectAcl -> GetObjectAcl -> Bool
== :: GetObjectAcl -> GetObjectAcl -> Bool
$c== :: GetObjectAcl -> GetObjectAcl -> Bool
Prelude.Eq, ReadPrec [GetObjectAcl]
ReadPrec GetObjectAcl
Int -> ReadS GetObjectAcl
ReadS [GetObjectAcl]
(Int -> ReadS GetObjectAcl)
-> ReadS [GetObjectAcl]
-> ReadPrec GetObjectAcl
-> ReadPrec [GetObjectAcl]
-> Read GetObjectAcl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObjectAcl]
$creadListPrec :: ReadPrec [GetObjectAcl]
readPrec :: ReadPrec GetObjectAcl
$creadPrec :: ReadPrec GetObjectAcl
readList :: ReadS [GetObjectAcl]
$creadList :: ReadS [GetObjectAcl]
readsPrec :: Int -> ReadS GetObjectAcl
$creadsPrec :: Int -> ReadS GetObjectAcl
Prelude.Read, Int -> GetObjectAcl -> ShowS
[GetObjectAcl] -> ShowS
GetObjectAcl -> String
(Int -> GetObjectAcl -> ShowS)
-> (GetObjectAcl -> String)
-> ([GetObjectAcl] -> ShowS)
-> Show GetObjectAcl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectAcl] -> ShowS
$cshowList :: [GetObjectAcl] -> ShowS
show :: GetObjectAcl -> String
$cshow :: GetObjectAcl -> String
showsPrec :: Int -> GetObjectAcl -> ShowS
$cshowsPrec :: Int -> GetObjectAcl -> ShowS
Prelude.Show, (forall x. GetObjectAcl -> Rep GetObjectAcl x)
-> (forall x. Rep GetObjectAcl x -> GetObjectAcl)
-> Generic GetObjectAcl
forall x. Rep GetObjectAcl x -> GetObjectAcl
forall x. GetObjectAcl -> Rep GetObjectAcl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetObjectAcl x -> GetObjectAcl
$cfrom :: forall x. GetObjectAcl -> Rep GetObjectAcl x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectAcl' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'versionId', 'getObjectAcl_versionId' - VersionId used to reference a specific version of the object.
--
-- 'requestPayer', 'getObjectAcl_requestPayer' - Undocumented member.
--
-- 'expectedBucketOwner', 'getObjectAcl_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'bucket', 'getObjectAcl_bucket' - The bucket name that contains the object for which to get the ACL
-- information.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
--
-- 'key', 'getObjectAcl_key' - The key of the object for which to get the ACL information.
newGetObjectAcl ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  GetObjectAcl
newGetObjectAcl :: BucketName -> ObjectKey -> GetObjectAcl
newGetObjectAcl BucketName
pBucket_ ObjectKey
pKey_ =
  GetObjectAcl' :: Maybe ObjectVersionId
-> Maybe RequestPayer
-> Maybe Text
-> BucketName
-> ObjectKey
-> GetObjectAcl
GetObjectAcl'
    { $sel:versionId:GetObjectAcl' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
      $sel:requestPayer:GetObjectAcl' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:GetObjectAcl' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:GetObjectAcl' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:GetObjectAcl' :: ObjectKey
key = ObjectKey
pKey_
    }

-- | VersionId used to reference a specific version of the object.
getObjectAcl_versionId :: Lens.Lens' GetObjectAcl (Prelude.Maybe ObjectVersionId)
getObjectAcl_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> GetObjectAcl -> f GetObjectAcl
getObjectAcl_versionId = (GetObjectAcl -> Maybe ObjectVersionId)
-> (GetObjectAcl -> Maybe ObjectVersionId -> GetObjectAcl)
-> Lens
     GetObjectAcl
     GetObjectAcl
     (Maybe ObjectVersionId)
     (Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAcl' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:GetObjectAcl' :: GetObjectAcl -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: GetObjectAcl
s@GetObjectAcl' {} Maybe ObjectVersionId
a -> GetObjectAcl
s {$sel:versionId:GetObjectAcl' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: GetObjectAcl)

-- | Undocumented member.
getObjectAcl_requestPayer :: Lens.Lens' GetObjectAcl (Prelude.Maybe RequestPayer)
getObjectAcl_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> GetObjectAcl -> f GetObjectAcl
getObjectAcl_requestPayer = (GetObjectAcl -> Maybe RequestPayer)
-> (GetObjectAcl -> Maybe RequestPayer -> GetObjectAcl)
-> Lens
     GetObjectAcl GetObjectAcl (Maybe RequestPayer) (Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAcl' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:GetObjectAcl' :: GetObjectAcl -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: GetObjectAcl
s@GetObjectAcl' {} Maybe RequestPayer
a -> GetObjectAcl
s {$sel:requestPayer:GetObjectAcl' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: GetObjectAcl)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
getObjectAcl_expectedBucketOwner :: Lens.Lens' GetObjectAcl (Prelude.Maybe Prelude.Text)
getObjectAcl_expectedBucketOwner :: (Maybe Text -> f (Maybe Text)) -> GetObjectAcl -> f GetObjectAcl
getObjectAcl_expectedBucketOwner = (GetObjectAcl -> Maybe Text)
-> (GetObjectAcl -> Maybe Text -> GetObjectAcl)
-> Lens GetObjectAcl GetObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAcl' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetObjectAcl' :: GetObjectAcl -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetObjectAcl
s@GetObjectAcl' {} Maybe Text
a -> GetObjectAcl
s {$sel:expectedBucketOwner:GetObjectAcl' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetObjectAcl)

-- | The bucket name that contains the object for which to get the ACL
-- information.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
getObjectAcl_bucket :: Lens.Lens' GetObjectAcl BucketName
getObjectAcl_bucket :: (BucketName -> f BucketName) -> GetObjectAcl -> f GetObjectAcl
getObjectAcl_bucket = (GetObjectAcl -> BucketName)
-> (GetObjectAcl -> BucketName -> GetObjectAcl)
-> Lens GetObjectAcl GetObjectAcl BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAcl' {BucketName
bucket :: BucketName
$sel:bucket:GetObjectAcl' :: GetObjectAcl -> BucketName
bucket} -> BucketName
bucket) (\s :: GetObjectAcl
s@GetObjectAcl' {} BucketName
a -> GetObjectAcl
s {$sel:bucket:GetObjectAcl' :: BucketName
bucket = BucketName
a} :: GetObjectAcl)

-- | The key of the object for which to get the ACL information.
getObjectAcl_key :: Lens.Lens' GetObjectAcl ObjectKey
getObjectAcl_key :: (ObjectKey -> f ObjectKey) -> GetObjectAcl -> f GetObjectAcl
getObjectAcl_key = (GetObjectAcl -> ObjectKey)
-> (GetObjectAcl -> ObjectKey -> GetObjectAcl)
-> Lens GetObjectAcl GetObjectAcl ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAcl' {ObjectKey
key :: ObjectKey
$sel:key:GetObjectAcl' :: GetObjectAcl -> ObjectKey
key} -> ObjectKey
key) (\s :: GetObjectAcl
s@GetObjectAcl' {} ObjectKey
a -> GetObjectAcl
s {$sel:key:GetObjectAcl' :: ObjectKey
key = ObjectKey
a} :: GetObjectAcl)

instance Core.AWSRequest GetObjectAcl where
  type AWSResponse GetObjectAcl = GetObjectAclResponse
  request :: GetObjectAcl -> Request GetObjectAcl
request =
    Request GetObjectAcl -> Request GetObjectAcl
forall a. Request a -> Request a
Request.s3vhost
      (Request GetObjectAcl -> Request GetObjectAcl)
-> (GetObjectAcl -> Request GetObjectAcl)
-> GetObjectAcl
-> Request GetObjectAcl
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> GetObjectAcl -> Request GetObjectAcl
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetObjectAcl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetObjectAcl)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse GetObjectAcl))
-> Logger
-> Service
-> Proxy GetObjectAcl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetObjectAcl)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe RequestCharged
-> Maybe [Grant] -> Maybe Owner -> Int -> GetObjectAclResponse
GetObjectAclResponse'
            (Maybe RequestCharged
 -> Maybe [Grant] -> Maybe Owner -> Int -> GetObjectAclResponse)
-> Either String (Maybe RequestCharged)
-> Either
     String
     (Maybe [Grant] -> Maybe Owner -> Int -> GetObjectAclResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe RequestCharged)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-request-charged")
            Either
  String
  (Maybe [Grant] -> Maybe Owner -> Int -> GetObjectAclResponse)
-> Either String (Maybe [Grant])
-> Either String (Maybe Owner -> Int -> GetObjectAclResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AccessControlList"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [Grant]))
-> Either String (Maybe [Grant])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Grant])
-> [Node] -> Either String (Maybe [Grant])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Grant]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"Grant")
                        )
            Either String (Maybe Owner -> Int -> GetObjectAclResponse)
-> Either String (Maybe Owner)
-> Either String (Int -> GetObjectAclResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Owner)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Owner")
            Either String (Int -> GetObjectAclResponse)
-> Either String Int -> Either String GetObjectAclResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetObjectAcl

instance Prelude.NFData GetObjectAcl

instance Core.ToHeaders GetObjectAcl where
  toHeaders :: GetObjectAcl -> ResponseHeaders
toHeaders GetObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectAcl' :: GetObjectAcl -> ObjectKey
$sel:bucket:GetObjectAcl' :: GetObjectAcl -> BucketName
$sel:expectedBucketOwner:GetObjectAcl' :: GetObjectAcl -> Maybe Text
$sel:requestPayer:GetObjectAcl' :: GetObjectAcl -> Maybe RequestPayer
$sel:versionId:GetObjectAcl' :: GetObjectAcl -> Maybe ObjectVersionId
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-request-payer" HeaderName -> Maybe RequestPayer -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe RequestPayer
requestPayer,
        HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
      ]

instance Core.ToPath GetObjectAcl where
  toPath :: GetObjectAcl -> ByteString
toPath GetObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectAcl' :: GetObjectAcl -> ObjectKey
$sel:bucket:GetObjectAcl' :: GetObjectAcl -> BucketName
$sel:expectedBucketOwner:GetObjectAcl' :: GetObjectAcl -> Maybe Text
$sel:requestPayer:GetObjectAcl' :: GetObjectAcl -> Maybe RequestPayer
$sel:versionId:GetObjectAcl' :: GetObjectAcl -> Maybe ObjectVersionId
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket, ByteString
"/", ObjectKey -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ObjectKey
key]

instance Core.ToQuery GetObjectAcl where
  toQuery :: GetObjectAcl -> QueryString
toQuery GetObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectAcl' :: GetObjectAcl -> ObjectKey
$sel:bucket:GetObjectAcl' :: GetObjectAcl -> BucketName
$sel:expectedBucketOwner:GetObjectAcl' :: GetObjectAcl -> Maybe Text
$sel:requestPayer:GetObjectAcl' :: GetObjectAcl -> Maybe RequestPayer
$sel:versionId:GetObjectAcl' :: GetObjectAcl -> Maybe ObjectVersionId
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"versionId" ByteString -> Maybe ObjectVersionId -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ObjectVersionId
versionId, QueryString
"acl"]

-- | /See:/ 'newGetObjectAclResponse' smart constructor.
data GetObjectAclResponse = GetObjectAclResponse'
  { GetObjectAclResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | A list of grants.
    GetObjectAclResponse -> Maybe [Grant]
grants :: Prelude.Maybe [Grant],
    -- | Container for the bucket owner\'s display name and ID.
    GetObjectAclResponse -> Maybe Owner
owner :: Prelude.Maybe Owner,
    -- | The response's http status code.
    GetObjectAclResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetObjectAclResponse -> GetObjectAclResponse -> Bool
(GetObjectAclResponse -> GetObjectAclResponse -> Bool)
-> (GetObjectAclResponse -> GetObjectAclResponse -> Bool)
-> Eq GetObjectAclResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObjectAclResponse -> GetObjectAclResponse -> Bool
$c/= :: GetObjectAclResponse -> GetObjectAclResponse -> Bool
== :: GetObjectAclResponse -> GetObjectAclResponse -> Bool
$c== :: GetObjectAclResponse -> GetObjectAclResponse -> Bool
Prelude.Eq, ReadPrec [GetObjectAclResponse]
ReadPrec GetObjectAclResponse
Int -> ReadS GetObjectAclResponse
ReadS [GetObjectAclResponse]
(Int -> ReadS GetObjectAclResponse)
-> ReadS [GetObjectAclResponse]
-> ReadPrec GetObjectAclResponse
-> ReadPrec [GetObjectAclResponse]
-> Read GetObjectAclResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObjectAclResponse]
$creadListPrec :: ReadPrec [GetObjectAclResponse]
readPrec :: ReadPrec GetObjectAclResponse
$creadPrec :: ReadPrec GetObjectAclResponse
readList :: ReadS [GetObjectAclResponse]
$creadList :: ReadS [GetObjectAclResponse]
readsPrec :: Int -> ReadS GetObjectAclResponse
$creadsPrec :: Int -> ReadS GetObjectAclResponse
Prelude.Read, Int -> GetObjectAclResponse -> ShowS
[GetObjectAclResponse] -> ShowS
GetObjectAclResponse -> String
(Int -> GetObjectAclResponse -> ShowS)
-> (GetObjectAclResponse -> String)
-> ([GetObjectAclResponse] -> ShowS)
-> Show GetObjectAclResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectAclResponse] -> ShowS
$cshowList :: [GetObjectAclResponse] -> ShowS
show :: GetObjectAclResponse -> String
$cshow :: GetObjectAclResponse -> String
showsPrec :: Int -> GetObjectAclResponse -> ShowS
$cshowsPrec :: Int -> GetObjectAclResponse -> ShowS
Prelude.Show, (forall x. GetObjectAclResponse -> Rep GetObjectAclResponse x)
-> (forall x. Rep GetObjectAclResponse x -> GetObjectAclResponse)
-> Generic GetObjectAclResponse
forall x. Rep GetObjectAclResponse x -> GetObjectAclResponse
forall x. GetObjectAclResponse -> Rep GetObjectAclResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetObjectAclResponse x -> GetObjectAclResponse
$cfrom :: forall x. GetObjectAclResponse -> Rep GetObjectAclResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectAclResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'requestCharged', 'getObjectAclResponse_requestCharged' - Undocumented member.
--
-- 'grants', 'getObjectAclResponse_grants' - A list of grants.
--
-- 'owner', 'getObjectAclResponse_owner' - Container for the bucket owner\'s display name and ID.
--
-- 'httpStatus', 'getObjectAclResponse_httpStatus' - The response's http status code.
newGetObjectAclResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetObjectAclResponse
newGetObjectAclResponse :: Int -> GetObjectAclResponse
newGetObjectAclResponse Int
pHttpStatus_ =
  GetObjectAclResponse' :: Maybe RequestCharged
-> Maybe [Grant] -> Maybe Owner -> Int -> GetObjectAclResponse
GetObjectAclResponse'
    { $sel:requestCharged:GetObjectAclResponse' :: Maybe RequestCharged
requestCharged =
        Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
      $sel:grants:GetObjectAclResponse' :: Maybe [Grant]
grants = Maybe [Grant]
forall a. Maybe a
Prelude.Nothing,
      $sel:owner:GetObjectAclResponse' :: Maybe Owner
owner = Maybe Owner
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetObjectAclResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
getObjectAclResponse_requestCharged :: Lens.Lens' GetObjectAclResponse (Prelude.Maybe RequestCharged)
getObjectAclResponse_requestCharged :: (Maybe RequestCharged -> f (Maybe RequestCharged))
-> GetObjectAclResponse -> f GetObjectAclResponse
getObjectAclResponse_requestCharged = (GetObjectAclResponse -> Maybe RequestCharged)
-> (GetObjectAclResponse
    -> Maybe RequestCharged -> GetObjectAclResponse)
-> Lens
     GetObjectAclResponse
     GetObjectAclResponse
     (Maybe RequestCharged)
     (Maybe RequestCharged)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAclResponse' {Maybe RequestCharged
requestCharged :: Maybe RequestCharged
$sel:requestCharged:GetObjectAclResponse' :: GetObjectAclResponse -> Maybe RequestCharged
requestCharged} -> Maybe RequestCharged
requestCharged) (\s :: GetObjectAclResponse
s@GetObjectAclResponse' {} Maybe RequestCharged
a -> GetObjectAclResponse
s {$sel:requestCharged:GetObjectAclResponse' :: Maybe RequestCharged
requestCharged = Maybe RequestCharged
a} :: GetObjectAclResponse)

-- | A list of grants.
getObjectAclResponse_grants :: Lens.Lens' GetObjectAclResponse (Prelude.Maybe [Grant])
getObjectAclResponse_grants :: (Maybe [Grant] -> f (Maybe [Grant]))
-> GetObjectAclResponse -> f GetObjectAclResponse
getObjectAclResponse_grants = (GetObjectAclResponse -> Maybe [Grant])
-> (GetObjectAclResponse -> Maybe [Grant] -> GetObjectAclResponse)
-> Lens
     GetObjectAclResponse
     GetObjectAclResponse
     (Maybe [Grant])
     (Maybe [Grant])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAclResponse' {Maybe [Grant]
grants :: Maybe [Grant]
$sel:grants:GetObjectAclResponse' :: GetObjectAclResponse -> Maybe [Grant]
grants} -> Maybe [Grant]
grants) (\s :: GetObjectAclResponse
s@GetObjectAclResponse' {} Maybe [Grant]
a -> GetObjectAclResponse
s {$sel:grants:GetObjectAclResponse' :: Maybe [Grant]
grants = Maybe [Grant]
a} :: GetObjectAclResponse) ((Maybe [Grant] -> f (Maybe [Grant]))
 -> GetObjectAclResponse -> f GetObjectAclResponse)
-> ((Maybe [Grant] -> f (Maybe [Grant]))
    -> Maybe [Grant] -> f (Maybe [Grant]))
-> (Maybe [Grant] -> f (Maybe [Grant]))
-> GetObjectAclResponse
-> f GetObjectAclResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Grant] [Grant] [Grant] [Grant]
-> Iso
     (Maybe [Grant]) (Maybe [Grant]) (Maybe [Grant]) (Maybe [Grant])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Grant] [Grant] [Grant] [Grant]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Container for the bucket owner\'s display name and ID.
getObjectAclResponse_owner :: Lens.Lens' GetObjectAclResponse (Prelude.Maybe Owner)
getObjectAclResponse_owner :: (Maybe Owner -> f (Maybe Owner))
-> GetObjectAclResponse -> f GetObjectAclResponse
getObjectAclResponse_owner = (GetObjectAclResponse -> Maybe Owner)
-> (GetObjectAclResponse -> Maybe Owner -> GetObjectAclResponse)
-> Lens
     GetObjectAclResponse
     GetObjectAclResponse
     (Maybe Owner)
     (Maybe Owner)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAclResponse' {Maybe Owner
owner :: Maybe Owner
$sel:owner:GetObjectAclResponse' :: GetObjectAclResponse -> Maybe Owner
owner} -> Maybe Owner
owner) (\s :: GetObjectAclResponse
s@GetObjectAclResponse' {} Maybe Owner
a -> GetObjectAclResponse
s {$sel:owner:GetObjectAclResponse' :: Maybe Owner
owner = Maybe Owner
a} :: GetObjectAclResponse)

-- | The response's http status code.
getObjectAclResponse_httpStatus :: Lens.Lens' GetObjectAclResponse Prelude.Int
getObjectAclResponse_httpStatus :: (Int -> f Int) -> GetObjectAclResponse -> f GetObjectAclResponse
getObjectAclResponse_httpStatus = (GetObjectAclResponse -> Int)
-> (GetObjectAclResponse -> Int -> GetObjectAclResponse)
-> Lens GetObjectAclResponse GetObjectAclResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectAclResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetObjectAclResponse' :: GetObjectAclResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetObjectAclResponse
s@GetObjectAclResponse' {} Int
a -> GetObjectAclResponse
s {$sel:httpStatus:GetObjectAclResponse' :: Int
httpStatus = Int
a} :: GetObjectAclResponse)

instance Prelude.NFData GetObjectAclResponse