{-# 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.GetResourcePolicy
-- 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)
--
-- Retrieves the JSON text of the resource-based policy document attached
-- to the specified secret. The JSON request string input and response
-- output displays formatted code with white space and line breaks for
-- better readability. Submit your input as a single line JSON string.
--
-- __Minimum permissions__
--
-- To run this command, you must have the following permissions:
--
-- -   secretsmanager:GetResourcePolicy
--
-- __Related operations__
--
-- -   To attach a resource policy to a secret, use PutResourcePolicy.
--
-- -   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.GetResourcePolicy
  ( -- * Creating a Request
    GetResourcePolicy (..),
    newGetResourcePolicy,

    -- * Request Lenses
    getResourcePolicy_secretId,

    -- * Destructuring the Response
    GetResourcePolicyResponse (..),
    newGetResourcePolicyResponse,

    -- * Response Lenses
    getResourcePolicyResponse_resourcePolicy,
    getResourcePolicyResponse_arn,
    getResourcePolicyResponse_name,
    getResourcePolicyResponse_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:/ 'newGetResourcePolicy' smart constructor.
data GetResourcePolicy = GetResourcePolicy'
  { -- | Specifies the secret that you want to retrieve the attached
    -- resource-based policy for. You can specify either the Amazon Resource
    -- Name (ARN) or the friendly name of the secret.
    --
    -- For an ARN, we recommend that you specify a complete ARN rather than a
    -- partial ARN.
    GetResourcePolicy -> Text
secretId :: Prelude.Text
  }
  deriving (GetResourcePolicy -> GetResourcePolicy -> Bool
(GetResourcePolicy -> GetResourcePolicy -> Bool)
-> (GetResourcePolicy -> GetResourcePolicy -> Bool)
-> Eq GetResourcePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourcePolicy -> GetResourcePolicy -> Bool
$c/= :: GetResourcePolicy -> GetResourcePolicy -> Bool
== :: GetResourcePolicy -> GetResourcePolicy -> Bool
$c== :: GetResourcePolicy -> GetResourcePolicy -> Bool
Prelude.Eq, ReadPrec [GetResourcePolicy]
ReadPrec GetResourcePolicy
Int -> ReadS GetResourcePolicy
ReadS [GetResourcePolicy]
(Int -> ReadS GetResourcePolicy)
-> ReadS [GetResourcePolicy]
-> ReadPrec GetResourcePolicy
-> ReadPrec [GetResourcePolicy]
-> Read GetResourcePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourcePolicy]
$creadListPrec :: ReadPrec [GetResourcePolicy]
readPrec :: ReadPrec GetResourcePolicy
$creadPrec :: ReadPrec GetResourcePolicy
readList :: ReadS [GetResourcePolicy]
$creadList :: ReadS [GetResourcePolicy]
readsPrec :: Int -> ReadS GetResourcePolicy
$creadsPrec :: Int -> ReadS GetResourcePolicy
Prelude.Read, Int -> GetResourcePolicy -> ShowS
[GetResourcePolicy] -> ShowS
GetResourcePolicy -> String
(Int -> GetResourcePolicy -> ShowS)
-> (GetResourcePolicy -> String)
-> ([GetResourcePolicy] -> ShowS)
-> Show GetResourcePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourcePolicy] -> ShowS
$cshowList :: [GetResourcePolicy] -> ShowS
show :: GetResourcePolicy -> String
$cshow :: GetResourcePolicy -> String
showsPrec :: Int -> GetResourcePolicy -> ShowS
$cshowsPrec :: Int -> GetResourcePolicy -> ShowS
Prelude.Show, (forall x. GetResourcePolicy -> Rep GetResourcePolicy x)
-> (forall x. Rep GetResourcePolicy x -> GetResourcePolicy)
-> Generic GetResourcePolicy
forall x. Rep GetResourcePolicy x -> GetResourcePolicy
forall x. GetResourcePolicy -> Rep GetResourcePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResourcePolicy x -> GetResourcePolicy
$cfrom :: forall x. GetResourcePolicy -> Rep GetResourcePolicy x
Prelude.Generic)

-- |
-- Create a value of 'GetResourcePolicy' 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:
--
-- 'secretId', 'getResourcePolicy_secretId' - Specifies the secret that you want to retrieve the attached
-- resource-based policy for. You can specify either the Amazon Resource
-- Name (ARN) or the friendly name of the secret.
--
-- For an ARN, we recommend that you specify a complete ARN rather than a
-- partial ARN.
newGetResourcePolicy ::
  -- | 'secretId'
  Prelude.Text ->
  GetResourcePolicy
newGetResourcePolicy :: Text -> GetResourcePolicy
newGetResourcePolicy Text
pSecretId_ =
  GetResourcePolicy' :: Text -> GetResourcePolicy
GetResourcePolicy' {$sel:secretId:GetResourcePolicy' :: Text
secretId = Text
pSecretId_}

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

instance Core.AWSRequest GetResourcePolicy where
  type
    AWSResponse GetResourcePolicy =
      GetResourcePolicyResponse
  request :: GetResourcePolicy -> Request GetResourcePolicy
request = Service -> GetResourcePolicy -> Request GetResourcePolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetResourcePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetResourcePolicy)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetResourcePolicy))
-> Logger
-> Service
-> Proxy GetResourcePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetResourcePolicy)))
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 -> Maybe Text -> Int -> GetResourcePolicyResponse
GetResourcePolicyResponse'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Int -> GetResourcePolicyResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> GetResourcePolicyResponse)
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
"ResourcePolicy")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> GetResourcePolicyResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetResourcePolicyResponse)
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
"ARN")
            Either String (Maybe Text -> Int -> GetResourcePolicyResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetResourcePolicyResponse)
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 -> GetResourcePolicyResponse)
-> Either String Int -> Either String GetResourcePolicyResponse
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 GetResourcePolicy

instance Prelude.NFData GetResourcePolicy

instance Core.ToHeaders GetResourcePolicy where
  toHeaders :: GetResourcePolicy -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetResourcePolicy -> 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.GetResourcePolicy" ::
                          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 GetResourcePolicy where
  toJSON :: GetResourcePolicy -> Value
toJSON GetResourcePolicy' {Text
secretId :: Text
$sel:secretId:GetResourcePolicy' :: GetResourcePolicy -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [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)]
      )

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

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

-- | /See:/ 'newGetResourcePolicyResponse' smart constructor.
data GetResourcePolicyResponse = GetResourcePolicyResponse'
  { -- | A JSON-formatted string that describes the permissions that are
    -- associated with the attached secret. These permissions are combined with
    -- any permissions that are associated with the user or role that attempts
    -- to access this secret. The combined permissions specify who can access
    -- the secret and what actions they can perform. For more information, see
    -- <http://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html Authentication and Access Control for Amazon Web Services Secrets Manager>
    -- in the /Amazon Web Services Secrets Manager User Guide/.
    GetResourcePolicyResponse -> Maybe Text
resourcePolicy :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the secret that the resource-based policy was retrieved for.
    GetResourcePolicyResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The friendly name of the secret that the resource-based policy was
    -- retrieved for.
    GetResourcePolicyResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetResourcePolicyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetResourcePolicyResponse -> GetResourcePolicyResponse -> Bool
(GetResourcePolicyResponse -> GetResourcePolicyResponse -> Bool)
-> (GetResourcePolicyResponse -> GetResourcePolicyResponse -> Bool)
-> Eq GetResourcePolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourcePolicyResponse -> GetResourcePolicyResponse -> Bool
$c/= :: GetResourcePolicyResponse -> GetResourcePolicyResponse -> Bool
== :: GetResourcePolicyResponse -> GetResourcePolicyResponse -> Bool
$c== :: GetResourcePolicyResponse -> GetResourcePolicyResponse -> Bool
Prelude.Eq, ReadPrec [GetResourcePolicyResponse]
ReadPrec GetResourcePolicyResponse
Int -> ReadS GetResourcePolicyResponse
ReadS [GetResourcePolicyResponse]
(Int -> ReadS GetResourcePolicyResponse)
-> ReadS [GetResourcePolicyResponse]
-> ReadPrec GetResourcePolicyResponse
-> ReadPrec [GetResourcePolicyResponse]
-> Read GetResourcePolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourcePolicyResponse]
$creadListPrec :: ReadPrec [GetResourcePolicyResponse]
readPrec :: ReadPrec GetResourcePolicyResponse
$creadPrec :: ReadPrec GetResourcePolicyResponse
readList :: ReadS [GetResourcePolicyResponse]
$creadList :: ReadS [GetResourcePolicyResponse]
readsPrec :: Int -> ReadS GetResourcePolicyResponse
$creadsPrec :: Int -> ReadS GetResourcePolicyResponse
Prelude.Read, Int -> GetResourcePolicyResponse -> ShowS
[GetResourcePolicyResponse] -> ShowS
GetResourcePolicyResponse -> String
(Int -> GetResourcePolicyResponse -> ShowS)
-> (GetResourcePolicyResponse -> String)
-> ([GetResourcePolicyResponse] -> ShowS)
-> Show GetResourcePolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourcePolicyResponse] -> ShowS
$cshowList :: [GetResourcePolicyResponse] -> ShowS
show :: GetResourcePolicyResponse -> String
$cshow :: GetResourcePolicyResponse -> String
showsPrec :: Int -> GetResourcePolicyResponse -> ShowS
$cshowsPrec :: Int -> GetResourcePolicyResponse -> ShowS
Prelude.Show, (forall x.
 GetResourcePolicyResponse -> Rep GetResourcePolicyResponse x)
-> (forall x.
    Rep GetResourcePolicyResponse x -> GetResourcePolicyResponse)
-> Generic GetResourcePolicyResponse
forall x.
Rep GetResourcePolicyResponse x -> GetResourcePolicyResponse
forall x.
GetResourcePolicyResponse -> Rep GetResourcePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetResourcePolicyResponse x -> GetResourcePolicyResponse
$cfrom :: forall x.
GetResourcePolicyResponse -> Rep GetResourcePolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetResourcePolicyResponse' 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', 'getResourcePolicyResponse_resourcePolicy' - A JSON-formatted string that describes the permissions that are
-- associated with the attached secret. These permissions are combined with
-- any permissions that are associated with the user or role that attempts
-- to access this secret. The combined permissions specify who can access
-- the secret and what actions they can perform. For more information, see
-- <http://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html Authentication and Access Control for Amazon Web Services Secrets Manager>
-- in the /Amazon Web Services Secrets Manager User Guide/.
--
-- 'arn', 'getResourcePolicyResponse_arn' - The ARN of the secret that the resource-based policy was retrieved for.
--
-- 'name', 'getResourcePolicyResponse_name' - The friendly name of the secret that the resource-based policy was
-- retrieved for.
--
-- 'httpStatus', 'getResourcePolicyResponse_httpStatus' - The response's http status code.
newGetResourcePolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetResourcePolicyResponse
newGetResourcePolicyResponse :: Int -> GetResourcePolicyResponse
newGetResourcePolicyResponse Int
pHttpStatus_ =
  GetResourcePolicyResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> GetResourcePolicyResponse
GetResourcePolicyResponse'
    { $sel:resourcePolicy:GetResourcePolicyResponse' :: Maybe Text
resourcePolicy =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetResourcePolicyResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetResourcePolicyResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetResourcePolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A JSON-formatted string that describes the permissions that are
-- associated with the attached secret. These permissions are combined with
-- any permissions that are associated with the user or role that attempts
-- to access this secret. The combined permissions specify who can access
-- the secret and what actions they can perform. For more information, see
-- <http://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html Authentication and Access Control for Amazon Web Services Secrets Manager>
-- in the /Amazon Web Services Secrets Manager User Guide/.
getResourcePolicyResponse_resourcePolicy :: Lens.Lens' GetResourcePolicyResponse (Prelude.Maybe Prelude.Text)
getResourcePolicyResponse_resourcePolicy :: (Maybe Text -> f (Maybe Text))
-> GetResourcePolicyResponse -> f GetResourcePolicyResponse
getResourcePolicyResponse_resourcePolicy = (GetResourcePolicyResponse -> Maybe Text)
-> (GetResourcePolicyResponse
    -> Maybe Text -> GetResourcePolicyResponse)
-> Lens
     GetResourcePolicyResponse
     GetResourcePolicyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcePolicyResponse' {Maybe Text
resourcePolicy :: Maybe Text
$sel:resourcePolicy:GetResourcePolicyResponse' :: GetResourcePolicyResponse -> Maybe Text
resourcePolicy} -> Maybe Text
resourcePolicy) (\s :: GetResourcePolicyResponse
s@GetResourcePolicyResponse' {} Maybe Text
a -> GetResourcePolicyResponse
s {$sel:resourcePolicy:GetResourcePolicyResponse' :: Maybe Text
resourcePolicy = Maybe Text
a} :: GetResourcePolicyResponse)

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

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

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

instance Prelude.NFData GetResourcePolicyResponse