{-# 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.SecretsManager.PutResourcePolicy
-- 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)
--
-- Attaches the contents of the specified resource-based permission policy
-- to a secret. A resource-based policy is optional. Alternatively, you can
-- use IAM identity-based policies that specify the secret\'s Amazon
-- Resource Name (ARN) in the policy statement\'s @Resources@ element. You
-- can also use a combination of both identity-based and resource-based
-- policies. The affected users and roles receive the permissions that are
-- permitted by all of the relevant policies. For more information, see
-- <http://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html Using Resource-Based Policies for Amazon Web Services Secrets Manager>.
-- For the complete description of the Amazon Web Services policy syntax
-- and grammar, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html IAM JSON Policy Reference>
-- in the /IAM User Guide/.
--
-- __Minimum permissions__
--
-- To run this command, you must have the following permissions:
--
-- -   secretsmanager:PutResourcePolicy
--
-- __Related operations__
--
-- -   To retrieve the resource policy attached to a secret, use
--     GetResourcePolicy.
--
-- -   To delete the resource-based policy attached to a secret, use
--     DeleteResourcePolicy.
--
-- -   To list all of the currently available secrets, use ListSecrets.
module Amazonka.SecretsManager.PutResourcePolicy
  ( -- * Creating a Request
    PutResourcePolicy (..),
    newPutResourcePolicy,

    -- * Request Lenses
    putResourcePolicy_blockPublicPolicy,
    putResourcePolicy_secretId,
    putResourcePolicy_resourcePolicy,

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

    -- * Response Lenses
    putResourcePolicyResponse_arn,
    putResourcePolicyResponse_name,
    putResourcePolicyResponse_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.SecretsManager.Types

-- | /See:/ 'newPutResourcePolicy' smart constructor.
data PutResourcePolicy = PutResourcePolicy'
  { -- | (Optional) If you set the parameter, @BlockPublicPolicy@ to true, then
    -- you block resource-based policies that allow broad access to the secret.
    PutResourcePolicy -> Maybe Bool
blockPublicPolicy :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the secret that you want to attach the resource-based policy.
    -- You can specify either the ARN or the friendly name of the secret.
    --
    -- For an ARN, we recommend that you specify a complete ARN rather than a
    -- partial ARN.
    PutResourcePolicy -> Text
secretId :: Prelude.Text,
    -- | A JSON-formatted string constructed according to the grammar and syntax
    -- for an Amazon Web Services resource-based policy. The policy in the
    -- string identifies who can access or manage this secret and its versions.
    -- For information on how to format a JSON parameter for the various
    -- command line tool environments, see
    -- <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json Using JSON for Parameters>
    -- in the /CLI User Guide/.
    PutResourcePolicy -> Text
resourcePolicy :: Prelude.Text
  }
  deriving (PutResourcePolicy -> PutResourcePolicy -> Bool
(PutResourcePolicy -> PutResourcePolicy -> Bool)
-> (PutResourcePolicy -> PutResourcePolicy -> Bool)
-> Eq PutResourcePolicy
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]
(Int -> ReadS PutResourcePolicy)
-> ReadS [PutResourcePolicy]
-> ReadPrec PutResourcePolicy
-> ReadPrec [PutResourcePolicy]
-> Read 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
(Int -> PutResourcePolicy -> ShowS)
-> (PutResourcePolicy -> String)
-> ([PutResourcePolicy] -> ShowS)
-> Show PutResourcePolicy
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. PutResourcePolicy -> Rep PutResourcePolicy x)
-> (forall x. Rep PutResourcePolicy x -> PutResourcePolicy)
-> Generic PutResourcePolicy
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:
--
-- 'blockPublicPolicy', 'putResourcePolicy_blockPublicPolicy' - (Optional) If you set the parameter, @BlockPublicPolicy@ to true, then
-- you block resource-based policies that allow broad access to the secret.
--
-- 'secretId', 'putResourcePolicy_secretId' - Specifies the secret that you want to attach the resource-based policy.
-- You can specify either the ARN or the friendly name of the secret.
--
-- For an ARN, we recommend that you specify a complete ARN rather than a
-- partial ARN.
--
-- 'resourcePolicy', 'putResourcePolicy_resourcePolicy' - A JSON-formatted string constructed according to the grammar and syntax
-- for an Amazon Web Services resource-based policy. The policy in the
-- string identifies who can access or manage this secret and its versions.
-- For information on how to format a JSON parameter for the various
-- command line tool environments, see
-- <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json Using JSON for Parameters>
-- in the /CLI User Guide/.
newPutResourcePolicy ::
  -- | 'secretId'
  Prelude.Text ->
  -- | 'resourcePolicy'
  Prelude.Text ->
  PutResourcePolicy
newPutResourcePolicy :: Text -> Text -> PutResourcePolicy
newPutResourcePolicy Text
pSecretId_ Text
pResourcePolicy_ =
  PutResourcePolicy' :: Maybe Bool -> Text -> Text -> PutResourcePolicy
PutResourcePolicy'
    { $sel:blockPublicPolicy:PutResourcePolicy' :: Maybe Bool
blockPublicPolicy =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:secretId:PutResourcePolicy' :: Text
secretId = Text
pSecretId_,
      $sel:resourcePolicy:PutResourcePolicy' :: Text
resourcePolicy = Text
pResourcePolicy_
    }

-- | (Optional) If you set the parameter, @BlockPublicPolicy@ to true, then
-- you block resource-based policies that allow broad access to the secret.
putResourcePolicy_blockPublicPolicy :: Lens.Lens' PutResourcePolicy (Prelude.Maybe Prelude.Bool)
putResourcePolicy_blockPublicPolicy :: (Maybe Bool -> f (Maybe Bool))
-> PutResourcePolicy -> f PutResourcePolicy
putResourcePolicy_blockPublicPolicy = (PutResourcePolicy -> Maybe Bool)
-> (PutResourcePolicy -> Maybe Bool -> PutResourcePolicy)
-> Lens
     PutResourcePolicy PutResourcePolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicy' {Maybe Bool
blockPublicPolicy :: Maybe Bool
$sel:blockPublicPolicy:PutResourcePolicy' :: PutResourcePolicy -> Maybe Bool
blockPublicPolicy} -> Maybe Bool
blockPublicPolicy) (\s :: PutResourcePolicy
s@PutResourcePolicy' {} Maybe Bool
a -> PutResourcePolicy
s {$sel:blockPublicPolicy:PutResourcePolicy' :: Maybe Bool
blockPublicPolicy = Maybe Bool
a} :: PutResourcePolicy)

-- | Specifies the secret that you want to attach the resource-based policy.
-- You can specify either the ARN or the friendly name of the secret.
--
-- For an ARN, we recommend that you specify a complete ARN rather than a
-- partial ARN.
putResourcePolicy_secretId :: Lens.Lens' PutResourcePolicy Prelude.Text
putResourcePolicy_secretId :: (Text -> f Text) -> PutResourcePolicy -> f PutResourcePolicy
putResourcePolicy_secretId = (PutResourcePolicy -> Text)
-> (PutResourcePolicy -> Text -> PutResourcePolicy)
-> Lens PutResourcePolicy PutResourcePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicy' {Text
secretId :: Text
$sel:secretId:PutResourcePolicy' :: PutResourcePolicy -> Text
secretId} -> Text
secretId) (\s :: PutResourcePolicy
s@PutResourcePolicy' {} Text
a -> PutResourcePolicy
s {$sel:secretId:PutResourcePolicy' :: Text
secretId = Text
a} :: PutResourcePolicy)

-- | A JSON-formatted string constructed according to the grammar and syntax
-- for an Amazon Web Services resource-based policy. The policy in the
-- string identifies who can access or manage this secret and its versions.
-- For information on how to format a JSON parameter for the various
-- command line tool environments, see
-- <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json Using JSON for Parameters>
-- in the /CLI User Guide/.
putResourcePolicy_resourcePolicy :: Lens.Lens' PutResourcePolicy Prelude.Text
putResourcePolicy_resourcePolicy :: (Text -> f Text) -> PutResourcePolicy -> f PutResourcePolicy
putResourcePolicy_resourcePolicy = (PutResourcePolicy -> Text)
-> (PutResourcePolicy -> Text -> PutResourcePolicy)
-> Lens PutResourcePolicy PutResourcePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicy' {Text
resourcePolicy :: Text
$sel:resourcePolicy:PutResourcePolicy' :: PutResourcePolicy -> Text
resourcePolicy} -> Text
resourcePolicy) (\s :: PutResourcePolicy
s@PutResourcePolicy' {} Text
a -> PutResourcePolicy
s {$sel:resourcePolicy:PutResourcePolicy' :: Text
resourcePolicy = Text
a} :: PutResourcePolicy)

instance Core.AWSRequest PutResourcePolicy where
  type
    AWSResponse PutResourcePolicy =
      PutResourcePolicyResponse
  request :: PutResourcePolicy -> Request PutResourcePolicy
request = Service -> PutResourcePolicy -> Request PutResourcePolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutResourcePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutResourcePolicy)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutResourcePolicy))
-> Logger
-> Service
-> Proxy PutResourcePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutResourcePolicy)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Int -> PutResourcePolicyResponse
PutResourcePolicyResponse'
            (Maybe Text -> Maybe Text -> Int -> PutResourcePolicyResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> PutResourcePolicyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ARN")
            Either String (Maybe Text -> Int -> PutResourcePolicyResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PutResourcePolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
            Either String (Int -> PutResourcePolicyResponse)
-> Either String Int -> Either String PutResourcePolicyResponse
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 PutResourcePolicy

instance Prelude.NFData PutResourcePolicy

instance Core.ToHeaders PutResourcePolicy where
  toHeaders :: PutResourcePolicy -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutResourcePolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"secretsmanager.PutResourcePolicy" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PutResourcePolicy where
  toJSON :: PutResourcePolicy -> Value
toJSON PutResourcePolicy' {Maybe Bool
Text
resourcePolicy :: Text
secretId :: Text
blockPublicPolicy :: Maybe Bool
$sel:resourcePolicy:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:secretId:PutResourcePolicy' :: PutResourcePolicy -> Text
$sel:blockPublicPolicy:PutResourcePolicy' :: PutResourcePolicy -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"BlockPublicPolicy" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
blockPublicPolicy,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SecretId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ResourcePolicy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourcePolicy)
          ]
      )

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

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

-- | /See:/ 'newPutResourcePolicyResponse' smart constructor.
data PutResourcePolicyResponse = PutResourcePolicyResponse'
  { -- | The ARN of the secret retrieved by the resource-based policy.
    PutResourcePolicyResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The friendly name of the secret retrieved by the resource-based policy.
    PutResourcePolicyResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    PutResourcePolicyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool
(PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool)
-> (PutResourcePolicyResponse -> PutResourcePolicyResponse -> Bool)
-> Eq PutResourcePolicyResponse
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]
(Int -> ReadS PutResourcePolicyResponse)
-> ReadS [PutResourcePolicyResponse]
-> ReadPrec PutResourcePolicyResponse
-> ReadPrec [PutResourcePolicyResponse]
-> Read 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
(Int -> PutResourcePolicyResponse -> ShowS)
-> (PutResourcePolicyResponse -> String)
-> ([PutResourcePolicyResponse] -> ShowS)
-> Show PutResourcePolicyResponse
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.
 PutResourcePolicyResponse -> Rep PutResourcePolicyResponse x)
-> (forall x.
    Rep PutResourcePolicyResponse x -> PutResourcePolicyResponse)
-> Generic PutResourcePolicyResponse
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:
--
-- 'arn', 'putResourcePolicyResponse_arn' - The ARN of the secret retrieved by the resource-based policy.
--
-- 'name', 'putResourcePolicyResponse_name' - The friendly name of the secret retrieved by the resource-based policy.
--
-- 'httpStatus', 'putResourcePolicyResponse_httpStatus' - The response's http status code.
newPutResourcePolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutResourcePolicyResponse
newPutResourcePolicyResponse :: Int -> PutResourcePolicyResponse
newPutResourcePolicyResponse Int
pHttpStatus_ =
  PutResourcePolicyResponse' :: Maybe Text -> Maybe Text -> Int -> PutResourcePolicyResponse
PutResourcePolicyResponse'
    { $sel:arn:PutResourcePolicyResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:PutResourcePolicyResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutResourcePolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the secret retrieved by the resource-based policy.
putResourcePolicyResponse_arn :: Lens.Lens' PutResourcePolicyResponse (Prelude.Maybe Prelude.Text)
putResourcePolicyResponse_arn :: (Maybe Text -> f (Maybe Text))
-> PutResourcePolicyResponse -> f PutResourcePolicyResponse
putResourcePolicyResponse_arn = (PutResourcePolicyResponse -> Maybe Text)
-> (PutResourcePolicyResponse
    -> Maybe Text -> PutResourcePolicyResponse)
-> Lens
     PutResourcePolicyResponse
     PutResourcePolicyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicyResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:PutResourcePolicyResponse' :: PutResourcePolicyResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PutResourcePolicyResponse
s@PutResourcePolicyResponse' {} Maybe Text
a -> PutResourcePolicyResponse
s {$sel:arn:PutResourcePolicyResponse' :: Maybe Text
arn = Maybe Text
a} :: PutResourcePolicyResponse)

-- | The friendly name of the secret retrieved by the resource-based policy.
putResourcePolicyResponse_name :: Lens.Lens' PutResourcePolicyResponse (Prelude.Maybe Prelude.Text)
putResourcePolicyResponse_name :: (Maybe Text -> f (Maybe Text))
-> PutResourcePolicyResponse -> f PutResourcePolicyResponse
putResourcePolicyResponse_name = (PutResourcePolicyResponse -> Maybe Text)
-> (PutResourcePolicyResponse
    -> Maybe Text -> PutResourcePolicyResponse)
-> Lens
     PutResourcePolicyResponse
     PutResourcePolicyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourcePolicyResponse' {Maybe Text
name :: Maybe Text
$sel:name:PutResourcePolicyResponse' :: PutResourcePolicyResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: PutResourcePolicyResponse
s@PutResourcePolicyResponse' {} Maybe Text
a -> PutResourcePolicyResponse
s {$sel:name:PutResourcePolicyResponse' :: Maybe Text
name = Maybe Text
a} :: PutResourcePolicyResponse)

-- | The response's http status code.
putResourcePolicyResponse_httpStatus :: Lens.Lens' PutResourcePolicyResponse Prelude.Int
putResourcePolicyResponse_httpStatus :: (Int -> f Int)
-> PutResourcePolicyResponse -> f PutResourcePolicyResponse
putResourcePolicyResponse_httpStatus = (PutResourcePolicyResponse -> Int)
-> (PutResourcePolicyResponse -> Int -> PutResourcePolicyResponse)
-> Lens PutResourcePolicyResponse PutResourcePolicyResponse Int Int
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