{-# 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.GetObjectLegalHold
-- 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)
--
-- Gets an object\'s current Legal Hold status. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html Locking Objects>.
--
-- This action is not supported by Amazon S3 on Outposts.
module Amazonka.S3.GetObjectLegalHold
  ( -- * Creating a Request
    GetObjectLegalHold (..),
    newGetObjectLegalHold,

    -- * Request Lenses
    getObjectLegalHold_versionId,
    getObjectLegalHold_requestPayer,
    getObjectLegalHold_expectedBucketOwner,
    getObjectLegalHold_bucket,
    getObjectLegalHold_key,

    -- * Destructuring the Response
    GetObjectLegalHoldResponse (..),
    newGetObjectLegalHoldResponse,

    -- * Response Lenses
    getObjectLegalHoldResponse_legalHold,
    getObjectLegalHoldResponse_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:/ 'newGetObjectLegalHold' smart constructor.
data GetObjectLegalHold = GetObjectLegalHold'
  { -- | The version ID of the object whose Legal Hold status you want to
    -- retrieve.
    GetObjectLegalHold -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    GetObjectLegalHold -> 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.
    GetObjectLegalHold -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The bucket name containing the object whose Legal Hold status you want
    -- to retrieve.
    --
    -- 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/.
    GetObjectLegalHold -> BucketName
bucket :: BucketName,
    -- | The key name for the object whose Legal Hold status you want to
    -- retrieve.
    GetObjectLegalHold -> ObjectKey
key :: ObjectKey
  }
  deriving (GetObjectLegalHold -> GetObjectLegalHold -> Bool
(GetObjectLegalHold -> GetObjectLegalHold -> Bool)
-> (GetObjectLegalHold -> GetObjectLegalHold -> Bool)
-> Eq GetObjectLegalHold
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObjectLegalHold -> GetObjectLegalHold -> Bool
$c/= :: GetObjectLegalHold -> GetObjectLegalHold -> Bool
== :: GetObjectLegalHold -> GetObjectLegalHold -> Bool
$c== :: GetObjectLegalHold -> GetObjectLegalHold -> Bool
Prelude.Eq, ReadPrec [GetObjectLegalHold]
ReadPrec GetObjectLegalHold
Int -> ReadS GetObjectLegalHold
ReadS [GetObjectLegalHold]
(Int -> ReadS GetObjectLegalHold)
-> ReadS [GetObjectLegalHold]
-> ReadPrec GetObjectLegalHold
-> ReadPrec [GetObjectLegalHold]
-> Read GetObjectLegalHold
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObjectLegalHold]
$creadListPrec :: ReadPrec [GetObjectLegalHold]
readPrec :: ReadPrec GetObjectLegalHold
$creadPrec :: ReadPrec GetObjectLegalHold
readList :: ReadS [GetObjectLegalHold]
$creadList :: ReadS [GetObjectLegalHold]
readsPrec :: Int -> ReadS GetObjectLegalHold
$creadsPrec :: Int -> ReadS GetObjectLegalHold
Prelude.Read, Int -> GetObjectLegalHold -> ShowS
[GetObjectLegalHold] -> ShowS
GetObjectLegalHold -> String
(Int -> GetObjectLegalHold -> ShowS)
-> (GetObjectLegalHold -> String)
-> ([GetObjectLegalHold] -> ShowS)
-> Show GetObjectLegalHold
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectLegalHold] -> ShowS
$cshowList :: [GetObjectLegalHold] -> ShowS
show :: GetObjectLegalHold -> String
$cshow :: GetObjectLegalHold -> String
showsPrec :: Int -> GetObjectLegalHold -> ShowS
$cshowsPrec :: Int -> GetObjectLegalHold -> ShowS
Prelude.Show, (forall x. GetObjectLegalHold -> Rep GetObjectLegalHold x)
-> (forall x. Rep GetObjectLegalHold x -> GetObjectLegalHold)
-> Generic GetObjectLegalHold
forall x. Rep GetObjectLegalHold x -> GetObjectLegalHold
forall x. GetObjectLegalHold -> Rep GetObjectLegalHold x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetObjectLegalHold x -> GetObjectLegalHold
$cfrom :: forall x. GetObjectLegalHold -> Rep GetObjectLegalHold x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectLegalHold' 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', 'getObjectLegalHold_versionId' - The version ID of the object whose Legal Hold status you want to
-- retrieve.
--
-- 'requestPayer', 'getObjectLegalHold_requestPayer' - Undocumented member.
--
-- 'expectedBucketOwner', 'getObjectLegalHold_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', 'getObjectLegalHold_bucket' - The bucket name containing the object whose Legal Hold status you want
-- to retrieve.
--
-- 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', 'getObjectLegalHold_key' - The key name for the object whose Legal Hold status you want to
-- retrieve.
newGetObjectLegalHold ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  GetObjectLegalHold
newGetObjectLegalHold :: BucketName -> ObjectKey -> GetObjectLegalHold
newGetObjectLegalHold BucketName
pBucket_ ObjectKey
pKey_ =
  GetObjectLegalHold' :: Maybe ObjectVersionId
-> Maybe RequestPayer
-> Maybe Text
-> BucketName
-> ObjectKey
-> GetObjectLegalHold
GetObjectLegalHold'
    { $sel:versionId:GetObjectLegalHold' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
      $sel:requestPayer:GetObjectLegalHold' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:GetObjectLegalHold' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:GetObjectLegalHold' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:GetObjectLegalHold' :: ObjectKey
key = ObjectKey
pKey_
    }

-- | The version ID of the object whose Legal Hold status you want to
-- retrieve.
getObjectLegalHold_versionId :: Lens.Lens' GetObjectLegalHold (Prelude.Maybe ObjectVersionId)
getObjectLegalHold_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> GetObjectLegalHold -> f GetObjectLegalHold
getObjectLegalHold_versionId = (GetObjectLegalHold -> Maybe ObjectVersionId)
-> (GetObjectLegalHold
    -> Maybe ObjectVersionId -> GetObjectLegalHold)
-> Lens
     GetObjectLegalHold
     GetObjectLegalHold
     (Maybe ObjectVersionId)
     (Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectLegalHold' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: GetObjectLegalHold
s@GetObjectLegalHold' {} Maybe ObjectVersionId
a -> GetObjectLegalHold
s {$sel:versionId:GetObjectLegalHold' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: GetObjectLegalHold)

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

-- | 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.
getObjectLegalHold_expectedBucketOwner :: Lens.Lens' GetObjectLegalHold (Prelude.Maybe Prelude.Text)
getObjectLegalHold_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> GetObjectLegalHold -> f GetObjectLegalHold
getObjectLegalHold_expectedBucketOwner = (GetObjectLegalHold -> Maybe Text)
-> (GetObjectLegalHold -> Maybe Text -> GetObjectLegalHold)
-> Lens
     GetObjectLegalHold GetObjectLegalHold (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectLegalHold' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetObjectLegalHold
s@GetObjectLegalHold' {} Maybe Text
a -> GetObjectLegalHold
s {$sel:expectedBucketOwner:GetObjectLegalHold' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetObjectLegalHold)

-- | The bucket name containing the object whose Legal Hold status you want
-- to retrieve.
--
-- 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/.
getObjectLegalHold_bucket :: Lens.Lens' GetObjectLegalHold BucketName
getObjectLegalHold_bucket :: (BucketName -> f BucketName)
-> GetObjectLegalHold -> f GetObjectLegalHold
getObjectLegalHold_bucket = (GetObjectLegalHold -> BucketName)
-> (GetObjectLegalHold -> BucketName -> GetObjectLegalHold)
-> Lens GetObjectLegalHold GetObjectLegalHold BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectLegalHold' {BucketName
bucket :: BucketName
$sel:bucket:GetObjectLegalHold' :: GetObjectLegalHold -> BucketName
bucket} -> BucketName
bucket) (\s :: GetObjectLegalHold
s@GetObjectLegalHold' {} BucketName
a -> GetObjectLegalHold
s {$sel:bucket:GetObjectLegalHold' :: BucketName
bucket = BucketName
a} :: GetObjectLegalHold)

-- | The key name for the object whose Legal Hold status you want to
-- retrieve.
getObjectLegalHold_key :: Lens.Lens' GetObjectLegalHold ObjectKey
getObjectLegalHold_key :: (ObjectKey -> f ObjectKey)
-> GetObjectLegalHold -> f GetObjectLegalHold
getObjectLegalHold_key = (GetObjectLegalHold -> ObjectKey)
-> (GetObjectLegalHold -> ObjectKey -> GetObjectLegalHold)
-> Lens GetObjectLegalHold GetObjectLegalHold ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectLegalHold' {ObjectKey
key :: ObjectKey
$sel:key:GetObjectLegalHold' :: GetObjectLegalHold -> ObjectKey
key} -> ObjectKey
key) (\s :: GetObjectLegalHold
s@GetObjectLegalHold' {} ObjectKey
a -> GetObjectLegalHold
s {$sel:key:GetObjectLegalHold' :: ObjectKey
key = ObjectKey
a} :: GetObjectLegalHold)

instance Core.AWSRequest GetObjectLegalHold where
  type
    AWSResponse GetObjectLegalHold =
      GetObjectLegalHoldResponse
  request :: GetObjectLegalHold -> Request GetObjectLegalHold
request =
    Request GetObjectLegalHold -> Request GetObjectLegalHold
forall a. Request a -> Request a
Request.s3vhost
      (Request GetObjectLegalHold -> Request GetObjectLegalHold)
-> (GetObjectLegalHold -> Request GetObjectLegalHold)
-> GetObjectLegalHold
-> Request GetObjectLegalHold
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> GetObjectLegalHold -> Request GetObjectLegalHold
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetObjectLegalHold
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetObjectLegalHold)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse GetObjectLegalHold))
-> Logger
-> Service
-> Proxy GetObjectLegalHold
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetObjectLegalHold)))
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 ObjectLockLegalHold -> Int -> GetObjectLegalHoldResponse
GetObjectLegalHoldResponse'
            (Maybe ObjectLockLegalHold -> Int -> GetObjectLegalHoldResponse)
-> Either String (Maybe ObjectLockLegalHold)
-> Either String (Int -> GetObjectLegalHoldResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe ObjectLockLegalHold)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either String (Int -> GetObjectLegalHoldResponse)
-> Either String Int -> Either String GetObjectLegalHoldResponse
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 GetObjectLegalHold

instance Prelude.NFData GetObjectLegalHold

instance Core.ToHeaders GetObjectLegalHold where
  toHeaders :: GetObjectLegalHold -> ResponseHeaders
toHeaders GetObjectLegalHold' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectLegalHold' :: GetObjectLegalHold -> ObjectKey
$sel:bucket:GetObjectLegalHold' :: GetObjectLegalHold -> BucketName
$sel:expectedBucketOwner:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe Text
$sel:requestPayer:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe RequestPayer
$sel:versionId:GetObjectLegalHold' :: GetObjectLegalHold -> 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 GetObjectLegalHold where
  toPath :: GetObjectLegalHold -> ByteString
toPath GetObjectLegalHold' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectLegalHold' :: GetObjectLegalHold -> ObjectKey
$sel:bucket:GetObjectLegalHold' :: GetObjectLegalHold -> BucketName
$sel:expectedBucketOwner:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe Text
$sel:requestPayer:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe RequestPayer
$sel:versionId:GetObjectLegalHold' :: GetObjectLegalHold -> 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 GetObjectLegalHold where
  toQuery :: GetObjectLegalHold -> QueryString
toQuery GetObjectLegalHold' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectLegalHold' :: GetObjectLegalHold -> ObjectKey
$sel:bucket:GetObjectLegalHold' :: GetObjectLegalHold -> BucketName
$sel:expectedBucketOwner:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe Text
$sel:requestPayer:GetObjectLegalHold' :: GetObjectLegalHold -> Maybe RequestPayer
$sel:versionId:GetObjectLegalHold' :: GetObjectLegalHold -> 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
"legal-hold"]

-- | /See:/ 'newGetObjectLegalHoldResponse' smart constructor.
data GetObjectLegalHoldResponse = GetObjectLegalHoldResponse'
  { -- | The current Legal Hold status for the specified object.
    GetObjectLegalHoldResponse -> Maybe ObjectLockLegalHold
legalHold :: Prelude.Maybe ObjectLockLegalHold,
    -- | The response's http status code.
    GetObjectLegalHoldResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetObjectLegalHoldResponse -> GetObjectLegalHoldResponse -> Bool
(GetObjectLegalHoldResponse -> GetObjectLegalHoldResponse -> Bool)
-> (GetObjectLegalHoldResponse
    -> GetObjectLegalHoldResponse -> Bool)
-> Eq GetObjectLegalHoldResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObjectLegalHoldResponse -> GetObjectLegalHoldResponse -> Bool
$c/= :: GetObjectLegalHoldResponse -> GetObjectLegalHoldResponse -> Bool
== :: GetObjectLegalHoldResponse -> GetObjectLegalHoldResponse -> Bool
$c== :: GetObjectLegalHoldResponse -> GetObjectLegalHoldResponse -> Bool
Prelude.Eq, ReadPrec [GetObjectLegalHoldResponse]
ReadPrec GetObjectLegalHoldResponse
Int -> ReadS GetObjectLegalHoldResponse
ReadS [GetObjectLegalHoldResponse]
(Int -> ReadS GetObjectLegalHoldResponse)
-> ReadS [GetObjectLegalHoldResponse]
-> ReadPrec GetObjectLegalHoldResponse
-> ReadPrec [GetObjectLegalHoldResponse]
-> Read GetObjectLegalHoldResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObjectLegalHoldResponse]
$creadListPrec :: ReadPrec [GetObjectLegalHoldResponse]
readPrec :: ReadPrec GetObjectLegalHoldResponse
$creadPrec :: ReadPrec GetObjectLegalHoldResponse
readList :: ReadS [GetObjectLegalHoldResponse]
$creadList :: ReadS [GetObjectLegalHoldResponse]
readsPrec :: Int -> ReadS GetObjectLegalHoldResponse
$creadsPrec :: Int -> ReadS GetObjectLegalHoldResponse
Prelude.Read, Int -> GetObjectLegalHoldResponse -> ShowS
[GetObjectLegalHoldResponse] -> ShowS
GetObjectLegalHoldResponse -> String
(Int -> GetObjectLegalHoldResponse -> ShowS)
-> (GetObjectLegalHoldResponse -> String)
-> ([GetObjectLegalHoldResponse] -> ShowS)
-> Show GetObjectLegalHoldResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectLegalHoldResponse] -> ShowS
$cshowList :: [GetObjectLegalHoldResponse] -> ShowS
show :: GetObjectLegalHoldResponse -> String
$cshow :: GetObjectLegalHoldResponse -> String
showsPrec :: Int -> GetObjectLegalHoldResponse -> ShowS
$cshowsPrec :: Int -> GetObjectLegalHoldResponse -> ShowS
Prelude.Show, (forall x.
 GetObjectLegalHoldResponse -> Rep GetObjectLegalHoldResponse x)
-> (forall x.
    Rep GetObjectLegalHoldResponse x -> GetObjectLegalHoldResponse)
-> Generic GetObjectLegalHoldResponse
forall x.
Rep GetObjectLegalHoldResponse x -> GetObjectLegalHoldResponse
forall x.
GetObjectLegalHoldResponse -> Rep GetObjectLegalHoldResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetObjectLegalHoldResponse x -> GetObjectLegalHoldResponse
$cfrom :: forall x.
GetObjectLegalHoldResponse -> Rep GetObjectLegalHoldResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectLegalHoldResponse' 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:
--
-- 'legalHold', 'getObjectLegalHoldResponse_legalHold' - The current Legal Hold status for the specified object.
--
-- 'httpStatus', 'getObjectLegalHoldResponse_httpStatus' - The response's http status code.
newGetObjectLegalHoldResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetObjectLegalHoldResponse
newGetObjectLegalHoldResponse :: Int -> GetObjectLegalHoldResponse
newGetObjectLegalHoldResponse Int
pHttpStatus_ =
  GetObjectLegalHoldResponse' :: Maybe ObjectLockLegalHold -> Int -> GetObjectLegalHoldResponse
GetObjectLegalHoldResponse'
    { $sel:legalHold:GetObjectLegalHoldResponse' :: Maybe ObjectLockLegalHold
legalHold =
        Maybe ObjectLockLegalHold
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetObjectLegalHoldResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current Legal Hold status for the specified object.
getObjectLegalHoldResponse_legalHold :: Lens.Lens' GetObjectLegalHoldResponse (Prelude.Maybe ObjectLockLegalHold)
getObjectLegalHoldResponse_legalHold :: (Maybe ObjectLockLegalHold -> f (Maybe ObjectLockLegalHold))
-> GetObjectLegalHoldResponse -> f GetObjectLegalHoldResponse
getObjectLegalHoldResponse_legalHold = (GetObjectLegalHoldResponse -> Maybe ObjectLockLegalHold)
-> (GetObjectLegalHoldResponse
    -> Maybe ObjectLockLegalHold -> GetObjectLegalHoldResponse)
-> Lens
     GetObjectLegalHoldResponse
     GetObjectLegalHoldResponse
     (Maybe ObjectLockLegalHold)
     (Maybe ObjectLockLegalHold)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectLegalHoldResponse' {Maybe ObjectLockLegalHold
legalHold :: Maybe ObjectLockLegalHold
$sel:legalHold:GetObjectLegalHoldResponse' :: GetObjectLegalHoldResponse -> Maybe ObjectLockLegalHold
legalHold} -> Maybe ObjectLockLegalHold
legalHold) (\s :: GetObjectLegalHoldResponse
s@GetObjectLegalHoldResponse' {} Maybe ObjectLockLegalHold
a -> GetObjectLegalHoldResponse
s {$sel:legalHold:GetObjectLegalHoldResponse' :: Maybe ObjectLockLegalHold
legalHold = Maybe ObjectLockLegalHold
a} :: GetObjectLegalHoldResponse)

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

instance Prelude.NFData GetObjectLegalHoldResponse