{-# 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.XRay.PutResourcePolicy
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Sets the resource policy to grant one or more Amazon Web Services
-- services and accounts permissions to access X-Ray. Each resource policy
-- will be associated with a specific Amazon Web Services account. Each
-- Amazon Web Services account can have a maximum of 5 resource policies,
-- and each policy name must be unique within that account. The maximum
-- size of each resource policy is 5KB.
module Amazonka.XRay.PutResourcePolicy
  ( -- * Creating a Request
    PutResourcePolicy (..),
    newPutResourcePolicy,

    -- * Request Lenses
    putResourcePolicy_bypassPolicyLockoutCheck,
    putResourcePolicy_policyRevisionId,
    putResourcePolicy_policyName,
    putResourcePolicy_policyDocument,

    -- * Destructuring the Response
    PutResourcePolicyResponse (..),
    newPutResourcePolicyResponse,

    -- * Response Lenses
    putResourcePolicyResponse_resourcePolicy,
    putResourcePolicyResponse_httpStatus,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.XRay.Types

-- | /See:/ 'newPutResourcePolicy' smart constructor.
data PutResourcePolicy = PutResourcePolicy'
  { -- | A flag to indicate whether to bypass the resource policy lockout safety
    -- check.
    --
    -- Setting this value to true increases the risk that the policy becomes
    -- unmanageable. Do not set this value to true indiscriminately.
    --
    -- Use this parameter only when you include a policy in the request and you
    -- intend to prevent the principal that is making the request from making a
    -- subsequent @PutResourcePolicy@ request.
    --
    -- The default value is false.
    PutResourcePolicy -> Maybe Bool
bypassPolicyLockoutCheck :: Prelude.Maybe Prelude.Bool,
    -- | Specifies a specific policy revision, to ensure an atomic create
    -- operation. By default the resource policy is created if it does not
    -- exist, or updated with an incremented revision id. The revision id is
    -- unique to each policy in the account.
    --
    -- If the policy revision id does not match the latest revision id, the
    -- operation will fail with an @InvalidPolicyRevisionIdException@
    -- exception. You can also provide a @PolicyRevisionId@ of 0. In this case,
    -- the operation will fail with an @InvalidPolicyRevisionIdException@
    -- exception if a resource policy with the same name already exists.
    PutResourcePolicy -> Maybe Text
policyRevisionId :: Prelude.Maybe Prelude.Text,
    -- | The name of the resource policy. Must be unique within a specific Amazon
    -- Web Services account.
    PutResourcePolicy -> Text
policyName :: Prelude.Text,
    -- | The resource policy document, which can be up to 5kb in size.
    PutResourcePolicy -> Text
policyDocument :: Prelude.Text
  }
  deriving (PutResourcePolicy -> PutResourcePolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResourcePolicy -> PutResourcePolicy -> Bool
$c/= :: PutResourcePolicy -> PutResourcePolicy -> Bool
== :: PutResourcePolicy -> PutResourcePolicy -> Bool
$c== :: PutResourcePolicy -> PutResourcePolicy -> Bool
Prelude.Eq, ReadPrec [PutResourcePolicy]
ReadPrec PutResourcePolicy
Int -> ReadS PutResourcePolicy
ReadS [PutResourcePolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResourcePolicy]
$creadListPrec :: ReadPrec [PutResourcePolicy]
readPrec :: ReadPrec PutResourcePolicy
$creadPrec :: ReadPrec PutResourcePolicy
readList :: ReadS [PutResourcePolicy]
$creadList :: ReadS [PutResourcePolicy]
readsPrec :: Int -> ReadS PutResourcePolicy
$creadsPrec :: Int -> ReadS PutResourcePolicy
Prelude.Read, Int -> PutResourcePolicy -> ShowS
[PutResourcePolicy] -> ShowS
PutResourcePolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResourcePolicy] -> ShowS
$cshowList :: [PutResourcePolicy] -> ShowS
show :: PutResourcePolicy -> String
$cshow :: PutResourcePolicy -> String
showsPrec :: Int -> PutResourcePolicy -> ShowS
$cshowsPrec :: Int -> PutResourcePolicy -> ShowS
Prelude.Show, forall x. Rep PutResourcePolicy x -> PutResourcePolicy
forall x. PutResourcePolicy -> Rep PutResourcePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutResourcePolicy x -> PutResourcePolicy
$cfrom :: forall x. PutResourcePolicy -> Rep PutResourcePolicy x
Prelude.Generic)

-- |
-- Create a value of 'PutResourcePolicy' 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:
--
-- 'bypassPolicyLockoutCheck', 'putResourcePolicy_bypassPolicyLockoutCheck' - A flag to indicate whether to bypass the resource policy lockout safety
-- check.
--
-- Setting this value to true increases the risk that the policy becomes
-- unmanageable. Do not set this value to true indiscriminately.
--
-- Use this parameter only when you include a policy in the request and you
-- intend to prevent the principal that is making the request from making a
-- subsequent @PutResourcePolicy@ request.
--
-- The default value is false.
--
-- 'policyRevisionId', 'putResourcePolicy_policyRevisionId' - Specifies a specific policy revision, to ensure an atomic create
-- operation. By default the resource policy is created if it does not
-- exist, or updated with an incremented revision id. The revision id is
-- unique to each policy in the account.
--
-- If the policy revision id does not match the latest revision id, the
-- operation will fail with an @InvalidPolicyRevisionIdException@
-- exception. You can also provide a @PolicyRevisionId@ of 0. In this case,
-- the operation will fail with an @InvalidPolicyRevisionIdException@
-- exception if a resource policy with the same name already exists.
--
-- 'policyName', 'putResourcePolicy_policyName' - The name of the resource policy. Must be unique within a specific Amazon
-- Web Services account.
--
-- 'policyDocument', 'putResourcePolicy_policyDocument' - The resource policy document, which can be up to 5kb in size.
newPutResourcePolicy ::
  -- | 'policyName'
  Prelude.Text ->
  -- | 'policyDocument'
  Prelude.Text ->
  PutResourcePolicy
newPutResourcePolicy :: Text -> Text -> PutResourcePolicy
newPutResourcePolicy Text
pPolicyName_ Text
pPolicyDocument_ =
  PutResourcePolicy'
    { $sel:bypassPolicyLockoutCheck:PutResourcePolicy' :: Maybe Bool
bypassPolicyLockoutCheck =
        forall a. Maybe a
Prelude.Nothing,
      $sel:policyRevisionId:PutResourcePolicy' :: Maybe Text
policyRevisionId = forall a. Maybe a
Prelude.Nothing,
      $sel:policyName:PutResourcePolicy' :: Text
policyName = Text
pPolicyName_,
      $sel:policyDocument:PutResourcePolicy' :: Text
policyDocument = Text
pPolicyDocument_
    }

-- | A flag to indicate whether to bypass the resource policy lockout safety
-- check.
--
-- Setting this value to true increases the risk that the policy becomes
-- unmanageable. Do not set this value to true indiscriminately.
--
-- Use this parameter only when you include a policy in the request and you
-- intend to prevent the principal that is making the request from making a
-- subsequent @PutResourcePolicy@ request.
--
-- The default value is false.
putResourcePolicy_bypassPolicyLockoutCheck :: Lens.Lens' PutResourcePolicy (Prelude.Maybe Prelude.Bool)
putResourcePolicy_bypassPolicyLockoutCheck :: Lens' PutResourcePolicy (Maybe Bool)
putResourcePolicy_bypassPolicyLockoutCheck = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicy' {Maybe Bool
bypassPolicyLockoutCheck :: Maybe Bool
$sel:bypassPolicyLockoutCheck:PutResourcePolicy' :: PutResourcePolicy -> Maybe Bool
bypassPolicyLockoutCheck} -> Maybe Bool
bypassPolicyLockoutCheck) (\s :: PutResourcePolicy
s@PutResourcePolicy' {} Maybe Bool
a -> PutResourcePolicy
s {$sel:bypassPolicyLockoutCheck:PutResourcePolicy' :: Maybe Bool
bypassPolicyLockoutCheck = Maybe Bool
a} :: PutResourcePolicy)

-- | Specifies a specific policy revision, to ensure an atomic create
-- operation. By default the resource policy is created if it does not
-- exist, or updated with an incremented revision id. The revision id is
-- unique to each policy in the account.
--
-- If the policy revision id does not match the latest revision id, the
-- operation will fail with an @InvalidPolicyRevisionIdException@
-- exception. You can also provide a @PolicyRevisionId@ of 0. In this case,
-- the operation will fail with an @InvalidPolicyRevisionIdException@
-- exception if a resource policy with the same name already exists.
putResourcePolicy_policyRevisionId :: Lens.Lens' PutResourcePolicy (Prelude.Maybe Prelude.Text)
putResourcePolicy_policyRevisionId :: Lens' PutResourcePolicy (Maybe Text)
putResourcePolicy_policyRevisionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicy' {Maybe Text
policyRevisionId :: Maybe Text
$sel:policyRevisionId:PutResourcePolicy' :: PutResourcePolicy -> Maybe Text
policyRevisionId} -> Maybe Text
policyRevisionId) (\s :: PutResourcePolicy
s@PutResourcePolicy' {} Maybe Text
a -> PutResourcePolicy
s {$sel:policyRevisionId:PutResourcePolicy' :: Maybe Text
policyRevisionId = Maybe Text
a} :: PutResourcePolicy)

-- | The name of the resource policy. Must be unique within a specific Amazon
-- Web Services account.
putResourcePolicy_policyName :: Lens.Lens' PutResourcePolicy Prelude.Text
putResourcePolicy_policyName :: Lens' PutResourcePolicy Text
putResourcePolicy_policyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicy' {Text
policyName :: Text
$sel:policyName:PutResourcePolicy' :: PutResourcePolicy -> Text
policyName} -> Text
policyName) (\s :: PutResourcePolicy
s@PutResourcePolicy' {} Text
a -> PutResourcePolicy
s {$sel:policyName:PutResourcePolicy' :: Text
policyName = Text
a} :: PutResourcePolicy)

-- | The resource policy document, which can be up to 5kb in size.
putResourcePolicy_policyDocument :: Lens.Lens' PutResourcePolicy Prelude.Text
putResourcePolicy_policyDocument :: Lens' PutResourcePolicy Text
putResourcePolicy_policyDocument = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicy' {Text
policyDocument :: Text
$sel:policyDocument:PutResourcePolicy' :: PutResourcePolicy -> Text
policyDocument} -> Text
policyDocument) (\s :: PutResourcePolicy
s@PutResourcePolicy' {} Text
a -> PutResourcePolicy
s {$sel:policyDocument:PutResourcePolicy' :: Text
policyDocument = Text
a} :: PutResourcePolicy)

instance Core.AWSRequest PutResourcePolicy where
  type
    AWSResponse PutResourcePolicy =
      PutResourcePolicyResponse
  request :: (Service -> Service)
-> PutResourcePolicy -> Request PutResourcePolicy
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutResourcePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutResourcePolicy)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ResourcePolicy -> Int -> PutResourcePolicyResponse
PutResourcePolicyResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ResourcePolicy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PutResourcePolicy where
  hashWithSalt :: Int -> PutResourcePolicy -> Int
hashWithSalt Int
_salt PutResourcePolicy' {Maybe Bool
Maybe Text
Text
policyDocument :: Text
policyName :: Text
policyRevisionId :: Maybe Text
bypassPolicyLockoutCheck :: Maybe Bool
$sel:policyDocument:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:policyName:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:policyRevisionId:PutResourcePolicy' :: PutResourcePolicy -> Maybe Text
$sel:bypassPolicyLockoutCheck:PutResourcePolicy' :: PutResourcePolicy -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
bypassPolicyLockoutCheck
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyRevisionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyDocument

instance Prelude.NFData PutResourcePolicy where
  rnf :: PutResourcePolicy -> ()
rnf PutResourcePolicy' {Maybe Bool
Maybe Text
Text
policyDocument :: Text
policyName :: Text
policyRevisionId :: Maybe Text
bypassPolicyLockoutCheck :: Maybe Bool
$sel:policyDocument:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:policyName:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:policyRevisionId:PutResourcePolicy' :: PutResourcePolicy -> Maybe Text
$sel:bypassPolicyLockoutCheck:PutResourcePolicy' :: PutResourcePolicy -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
bypassPolicyLockoutCheck
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyRevisionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyDocument

instance Data.ToHeaders PutResourcePolicy where
  toHeaders :: PutResourcePolicy -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON PutResourcePolicy where
  toJSON :: PutResourcePolicy -> Value
toJSON PutResourcePolicy' {Maybe Bool
Maybe Text
Text
policyDocument :: Text
policyName :: Text
policyRevisionId :: Maybe Text
bypassPolicyLockoutCheck :: Maybe Bool
$sel:policyDocument:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:policyName:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:policyRevisionId:PutResourcePolicy' :: PutResourcePolicy -> Maybe Text
$sel:bypassPolicyLockoutCheck:PutResourcePolicy' :: PutResourcePolicy -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BypassPolicyLockoutCheck" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
bypassPolicyLockoutCheck,
            (Key
"PolicyRevisionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyRevisionId,
            forall a. a -> Maybe a
Prelude.Just (Key
"PolicyName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
policyName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"PolicyDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
policyDocument)
          ]
      )

instance Data.ToPath PutResourcePolicy where
  toPath :: PutResourcePolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/PutResourcePolicy"

instance Data.ToQuery PutResourcePolicy where
  toQuery :: PutResourcePolicy -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutResourcePolicyResponse' smart constructor.
data PutResourcePolicyResponse = PutResourcePolicyResponse'
  { -- | The resource policy document, as provided in the
    -- @PutResourcePolicyRequest@.
    PutResourcePolicyResponse -> Maybe ResourcePolicy
resourcePolicy :: Prelude.Maybe ResourcePolicy,
    -- | The response's http status code.
    PutResourcePolicyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool
$c/= :: PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool
== :: PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool
$c== :: PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutResourcePolicyResponse]
ReadPrec PutResourcePolicyResponse
Int -> ReadS PutResourcePolicyResponse
ReadS [PutResourcePolicyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResourcePolicyResponse]
$creadListPrec :: ReadPrec [PutResourcePolicyResponse]
readPrec :: ReadPrec PutResourcePolicyResponse
$creadPrec :: ReadPrec PutResourcePolicyResponse
readList :: ReadS [PutResourcePolicyResponse]
$creadList :: ReadS [PutResourcePolicyResponse]
readsPrec :: Int -> ReadS PutResourcePolicyResponse
$creadsPrec :: Int -> ReadS PutResourcePolicyResponse
Prelude.Read, Int -> PutResourcePolicyResponse -> ShowS
[PutResourcePolicyResponse] -> ShowS
PutResourcePolicyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResourcePolicyResponse] -> ShowS
$cshowList :: [PutResourcePolicyResponse] -> ShowS
show :: PutResourcePolicyResponse -> String
$cshow :: PutResourcePolicyResponse -> String
showsPrec :: Int -> PutResourcePolicyResponse -> ShowS
$cshowsPrec :: Int -> PutResourcePolicyResponse -> ShowS
Prelude.Show, forall x.
Rep PutResourcePolicyResponse x -> PutResourcePolicyResponse
forall x.
PutResourcePolicyResponse -> Rep PutResourcePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutResourcePolicyResponse x -> PutResourcePolicyResponse
$cfrom :: forall x.
PutResourcePolicyResponse -> Rep PutResourcePolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutResourcePolicyResponse' 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:
--
-- 'resourcePolicy', 'putResourcePolicyResponse_resourcePolicy' - The resource policy document, as provided in the
-- @PutResourcePolicyRequest@.
--
-- 'httpStatus', 'putResourcePolicyResponse_httpStatus' - The response's http status code.
newPutResourcePolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutResourcePolicyResponse
newPutResourcePolicyResponse :: Int -> PutResourcePolicyResponse
newPutResourcePolicyResponse Int
pHttpStatus_ =
  PutResourcePolicyResponse'
    { $sel:resourcePolicy:PutResourcePolicyResponse' :: Maybe ResourcePolicy
resourcePolicy =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutResourcePolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The resource policy document, as provided in the
-- @PutResourcePolicyRequest@.
putResourcePolicyResponse_resourcePolicy :: Lens.Lens' PutResourcePolicyResponse (Prelude.Maybe ResourcePolicy)
putResourcePolicyResponse_resourcePolicy :: Lens' PutResourcePolicyResponse (Maybe ResourcePolicy)
putResourcePolicyResponse_resourcePolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicyResponse' {Maybe ResourcePolicy
resourcePolicy :: Maybe ResourcePolicy
$sel:resourcePolicy:PutResourcePolicyResponse' :: PutResourcePolicyResponse -> Maybe ResourcePolicy
resourcePolicy} -> Maybe ResourcePolicy
resourcePolicy) (\s :: PutResourcePolicyResponse
s@PutResourcePolicyResponse' {} Maybe ResourcePolicy
a -> PutResourcePolicyResponse
s {$sel:resourcePolicy:PutResourcePolicyResponse' :: Maybe ResourcePolicy
resourcePolicy = Maybe ResourcePolicy
a} :: PutResourcePolicyResponse)

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

instance Prelude.NFData PutResourcePolicyResponse where
  rnf :: PutResourcePolicyResponse -> ()
rnf PutResourcePolicyResponse' {Int
Maybe ResourcePolicy
httpStatus :: Int
resourcePolicy :: Maybe ResourcePolicy
$sel:httpStatus:PutResourcePolicyResponse' :: PutResourcePolicyResponse -> Int
$sel:resourcePolicy:PutResourcePolicyResponse' :: PutResourcePolicyResponse -> Maybe ResourcePolicy
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourcePolicy
resourcePolicy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus