{-# 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.LakeFormation.GetEffectivePermissionsForPath
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the Lake Formation permissions for a specified table or database
-- resource located at a path in Amazon S3.
-- @GetEffectivePermissionsForPath@ will not return databases and tables if
-- the catalog is encrypted.
module Amazonka.LakeFormation.GetEffectivePermissionsForPath
  ( -- * Creating a Request
    GetEffectivePermissionsForPath (..),
    newGetEffectivePermissionsForPath,

    -- * Request Lenses
    getEffectivePermissionsForPath_catalogId,
    getEffectivePermissionsForPath_maxResults,
    getEffectivePermissionsForPath_nextToken,
    getEffectivePermissionsForPath_resourceArn,

    -- * Destructuring the Response
    GetEffectivePermissionsForPathResponse (..),
    newGetEffectivePermissionsForPathResponse,

    -- * Response Lenses
    getEffectivePermissionsForPathResponse_nextToken,
    getEffectivePermissionsForPathResponse_permissions,
    getEffectivePermissionsForPathResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetEffectivePermissionsForPath' smart constructor.
data GetEffectivePermissionsForPath = GetEffectivePermissionsForPath'
  { -- | The identifier for the Data Catalog. By default, the account ID. The
    -- Data Catalog is the persistent metadata store. It contains database
    -- definitions, table definitions, and other control information to manage
    -- your Lake Formation environment.
    GetEffectivePermissionsForPath -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    GetEffectivePermissionsForPath -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A continuation token, if this is not the first call to retrieve this
    -- list.
    GetEffectivePermissionsForPath -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the resource for which you want to get
    -- permissions.
    GetEffectivePermissionsForPath -> Text
resourceArn :: Prelude.Text
  }
  deriving (GetEffectivePermissionsForPath
-> GetEffectivePermissionsForPath -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEffectivePermissionsForPath
-> GetEffectivePermissionsForPath -> Bool
$c/= :: GetEffectivePermissionsForPath
-> GetEffectivePermissionsForPath -> Bool
== :: GetEffectivePermissionsForPath
-> GetEffectivePermissionsForPath -> Bool
$c== :: GetEffectivePermissionsForPath
-> GetEffectivePermissionsForPath -> Bool
Prelude.Eq, ReadPrec [GetEffectivePermissionsForPath]
ReadPrec GetEffectivePermissionsForPath
Int -> ReadS GetEffectivePermissionsForPath
ReadS [GetEffectivePermissionsForPath]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEffectivePermissionsForPath]
$creadListPrec :: ReadPrec [GetEffectivePermissionsForPath]
readPrec :: ReadPrec GetEffectivePermissionsForPath
$creadPrec :: ReadPrec GetEffectivePermissionsForPath
readList :: ReadS [GetEffectivePermissionsForPath]
$creadList :: ReadS [GetEffectivePermissionsForPath]
readsPrec :: Int -> ReadS GetEffectivePermissionsForPath
$creadsPrec :: Int -> ReadS GetEffectivePermissionsForPath
Prelude.Read, Int -> GetEffectivePermissionsForPath -> ShowS
[GetEffectivePermissionsForPath] -> ShowS
GetEffectivePermissionsForPath -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEffectivePermissionsForPath] -> ShowS
$cshowList :: [GetEffectivePermissionsForPath] -> ShowS
show :: GetEffectivePermissionsForPath -> String
$cshow :: GetEffectivePermissionsForPath -> String
showsPrec :: Int -> GetEffectivePermissionsForPath -> ShowS
$cshowsPrec :: Int -> GetEffectivePermissionsForPath -> ShowS
Prelude.Show, forall x.
Rep GetEffectivePermissionsForPath x
-> GetEffectivePermissionsForPath
forall x.
GetEffectivePermissionsForPath
-> Rep GetEffectivePermissionsForPath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEffectivePermissionsForPath x
-> GetEffectivePermissionsForPath
$cfrom :: forall x.
GetEffectivePermissionsForPath
-> Rep GetEffectivePermissionsForPath x
Prelude.Generic)

-- |
-- Create a value of 'GetEffectivePermissionsForPath' 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:
--
-- 'catalogId', 'getEffectivePermissionsForPath_catalogId' - The identifier for the Data Catalog. By default, the account ID. The
-- Data Catalog is the persistent metadata store. It contains database
-- definitions, table definitions, and other control information to manage
-- your Lake Formation environment.
--
-- 'maxResults', 'getEffectivePermissionsForPath_maxResults' - The maximum number of results to return.
--
-- 'nextToken', 'getEffectivePermissionsForPath_nextToken' - A continuation token, if this is not the first call to retrieve this
-- list.
--
-- 'resourceArn', 'getEffectivePermissionsForPath_resourceArn' - The Amazon Resource Name (ARN) of the resource for which you want to get
-- permissions.
newGetEffectivePermissionsForPath ::
  -- | 'resourceArn'
  Prelude.Text ->
  GetEffectivePermissionsForPath
newGetEffectivePermissionsForPath :: Text -> GetEffectivePermissionsForPath
newGetEffectivePermissionsForPath Text
pResourceArn_ =
  GetEffectivePermissionsForPath'
    { $sel:catalogId:GetEffectivePermissionsForPath' :: Maybe Text
catalogId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetEffectivePermissionsForPath' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetEffectivePermissionsForPath' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:GetEffectivePermissionsForPath' :: Text
resourceArn = Text
pResourceArn_
    }

-- | The identifier for the Data Catalog. By default, the account ID. The
-- Data Catalog is the persistent metadata store. It contains database
-- definitions, table definitions, and other control information to manage
-- your Lake Formation environment.
getEffectivePermissionsForPath_catalogId :: Lens.Lens' GetEffectivePermissionsForPath (Prelude.Maybe Prelude.Text)
getEffectivePermissionsForPath_catalogId :: Lens' GetEffectivePermissionsForPath (Maybe Text)
getEffectivePermissionsForPath_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectivePermissionsForPath' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GetEffectivePermissionsForPath
s@GetEffectivePermissionsForPath' {} Maybe Text
a -> GetEffectivePermissionsForPath
s {$sel:catalogId:GetEffectivePermissionsForPath' :: Maybe Text
catalogId = Maybe Text
a} :: GetEffectivePermissionsForPath)

-- | The maximum number of results to return.
getEffectivePermissionsForPath_maxResults :: Lens.Lens' GetEffectivePermissionsForPath (Prelude.Maybe Prelude.Natural)
getEffectivePermissionsForPath_maxResults :: Lens' GetEffectivePermissionsForPath (Maybe Natural)
getEffectivePermissionsForPath_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectivePermissionsForPath' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetEffectivePermissionsForPath
s@GetEffectivePermissionsForPath' {} Maybe Natural
a -> GetEffectivePermissionsForPath
s {$sel:maxResults:GetEffectivePermissionsForPath' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetEffectivePermissionsForPath)

-- | A continuation token, if this is not the first call to retrieve this
-- list.
getEffectivePermissionsForPath_nextToken :: Lens.Lens' GetEffectivePermissionsForPath (Prelude.Maybe Prelude.Text)
getEffectivePermissionsForPath_nextToken :: Lens' GetEffectivePermissionsForPath (Maybe Text)
getEffectivePermissionsForPath_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectivePermissionsForPath' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEffectivePermissionsForPath
s@GetEffectivePermissionsForPath' {} Maybe Text
a -> GetEffectivePermissionsForPath
s {$sel:nextToken:GetEffectivePermissionsForPath' :: Maybe Text
nextToken = Maybe Text
a} :: GetEffectivePermissionsForPath)

-- | The Amazon Resource Name (ARN) of the resource for which you want to get
-- permissions.
getEffectivePermissionsForPath_resourceArn :: Lens.Lens' GetEffectivePermissionsForPath Prelude.Text
getEffectivePermissionsForPath_resourceArn :: Lens' GetEffectivePermissionsForPath Text
getEffectivePermissionsForPath_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectivePermissionsForPath' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Text
resourceArn} -> Text
resourceArn) (\s :: GetEffectivePermissionsForPath
s@GetEffectivePermissionsForPath' {} Text
a -> GetEffectivePermissionsForPath
s {$sel:resourceArn:GetEffectivePermissionsForPath' :: Text
resourceArn = Text
a} :: GetEffectivePermissionsForPath)

instance
  Core.AWSRequest
    GetEffectivePermissionsForPath
  where
  type
    AWSResponse GetEffectivePermissionsForPath =
      GetEffectivePermissionsForPathResponse
  request :: (Service -> Service)
-> GetEffectivePermissionsForPath
-> Request GetEffectivePermissionsForPath
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetEffectivePermissionsForPath
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetEffectivePermissionsForPath)))
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 [PrincipalResourcePermissions]
-> Int
-> GetEffectivePermissionsForPathResponse
GetEffectivePermissionsForPathResponse'
            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
"NextToken")
            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
"Permissions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            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
    GetEffectivePermissionsForPath
  where
  hashWithSalt :: Int -> GetEffectivePermissionsForPath -> Int
hashWithSalt
    Int
_salt
    GetEffectivePermissionsForPath' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:resourceArn:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Text
$sel:nextToken:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Text
$sel:maxResults:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Natural
$sel:catalogId:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn

instance
  Prelude.NFData
    GetEffectivePermissionsForPath
  where
  rnf :: GetEffectivePermissionsForPath -> ()
rnf GetEffectivePermissionsForPath' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:resourceArn:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Text
$sel:nextToken:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Text
$sel:maxResults:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Natural
$sel:catalogId:GetEffectivePermissionsForPath' :: GetEffectivePermissionsForPath -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn

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

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

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

-- | /See:/ 'newGetEffectivePermissionsForPathResponse' smart constructor.
data GetEffectivePermissionsForPathResponse = GetEffectivePermissionsForPathResponse'
  { -- | A continuation token, if this is not the first call to retrieve this
    -- list.
    GetEffectivePermissionsForPathResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the permissions for the specified table or database resource
    -- located at the path in Amazon S3.
    GetEffectivePermissionsForPathResponse
-> Maybe [PrincipalResourcePermissions]
permissions :: Prelude.Maybe [PrincipalResourcePermissions],
    -- | The response's http status code.
    GetEffectivePermissionsForPathResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetEffectivePermissionsForPathResponse
-> GetEffectivePermissionsForPathResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEffectivePermissionsForPathResponse
-> GetEffectivePermissionsForPathResponse -> Bool
$c/= :: GetEffectivePermissionsForPathResponse
-> GetEffectivePermissionsForPathResponse -> Bool
== :: GetEffectivePermissionsForPathResponse
-> GetEffectivePermissionsForPathResponse -> Bool
$c== :: GetEffectivePermissionsForPathResponse
-> GetEffectivePermissionsForPathResponse -> Bool
Prelude.Eq, ReadPrec [GetEffectivePermissionsForPathResponse]
ReadPrec GetEffectivePermissionsForPathResponse
Int -> ReadS GetEffectivePermissionsForPathResponse
ReadS [GetEffectivePermissionsForPathResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEffectivePermissionsForPathResponse]
$creadListPrec :: ReadPrec [GetEffectivePermissionsForPathResponse]
readPrec :: ReadPrec GetEffectivePermissionsForPathResponse
$creadPrec :: ReadPrec GetEffectivePermissionsForPathResponse
readList :: ReadS [GetEffectivePermissionsForPathResponse]
$creadList :: ReadS [GetEffectivePermissionsForPathResponse]
readsPrec :: Int -> ReadS GetEffectivePermissionsForPathResponse
$creadsPrec :: Int -> ReadS GetEffectivePermissionsForPathResponse
Prelude.Read, Int -> GetEffectivePermissionsForPathResponse -> ShowS
[GetEffectivePermissionsForPathResponse] -> ShowS
GetEffectivePermissionsForPathResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEffectivePermissionsForPathResponse] -> ShowS
$cshowList :: [GetEffectivePermissionsForPathResponse] -> ShowS
show :: GetEffectivePermissionsForPathResponse -> String
$cshow :: GetEffectivePermissionsForPathResponse -> String
showsPrec :: Int -> GetEffectivePermissionsForPathResponse -> ShowS
$cshowsPrec :: Int -> GetEffectivePermissionsForPathResponse -> ShowS
Prelude.Show, forall x.
Rep GetEffectivePermissionsForPathResponse x
-> GetEffectivePermissionsForPathResponse
forall x.
GetEffectivePermissionsForPathResponse
-> Rep GetEffectivePermissionsForPathResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEffectivePermissionsForPathResponse x
-> GetEffectivePermissionsForPathResponse
$cfrom :: forall x.
GetEffectivePermissionsForPathResponse
-> Rep GetEffectivePermissionsForPathResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetEffectivePermissionsForPathResponse' 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', 'getEffectivePermissionsForPathResponse_nextToken' - A continuation token, if this is not the first call to retrieve this
-- list.
--
-- 'permissions', 'getEffectivePermissionsForPathResponse_permissions' - A list of the permissions for the specified table or database resource
-- located at the path in Amazon S3.
--
-- 'httpStatus', 'getEffectivePermissionsForPathResponse_httpStatus' - The response's http status code.
newGetEffectivePermissionsForPathResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetEffectivePermissionsForPathResponse
newGetEffectivePermissionsForPathResponse :: Int -> GetEffectivePermissionsForPathResponse
newGetEffectivePermissionsForPathResponse
  Int
pHttpStatus_ =
    GetEffectivePermissionsForPathResponse'
      { $sel:nextToken:GetEffectivePermissionsForPathResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:permissions:GetEffectivePermissionsForPathResponse' :: Maybe [PrincipalResourcePermissions]
permissions = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetEffectivePermissionsForPathResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A continuation token, if this is not the first call to retrieve this
-- list.
getEffectivePermissionsForPathResponse_nextToken :: Lens.Lens' GetEffectivePermissionsForPathResponse (Prelude.Maybe Prelude.Text)
getEffectivePermissionsForPathResponse_nextToken :: Lens' GetEffectivePermissionsForPathResponse (Maybe Text)
getEffectivePermissionsForPathResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectivePermissionsForPathResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEffectivePermissionsForPathResponse' :: GetEffectivePermissionsForPathResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEffectivePermissionsForPathResponse
s@GetEffectivePermissionsForPathResponse' {} Maybe Text
a -> GetEffectivePermissionsForPathResponse
s {$sel:nextToken:GetEffectivePermissionsForPathResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetEffectivePermissionsForPathResponse)

-- | A list of the permissions for the specified table or database resource
-- located at the path in Amazon S3.
getEffectivePermissionsForPathResponse_permissions :: Lens.Lens' GetEffectivePermissionsForPathResponse (Prelude.Maybe [PrincipalResourcePermissions])
getEffectivePermissionsForPathResponse_permissions :: Lens'
  GetEffectivePermissionsForPathResponse
  (Maybe [PrincipalResourcePermissions])
getEffectivePermissionsForPathResponse_permissions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectivePermissionsForPathResponse' {Maybe [PrincipalResourcePermissions]
permissions :: Maybe [PrincipalResourcePermissions]
$sel:permissions:GetEffectivePermissionsForPathResponse' :: GetEffectivePermissionsForPathResponse
-> Maybe [PrincipalResourcePermissions]
permissions} -> Maybe [PrincipalResourcePermissions]
permissions) (\s :: GetEffectivePermissionsForPathResponse
s@GetEffectivePermissionsForPathResponse' {} Maybe [PrincipalResourcePermissions]
a -> GetEffectivePermissionsForPathResponse
s {$sel:permissions:GetEffectivePermissionsForPathResponse' :: Maybe [PrincipalResourcePermissions]
permissions = Maybe [PrincipalResourcePermissions]
a} :: GetEffectivePermissionsForPathResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetEffectivePermissionsForPathResponse
  where
  rnf :: GetEffectivePermissionsForPathResponse -> ()
rnf GetEffectivePermissionsForPathResponse' {Int
Maybe [PrincipalResourcePermissions]
Maybe Text
httpStatus :: Int
permissions :: Maybe [PrincipalResourcePermissions]
nextToken :: Maybe Text
$sel:httpStatus:GetEffectivePermissionsForPathResponse' :: GetEffectivePermissionsForPathResponse -> Int
$sel:permissions:GetEffectivePermissionsForPathResponse' :: GetEffectivePermissionsForPathResponse
-> Maybe [PrincipalResourcePermissions]
$sel:nextToken:GetEffectivePermissionsForPathResponse' :: GetEffectivePermissionsForPathResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PrincipalResourcePermissions]
permissions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus