{-# 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.Glue.GetResourcePolicies
-- 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 resource policies set on individual resources by Resource
-- Access Manager during cross-account permission grants. Also retrieves
-- the Data Catalog resource policy.
--
-- If you enabled metadata encryption in Data Catalog settings, and you do
-- not have permission on the KMS key, the operation can\'t return the Data
-- Catalog resource policy.
--
-- This operation returns paginated results.
module Amazonka.Glue.GetResourcePolicies
  ( -- * Creating a Request
    GetResourcePolicies (..),
    newGetResourcePolicies,

    -- * Request Lenses
    getResourcePolicies_nextToken,
    getResourcePolicies_maxResults,

    -- * Destructuring the Response
    GetResourcePoliciesResponse (..),
    newGetResourcePoliciesResponse,

    -- * Response Lenses
    getResourcePoliciesResponse_getResourcePoliciesResponseList,
    getResourcePoliciesResponse_nextToken,
    getResourcePoliciesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetResourcePolicies' smart constructor.
data GetResourcePolicies = GetResourcePolicies'
  { -- | A continuation token, if this is a continuation request.
    GetResourcePolicies -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum size of a list to return.
    GetResourcePolicies -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (GetResourcePolicies -> GetResourcePolicies -> Bool
(GetResourcePolicies -> GetResourcePolicies -> Bool)
-> (GetResourcePolicies -> GetResourcePolicies -> Bool)
-> Eq GetResourcePolicies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourcePolicies -> GetResourcePolicies -> Bool
$c/= :: GetResourcePolicies -> GetResourcePolicies -> Bool
== :: GetResourcePolicies -> GetResourcePolicies -> Bool
$c== :: GetResourcePolicies -> GetResourcePolicies -> Bool
Prelude.Eq, ReadPrec [GetResourcePolicies]
ReadPrec GetResourcePolicies
Int -> ReadS GetResourcePolicies
ReadS [GetResourcePolicies]
(Int -> ReadS GetResourcePolicies)
-> ReadS [GetResourcePolicies]
-> ReadPrec GetResourcePolicies
-> ReadPrec [GetResourcePolicies]
-> Read GetResourcePolicies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourcePolicies]
$creadListPrec :: ReadPrec [GetResourcePolicies]
readPrec :: ReadPrec GetResourcePolicies
$creadPrec :: ReadPrec GetResourcePolicies
readList :: ReadS [GetResourcePolicies]
$creadList :: ReadS [GetResourcePolicies]
readsPrec :: Int -> ReadS GetResourcePolicies
$creadsPrec :: Int -> ReadS GetResourcePolicies
Prelude.Read, Int -> GetResourcePolicies -> ShowS
[GetResourcePolicies] -> ShowS
GetResourcePolicies -> String
(Int -> GetResourcePolicies -> ShowS)
-> (GetResourcePolicies -> String)
-> ([GetResourcePolicies] -> ShowS)
-> Show GetResourcePolicies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourcePolicies] -> ShowS
$cshowList :: [GetResourcePolicies] -> ShowS
show :: GetResourcePolicies -> String
$cshow :: GetResourcePolicies -> String
showsPrec :: Int -> GetResourcePolicies -> ShowS
$cshowsPrec :: Int -> GetResourcePolicies -> ShowS
Prelude.Show, (forall x. GetResourcePolicies -> Rep GetResourcePolicies x)
-> (forall x. Rep GetResourcePolicies x -> GetResourcePolicies)
-> Generic GetResourcePolicies
forall x. Rep GetResourcePolicies x -> GetResourcePolicies
forall x. GetResourcePolicies -> Rep GetResourcePolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResourcePolicies x -> GetResourcePolicies
$cfrom :: forall x. GetResourcePolicies -> Rep GetResourcePolicies x
Prelude.Generic)

-- |
-- Create a value of 'GetResourcePolicies' 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:
--
-- 'nextToken', 'getResourcePolicies_nextToken' - A continuation token, if this is a continuation request.
--
-- 'maxResults', 'getResourcePolicies_maxResults' - The maximum size of a list to return.
newGetResourcePolicies ::
  GetResourcePolicies
newGetResourcePolicies :: GetResourcePolicies
newGetResourcePolicies =
  GetResourcePolicies' :: Maybe Text -> Maybe Natural -> GetResourcePolicies
GetResourcePolicies'
    { $sel:nextToken:GetResourcePolicies' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetResourcePolicies' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A continuation token, if this is a continuation request.
getResourcePolicies_nextToken :: Lens.Lens' GetResourcePolicies (Prelude.Maybe Prelude.Text)
getResourcePolicies_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetResourcePolicies -> f GetResourcePolicies
getResourcePolicies_nextToken = (GetResourcePolicies -> Maybe Text)
-> (GetResourcePolicies -> Maybe Text -> GetResourcePolicies)
-> Lens
     GetResourcePolicies GetResourcePolicies (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcePolicies' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetResourcePolicies' :: GetResourcePolicies -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetResourcePolicies
s@GetResourcePolicies' {} Maybe Text
a -> GetResourcePolicies
s {$sel:nextToken:GetResourcePolicies' :: Maybe Text
nextToken = Maybe Text
a} :: GetResourcePolicies)

-- | The maximum size of a list to return.
getResourcePolicies_maxResults :: Lens.Lens' GetResourcePolicies (Prelude.Maybe Prelude.Natural)
getResourcePolicies_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetResourcePolicies -> f GetResourcePolicies
getResourcePolicies_maxResults = (GetResourcePolicies -> Maybe Natural)
-> (GetResourcePolicies -> Maybe Natural -> GetResourcePolicies)
-> Lens
     GetResourcePolicies
     GetResourcePolicies
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcePolicies' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetResourcePolicies' :: GetResourcePolicies -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetResourcePolicies
s@GetResourcePolicies' {} Maybe Natural
a -> GetResourcePolicies
s {$sel:maxResults:GetResourcePolicies' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetResourcePolicies)

instance Core.AWSPager GetResourcePolicies where
  page :: GetResourcePolicies
-> AWSResponse GetResourcePolicies -> Maybe GetResourcePolicies
page GetResourcePolicies
rq AWSResponse GetResourcePolicies
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetResourcePolicies
GetResourcePoliciesResponse
rs
            GetResourcePoliciesResponse
-> Getting (First Text) GetResourcePoliciesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetResourcePoliciesResponse
-> Const (First Text) GetResourcePoliciesResponse
Lens' GetResourcePoliciesResponse (Maybe Text)
getResourcePoliciesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetResourcePoliciesResponse
 -> Const (First Text) GetResourcePoliciesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetResourcePoliciesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetResourcePolicies
forall a. Maybe a
Prelude.Nothing
    | Maybe [GluePolicy] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetResourcePolicies
GetResourcePoliciesResponse
rs
            GetResourcePoliciesResponse
-> Getting
     (First [GluePolicy]) GetResourcePoliciesResponse [GluePolicy]
-> Maybe [GluePolicy]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [GluePolicy]
 -> Const (First [GluePolicy]) (Maybe [GluePolicy]))
-> GetResourcePoliciesResponse
-> Const (First [GluePolicy]) GetResourcePoliciesResponse
Lens' GetResourcePoliciesResponse (Maybe [GluePolicy])
getResourcePoliciesResponse_getResourcePoliciesResponseList
              ((Maybe [GluePolicy]
  -> Const (First [GluePolicy]) (Maybe [GluePolicy]))
 -> GetResourcePoliciesResponse
 -> Const (First [GluePolicy]) GetResourcePoliciesResponse)
-> (([GluePolicy] -> Const (First [GluePolicy]) [GluePolicy])
    -> Maybe [GluePolicy]
    -> Const (First [GluePolicy]) (Maybe [GluePolicy]))
-> Getting
     (First [GluePolicy]) GetResourcePoliciesResponse [GluePolicy]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GluePolicy] -> Const (First [GluePolicy]) [GluePolicy])
-> Maybe [GluePolicy]
-> Const (First [GluePolicy]) (Maybe [GluePolicy])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetResourcePolicies
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetResourcePolicies -> Maybe GetResourcePolicies
forall a. a -> Maybe a
Prelude.Just (GetResourcePolicies -> Maybe GetResourcePolicies)
-> GetResourcePolicies -> Maybe GetResourcePolicies
forall a b. (a -> b) -> a -> b
Prelude.$
        GetResourcePolicies
rq
          GetResourcePolicies
-> (GetResourcePolicies -> GetResourcePolicies)
-> GetResourcePolicies
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetResourcePolicies -> Identity GetResourcePolicies
Lens
  GetResourcePolicies GetResourcePolicies (Maybe Text) (Maybe Text)
getResourcePolicies_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetResourcePolicies -> Identity GetResourcePolicies)
-> Maybe Text -> GetResourcePolicies -> GetResourcePolicies
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetResourcePolicies
GetResourcePoliciesResponse
rs
          GetResourcePoliciesResponse
-> Getting (First Text) GetResourcePoliciesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetResourcePoliciesResponse
-> Const (First Text) GetResourcePoliciesResponse
Lens' GetResourcePoliciesResponse (Maybe Text)
getResourcePoliciesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetResourcePoliciesResponse
 -> Const (First Text) GetResourcePoliciesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetResourcePoliciesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetResourcePolicies where
  type
    AWSResponse GetResourcePolicies =
      GetResourcePoliciesResponse
  request :: GetResourcePolicies -> Request GetResourcePolicies
request = Service -> GetResourcePolicies -> Request GetResourcePolicies
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetResourcePolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetResourcePolicies)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetResourcePolicies))
-> Logger
-> Service
-> Proxy GetResourcePolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetResourcePolicies)))
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 [GluePolicy]
-> Maybe Text -> Int -> GetResourcePoliciesResponse
GetResourcePoliciesResponse'
            (Maybe [GluePolicy]
 -> Maybe Text -> Int -> GetResourcePoliciesResponse)
-> Either String (Maybe [GluePolicy])
-> Either String (Maybe Text -> Int -> GetResourcePoliciesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [GluePolicy]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GetResourcePoliciesResponseList"
                            Either String (Maybe (Maybe [GluePolicy]))
-> Maybe [GluePolicy] -> Either String (Maybe [GluePolicy])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GluePolicy]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> GetResourcePoliciesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetResourcePoliciesResponse)
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
"NextToken")
            Either String (Int -> GetResourcePoliciesResponse)
-> Either String Int -> Either String GetResourcePoliciesResponse
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 GetResourcePolicies

instance Prelude.NFData GetResourcePolicies

instance Core.ToHeaders GetResourcePolicies where
  toHeaders :: GetResourcePolicies -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetResourcePolicies -> 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
"AWSGlue.GetResourcePolicies" ::
                          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 GetResourcePolicies where
  toJSON :: GetResourcePolicies -> Value
toJSON GetResourcePolicies' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:GetResourcePolicies' :: GetResourcePolicies -> Maybe Natural
$sel:nextToken:GetResourcePolicies' :: GetResourcePolicies -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newGetResourcePoliciesResponse' smart constructor.
data GetResourcePoliciesResponse = GetResourcePoliciesResponse'
  { -- | A list of the individual resource policies and the account-level
    -- resource policy.
    GetResourcePoliciesResponse -> Maybe [GluePolicy]
getResourcePoliciesResponseList :: Prelude.Maybe [GluePolicy],
    -- | A continuation token, if the returned list does not contain the last
    -- resource policy available.
    GetResourcePoliciesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetResourcePoliciesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetResourcePoliciesResponse -> GetResourcePoliciesResponse -> Bool
(GetResourcePoliciesResponse
 -> GetResourcePoliciesResponse -> Bool)
-> (GetResourcePoliciesResponse
    -> GetResourcePoliciesResponse -> Bool)
-> Eq GetResourcePoliciesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourcePoliciesResponse -> GetResourcePoliciesResponse -> Bool
$c/= :: GetResourcePoliciesResponse -> GetResourcePoliciesResponse -> Bool
== :: GetResourcePoliciesResponse -> GetResourcePoliciesResponse -> Bool
$c== :: GetResourcePoliciesResponse -> GetResourcePoliciesResponse -> Bool
Prelude.Eq, ReadPrec [GetResourcePoliciesResponse]
ReadPrec GetResourcePoliciesResponse
Int -> ReadS GetResourcePoliciesResponse
ReadS [GetResourcePoliciesResponse]
(Int -> ReadS GetResourcePoliciesResponse)
-> ReadS [GetResourcePoliciesResponse]
-> ReadPrec GetResourcePoliciesResponse
-> ReadPrec [GetResourcePoliciesResponse]
-> Read GetResourcePoliciesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourcePoliciesResponse]
$creadListPrec :: ReadPrec [GetResourcePoliciesResponse]
readPrec :: ReadPrec GetResourcePoliciesResponse
$creadPrec :: ReadPrec GetResourcePoliciesResponse
readList :: ReadS [GetResourcePoliciesResponse]
$creadList :: ReadS [GetResourcePoliciesResponse]
readsPrec :: Int -> ReadS GetResourcePoliciesResponse
$creadsPrec :: Int -> ReadS GetResourcePoliciesResponse
Prelude.Read, Int -> GetResourcePoliciesResponse -> ShowS
[GetResourcePoliciesResponse] -> ShowS
GetResourcePoliciesResponse -> String
(Int -> GetResourcePoliciesResponse -> ShowS)
-> (GetResourcePoliciesResponse -> String)
-> ([GetResourcePoliciesResponse] -> ShowS)
-> Show GetResourcePoliciesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourcePoliciesResponse] -> ShowS
$cshowList :: [GetResourcePoliciesResponse] -> ShowS
show :: GetResourcePoliciesResponse -> String
$cshow :: GetResourcePoliciesResponse -> String
showsPrec :: Int -> GetResourcePoliciesResponse -> ShowS
$cshowsPrec :: Int -> GetResourcePoliciesResponse -> ShowS
Prelude.Show, (forall x.
 GetResourcePoliciesResponse -> Rep GetResourcePoliciesResponse x)
-> (forall x.
    Rep GetResourcePoliciesResponse x -> GetResourcePoliciesResponse)
-> Generic GetResourcePoliciesResponse
forall x.
Rep GetResourcePoliciesResponse x -> GetResourcePoliciesResponse
forall x.
GetResourcePoliciesResponse -> Rep GetResourcePoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetResourcePoliciesResponse x -> GetResourcePoliciesResponse
$cfrom :: forall x.
GetResourcePoliciesResponse -> Rep GetResourcePoliciesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetResourcePoliciesResponse' 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:
--
-- 'getResourcePoliciesResponseList', 'getResourcePoliciesResponse_getResourcePoliciesResponseList' - A list of the individual resource policies and the account-level
-- resource policy.
--
-- 'nextToken', 'getResourcePoliciesResponse_nextToken' - A continuation token, if the returned list does not contain the last
-- resource policy available.
--
-- 'httpStatus', 'getResourcePoliciesResponse_httpStatus' - The response's http status code.
newGetResourcePoliciesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetResourcePoliciesResponse
newGetResourcePoliciesResponse :: Int -> GetResourcePoliciesResponse
newGetResourcePoliciesResponse Int
pHttpStatus_ =
  GetResourcePoliciesResponse' :: Maybe [GluePolicy]
-> Maybe Text -> Int -> GetResourcePoliciesResponse
GetResourcePoliciesResponse'
    { $sel:getResourcePoliciesResponseList:GetResourcePoliciesResponse' :: Maybe [GluePolicy]
getResourcePoliciesResponseList =
        Maybe [GluePolicy]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetResourcePoliciesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetResourcePoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of the individual resource policies and the account-level
-- resource policy.
getResourcePoliciesResponse_getResourcePoliciesResponseList :: Lens.Lens' GetResourcePoliciesResponse (Prelude.Maybe [GluePolicy])
getResourcePoliciesResponse_getResourcePoliciesResponseList :: (Maybe [GluePolicy] -> f (Maybe [GluePolicy]))
-> GetResourcePoliciesResponse -> f GetResourcePoliciesResponse
getResourcePoliciesResponse_getResourcePoliciesResponseList = (GetResourcePoliciesResponse -> Maybe [GluePolicy])
-> (GetResourcePoliciesResponse
    -> Maybe [GluePolicy] -> GetResourcePoliciesResponse)
-> Lens' GetResourcePoliciesResponse (Maybe [GluePolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcePoliciesResponse' {Maybe [GluePolicy]
getResourcePoliciesResponseList :: Maybe [GluePolicy]
$sel:getResourcePoliciesResponseList:GetResourcePoliciesResponse' :: GetResourcePoliciesResponse -> Maybe [GluePolicy]
getResourcePoliciesResponseList} -> Maybe [GluePolicy]
getResourcePoliciesResponseList) (\s :: GetResourcePoliciesResponse
s@GetResourcePoliciesResponse' {} Maybe [GluePolicy]
a -> GetResourcePoliciesResponse
s {$sel:getResourcePoliciesResponseList:GetResourcePoliciesResponse' :: Maybe [GluePolicy]
getResourcePoliciesResponseList = Maybe [GluePolicy]
a} :: GetResourcePoliciesResponse) ((Maybe [GluePolicy] -> f (Maybe [GluePolicy]))
 -> GetResourcePoliciesResponse -> f GetResourcePoliciesResponse)
-> ((Maybe [GluePolicy] -> f (Maybe [GluePolicy]))
    -> Maybe [GluePolicy] -> f (Maybe [GluePolicy]))
-> (Maybe [GluePolicy] -> f (Maybe [GluePolicy]))
-> GetResourcePoliciesResponse
-> f GetResourcePoliciesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GluePolicy] [GluePolicy] [GluePolicy] [GluePolicy]
-> Iso
     (Maybe [GluePolicy])
     (Maybe [GluePolicy])
     (Maybe [GluePolicy])
     (Maybe [GluePolicy])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [GluePolicy] [GluePolicy] [GluePolicy] [GluePolicy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A continuation token, if the returned list does not contain the last
-- resource policy available.
getResourcePoliciesResponse_nextToken :: Lens.Lens' GetResourcePoliciesResponse (Prelude.Maybe Prelude.Text)
getResourcePoliciesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetResourcePoliciesResponse -> f GetResourcePoliciesResponse
getResourcePoliciesResponse_nextToken = (GetResourcePoliciesResponse -> Maybe Text)
-> (GetResourcePoliciesResponse
    -> Maybe Text -> GetResourcePoliciesResponse)
-> Lens' GetResourcePoliciesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcePoliciesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetResourcePoliciesResponse' :: GetResourcePoliciesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetResourcePoliciesResponse
s@GetResourcePoliciesResponse' {} Maybe Text
a -> GetResourcePoliciesResponse
s {$sel:nextToken:GetResourcePoliciesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetResourcePoliciesResponse)

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

instance Prelude.NFData GetResourcePoliciesResponse