{-# 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.LexV2Models.UpdateResourcePolicy
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Replaces the existing resource policy for a bot or bot alias with a new
-- one. If the policy doesn\'t exist, Amazon Lex returns an exception.
module Amazonka.LexV2Models.UpdateResourcePolicy
  ( -- * Creating a Request
    UpdateResourcePolicy (..),
    newUpdateResourcePolicy,

    -- * Request Lenses
    updateResourcePolicy_expectedRevisionId,
    updateResourcePolicy_resourceArn,
    updateResourcePolicy_policy,

    -- * Destructuring the Response
    UpdateResourcePolicyResponse (..),
    newUpdateResourcePolicyResponse,

    -- * Response Lenses
    updateResourcePolicyResponse_resourceArn,
    updateResourcePolicyResponse_revisionId,
    updateResourcePolicyResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateResourcePolicy' smart constructor.
data UpdateResourcePolicy = UpdateResourcePolicy'
  { -- | The identifier of the revision of the policy to update. If this revision
    -- ID doesn\'t match the current revision ID, Amazon Lex throws an
    -- exception.
    --
    -- If you don\'t specify a revision, Amazon Lex overwrites the contents of
    -- the policy with the new values.
    UpdateResourcePolicy -> Maybe Text
expectedRevisionId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the bot or bot alias that the resource
    -- policy is attached to.
    UpdateResourcePolicy -> Text
resourceArn :: Prelude.Text,
    -- | A resource policy to add to the resource. The policy is a JSON structure
    -- that contains one or more statements that define the policy. The policy
    -- must follow the IAM syntax. For more information about the contents of a
    -- JSON policy document, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html IAM JSON policy reference>
    -- .
    --
    -- If the policy isn\'t valid, Amazon Lex returns a validation exception.
    UpdateResourcePolicy -> Text
policy :: Prelude.Text
  }
  deriving (UpdateResourcePolicy -> UpdateResourcePolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateResourcePolicy -> UpdateResourcePolicy -> Bool
$c/= :: UpdateResourcePolicy -> UpdateResourcePolicy -> Bool
== :: UpdateResourcePolicy -> UpdateResourcePolicy -> Bool
$c== :: UpdateResourcePolicy -> UpdateResourcePolicy -> Bool
Prelude.Eq, ReadPrec [UpdateResourcePolicy]
ReadPrec UpdateResourcePolicy
Int -> ReadS UpdateResourcePolicy
ReadS [UpdateResourcePolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateResourcePolicy]
$creadListPrec :: ReadPrec [UpdateResourcePolicy]
readPrec :: ReadPrec UpdateResourcePolicy
$creadPrec :: ReadPrec UpdateResourcePolicy
readList :: ReadS [UpdateResourcePolicy]
$creadList :: ReadS [UpdateResourcePolicy]
readsPrec :: Int -> ReadS UpdateResourcePolicy
$creadsPrec :: Int -> ReadS UpdateResourcePolicy
Prelude.Read, Int -> UpdateResourcePolicy -> ShowS
[UpdateResourcePolicy] -> ShowS
UpdateResourcePolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateResourcePolicy] -> ShowS
$cshowList :: [UpdateResourcePolicy] -> ShowS
show :: UpdateResourcePolicy -> String
$cshow :: UpdateResourcePolicy -> String
showsPrec :: Int -> UpdateResourcePolicy -> ShowS
$cshowsPrec :: Int -> UpdateResourcePolicy -> ShowS
Prelude.Show, forall x. Rep UpdateResourcePolicy x -> UpdateResourcePolicy
forall x. UpdateResourcePolicy -> Rep UpdateResourcePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateResourcePolicy x -> UpdateResourcePolicy
$cfrom :: forall x. UpdateResourcePolicy -> Rep UpdateResourcePolicy x
Prelude.Generic)

-- |
-- Create a value of 'UpdateResourcePolicy' 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:
--
-- 'expectedRevisionId', 'updateResourcePolicy_expectedRevisionId' - The identifier of the revision of the policy to update. If this revision
-- ID doesn\'t match the current revision ID, Amazon Lex throws an
-- exception.
--
-- If you don\'t specify a revision, Amazon Lex overwrites the contents of
-- the policy with the new values.
--
-- 'resourceArn', 'updateResourcePolicy_resourceArn' - The Amazon Resource Name (ARN) of the bot or bot alias that the resource
-- policy is attached to.
--
-- 'policy', 'updateResourcePolicy_policy' - A resource policy to add to the resource. The policy is a JSON structure
-- that contains one or more statements that define the policy. The policy
-- must follow the IAM syntax. For more information about the contents of a
-- JSON policy document, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html IAM JSON policy reference>
-- .
--
-- If the policy isn\'t valid, Amazon Lex returns a validation exception.
newUpdateResourcePolicy ::
  -- | 'resourceArn'
  Prelude.Text ->
  -- | 'policy'
  Prelude.Text ->
  UpdateResourcePolicy
newUpdateResourcePolicy :: Text -> Text -> UpdateResourcePolicy
newUpdateResourcePolicy Text
pResourceArn_ Text
pPolicy_ =
  UpdateResourcePolicy'
    { $sel:expectedRevisionId:UpdateResourcePolicy' :: Maybe Text
expectedRevisionId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:UpdateResourcePolicy' :: Text
resourceArn = Text
pResourceArn_,
      $sel:policy:UpdateResourcePolicy' :: Text
policy = Text
pPolicy_
    }

-- | The identifier of the revision of the policy to update. If this revision
-- ID doesn\'t match the current revision ID, Amazon Lex throws an
-- exception.
--
-- If you don\'t specify a revision, Amazon Lex overwrites the contents of
-- the policy with the new values.
updateResourcePolicy_expectedRevisionId :: Lens.Lens' UpdateResourcePolicy (Prelude.Maybe Prelude.Text)
updateResourcePolicy_expectedRevisionId :: Lens' UpdateResourcePolicy (Maybe Text)
updateResourcePolicy_expectedRevisionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourcePolicy' {Maybe Text
expectedRevisionId :: Maybe Text
$sel:expectedRevisionId:UpdateResourcePolicy' :: UpdateResourcePolicy -> Maybe Text
expectedRevisionId} -> Maybe Text
expectedRevisionId) (\s :: UpdateResourcePolicy
s@UpdateResourcePolicy' {} Maybe Text
a -> UpdateResourcePolicy
s {$sel:expectedRevisionId:UpdateResourcePolicy' :: Maybe Text
expectedRevisionId = Maybe Text
a} :: UpdateResourcePolicy)

-- | The Amazon Resource Name (ARN) of the bot or bot alias that the resource
-- policy is attached to.
updateResourcePolicy_resourceArn :: Lens.Lens' UpdateResourcePolicy Prelude.Text
updateResourcePolicy_resourceArn :: Lens' UpdateResourcePolicy Text
updateResourcePolicy_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourcePolicy' {Text
resourceArn :: Text
$sel:resourceArn:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
resourceArn} -> Text
resourceArn) (\s :: UpdateResourcePolicy
s@UpdateResourcePolicy' {} Text
a -> UpdateResourcePolicy
s {$sel:resourceArn:UpdateResourcePolicy' :: Text
resourceArn = Text
a} :: UpdateResourcePolicy)

-- | A resource policy to add to the resource. The policy is a JSON structure
-- that contains one or more statements that define the policy. The policy
-- must follow the IAM syntax. For more information about the contents of a
-- JSON policy document, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html IAM JSON policy reference>
-- .
--
-- If the policy isn\'t valid, Amazon Lex returns a validation exception.
updateResourcePolicy_policy :: Lens.Lens' UpdateResourcePolicy Prelude.Text
updateResourcePolicy_policy :: Lens' UpdateResourcePolicy Text
updateResourcePolicy_policy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourcePolicy' {Text
policy :: Text
$sel:policy:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
policy} -> Text
policy) (\s :: UpdateResourcePolicy
s@UpdateResourcePolicy' {} Text
a -> UpdateResourcePolicy
s {$sel:policy:UpdateResourcePolicy' :: Text
policy = Text
a} :: UpdateResourcePolicy)

instance Core.AWSRequest UpdateResourcePolicy where
  type
    AWSResponse UpdateResourcePolicy =
      UpdateResourcePolicyResponse
  request :: (Service -> Service)
-> UpdateResourcePolicy -> Request UpdateResourcePolicy
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateResourcePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateResourcePolicy)))
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 Text -> Maybe Text -> Int -> UpdateResourcePolicyResponse
UpdateResourcePolicyResponse'
            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
"resourceArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"revisionId")
            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 UpdateResourcePolicy where
  hashWithSalt :: Int -> UpdateResourcePolicy -> Int
hashWithSalt Int
_salt UpdateResourcePolicy' {Maybe Text
Text
policy :: Text
resourceArn :: Text
expectedRevisionId :: Maybe Text
$sel:policy:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:resourceArn:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:expectedRevisionId:UpdateResourcePolicy' :: UpdateResourcePolicy -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expectedRevisionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policy

instance Prelude.NFData UpdateResourcePolicy where
  rnf :: UpdateResourcePolicy -> ()
rnf UpdateResourcePolicy' {Maybe Text
Text
policy :: Text
resourceArn :: Text
expectedRevisionId :: Maybe Text
$sel:policy:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:resourceArn:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:expectedRevisionId:UpdateResourcePolicy' :: UpdateResourcePolicy -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expectedRevisionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policy

instance Data.ToHeaders UpdateResourcePolicy where
  toHeaders :: UpdateResourcePolicy -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateResourcePolicy where
  toJSON :: UpdateResourcePolicy -> Value
toJSON UpdateResourcePolicy' {Maybe Text
Text
policy :: Text
resourceArn :: Text
expectedRevisionId :: Maybe Text
$sel:policy:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:resourceArn:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:expectedRevisionId:UpdateResourcePolicy' :: UpdateResourcePolicy -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"policy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
policy)]
      )

instance Data.ToPath UpdateResourcePolicy where
  toPath :: UpdateResourcePolicy -> ByteString
toPath UpdateResourcePolicy' {Maybe Text
Text
policy :: Text
resourceArn :: Text
expectedRevisionId :: Maybe Text
$sel:policy:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:resourceArn:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:expectedRevisionId:UpdateResourcePolicy' :: UpdateResourcePolicy -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/policy/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceArn, ByteString
"/"]

instance Data.ToQuery UpdateResourcePolicy where
  toQuery :: UpdateResourcePolicy -> QueryString
toQuery UpdateResourcePolicy' {Maybe Text
Text
policy :: Text
resourceArn :: Text
expectedRevisionId :: Maybe Text
$sel:policy:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:resourceArn:UpdateResourcePolicy' :: UpdateResourcePolicy -> Text
$sel:expectedRevisionId:UpdateResourcePolicy' :: UpdateResourcePolicy -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"expectedRevisionId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
expectedRevisionId]

-- | /See:/ 'newUpdateResourcePolicyResponse' smart constructor.
data UpdateResourcePolicyResponse = UpdateResourcePolicyResponse'
  { -- | The Amazon Resource Name (ARN) of the bot or bot alias that the resource
    -- policy is attached to.
    UpdateResourcePolicyResponse -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
    -- | The current revision of the resource policy. Use the revision ID to make
    -- sure that you are updating the most current version of a resource policy
    -- when you add a policy statement to a resource, delete a resource, or
    -- update a resource.
    UpdateResourcePolicyResponse -> Maybe Text
revisionId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateResourcePolicyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateResourcePolicyResponse
-> UpdateResourcePolicyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateResourcePolicyResponse
-> UpdateResourcePolicyResponse -> Bool
$c/= :: UpdateResourcePolicyResponse
-> UpdateResourcePolicyResponse -> Bool
== :: UpdateResourcePolicyResponse
-> UpdateResourcePolicyResponse -> Bool
$c== :: UpdateResourcePolicyResponse
-> UpdateResourcePolicyResponse -> Bool
Prelude.Eq, ReadPrec [UpdateResourcePolicyResponse]
ReadPrec UpdateResourcePolicyResponse
Int -> ReadS UpdateResourcePolicyResponse
ReadS [UpdateResourcePolicyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateResourcePolicyResponse]
$creadListPrec :: ReadPrec [UpdateResourcePolicyResponse]
readPrec :: ReadPrec UpdateResourcePolicyResponse
$creadPrec :: ReadPrec UpdateResourcePolicyResponse
readList :: ReadS [UpdateResourcePolicyResponse]
$creadList :: ReadS [UpdateResourcePolicyResponse]
readsPrec :: Int -> ReadS UpdateResourcePolicyResponse
$creadsPrec :: Int -> ReadS UpdateResourcePolicyResponse
Prelude.Read, Int -> UpdateResourcePolicyResponse -> ShowS
[UpdateResourcePolicyResponse] -> ShowS
UpdateResourcePolicyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateResourcePolicyResponse] -> ShowS
$cshowList :: [UpdateResourcePolicyResponse] -> ShowS
show :: UpdateResourcePolicyResponse -> String
$cshow :: UpdateResourcePolicyResponse -> String
showsPrec :: Int -> UpdateResourcePolicyResponse -> ShowS
$cshowsPrec :: Int -> UpdateResourcePolicyResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateResourcePolicyResponse x -> UpdateResourcePolicyResponse
forall x.
UpdateResourcePolicyResponse -> Rep UpdateResourcePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateResourcePolicyResponse x -> UpdateResourcePolicyResponse
$cfrom :: forall x.
UpdateResourcePolicyResponse -> Rep UpdateResourcePolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateResourcePolicyResponse' 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:
--
-- 'resourceArn', 'updateResourcePolicyResponse_resourceArn' - The Amazon Resource Name (ARN) of the bot or bot alias that the resource
-- policy is attached to.
--
-- 'revisionId', 'updateResourcePolicyResponse_revisionId' - The current revision of the resource policy. Use the revision ID to make
-- sure that you are updating the most current version of a resource policy
-- when you add a policy statement to a resource, delete a resource, or
-- update a resource.
--
-- 'httpStatus', 'updateResourcePolicyResponse_httpStatus' - The response's http status code.
newUpdateResourcePolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateResourcePolicyResponse
newUpdateResourcePolicyResponse :: Int -> UpdateResourcePolicyResponse
newUpdateResourcePolicyResponse Int
pHttpStatus_ =
  UpdateResourcePolicyResponse'
    { $sel:resourceArn:UpdateResourcePolicyResponse' :: Maybe Text
resourceArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:revisionId:UpdateResourcePolicyResponse' :: Maybe Text
revisionId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateResourcePolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the bot or bot alias that the resource
-- policy is attached to.
updateResourcePolicyResponse_resourceArn :: Lens.Lens' UpdateResourcePolicyResponse (Prelude.Maybe Prelude.Text)
updateResourcePolicyResponse_resourceArn :: Lens' UpdateResourcePolicyResponse (Maybe Text)
updateResourcePolicyResponse_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourcePolicyResponse' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:UpdateResourcePolicyResponse' :: UpdateResourcePolicyResponse -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: UpdateResourcePolicyResponse
s@UpdateResourcePolicyResponse' {} Maybe Text
a -> UpdateResourcePolicyResponse
s {$sel:resourceArn:UpdateResourcePolicyResponse' :: Maybe Text
resourceArn = Maybe Text
a} :: UpdateResourcePolicyResponse)

-- | The current revision of the resource policy. Use the revision ID to make
-- sure that you are updating the most current version of a resource policy
-- when you add a policy statement to a resource, delete a resource, or
-- update a resource.
updateResourcePolicyResponse_revisionId :: Lens.Lens' UpdateResourcePolicyResponse (Prelude.Maybe Prelude.Text)
updateResourcePolicyResponse_revisionId :: Lens' UpdateResourcePolicyResponse (Maybe Text)
updateResourcePolicyResponse_revisionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourcePolicyResponse' {Maybe Text
revisionId :: Maybe Text
$sel:revisionId:UpdateResourcePolicyResponse' :: UpdateResourcePolicyResponse -> Maybe Text
revisionId} -> Maybe Text
revisionId) (\s :: UpdateResourcePolicyResponse
s@UpdateResourcePolicyResponse' {} Maybe Text
a -> UpdateResourcePolicyResponse
s {$sel:revisionId:UpdateResourcePolicyResponse' :: Maybe Text
revisionId = Maybe Text
a} :: UpdateResourcePolicyResponse)

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

instance Prelude.NFData UpdateResourcePolicyResponse where
  rnf :: UpdateResourcePolicyResponse -> ()
rnf UpdateResourcePolicyResponse' {Int
Maybe Text
httpStatus :: Int
revisionId :: Maybe Text
resourceArn :: Maybe Text
$sel:httpStatus:UpdateResourcePolicyResponse' :: UpdateResourcePolicyResponse -> Int
$sel:revisionId:UpdateResourcePolicyResponse' :: UpdateResourcePolicyResponse -> Maybe Text
$sel:resourceArn:UpdateResourcePolicyResponse' :: UpdateResourcePolicyResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revisionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus