{-# 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.QuickSight.DescribeDataSourcePermissions
-- 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)
--
-- Describes the resource permissions for a data source.
module Amazonka.QuickSight.DescribeDataSourcePermissions
  ( -- * Creating a Request
    DescribeDataSourcePermissions (..),
    newDescribeDataSourcePermissions,

    -- * Request Lenses
    describeDataSourcePermissions_awsAccountId,
    describeDataSourcePermissions_dataSourceId,

    -- * Destructuring the Response
    DescribeDataSourcePermissionsResponse (..),
    newDescribeDataSourcePermissionsResponse,

    -- * Response Lenses
    describeDataSourcePermissionsResponse_requestId,
    describeDataSourcePermissionsResponse_dataSourceId,
    describeDataSourcePermissionsResponse_dataSourceArn,
    describeDataSourcePermissionsResponse_permissions,
    describeDataSourcePermissionsResponse_status,
  )
where

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

-- | /See:/ 'newDescribeDataSourcePermissions' smart constructor.
data DescribeDataSourcePermissions = DescribeDataSourcePermissions'
  { -- | The Amazon Web Services account ID.
    DescribeDataSourcePermissions -> Text
awsAccountId :: Prelude.Text,
    -- | The ID of the data source. This ID is unique per Amazon Web Services
    -- Region for each Amazon Web Services account.
    DescribeDataSourcePermissions -> Text
dataSourceId :: Prelude.Text
  }
  deriving (DescribeDataSourcePermissions
-> DescribeDataSourcePermissions -> Bool
(DescribeDataSourcePermissions
 -> DescribeDataSourcePermissions -> Bool)
-> (DescribeDataSourcePermissions
    -> DescribeDataSourcePermissions -> Bool)
-> Eq DescribeDataSourcePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSourcePermissions
-> DescribeDataSourcePermissions -> Bool
$c/= :: DescribeDataSourcePermissions
-> DescribeDataSourcePermissions -> Bool
== :: DescribeDataSourcePermissions
-> DescribeDataSourcePermissions -> Bool
$c== :: DescribeDataSourcePermissions
-> DescribeDataSourcePermissions -> Bool
Prelude.Eq, ReadPrec [DescribeDataSourcePermissions]
ReadPrec DescribeDataSourcePermissions
Int -> ReadS DescribeDataSourcePermissions
ReadS [DescribeDataSourcePermissions]
(Int -> ReadS DescribeDataSourcePermissions)
-> ReadS [DescribeDataSourcePermissions]
-> ReadPrec DescribeDataSourcePermissions
-> ReadPrec [DescribeDataSourcePermissions]
-> Read DescribeDataSourcePermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSourcePermissions]
$creadListPrec :: ReadPrec [DescribeDataSourcePermissions]
readPrec :: ReadPrec DescribeDataSourcePermissions
$creadPrec :: ReadPrec DescribeDataSourcePermissions
readList :: ReadS [DescribeDataSourcePermissions]
$creadList :: ReadS [DescribeDataSourcePermissions]
readsPrec :: Int -> ReadS DescribeDataSourcePermissions
$creadsPrec :: Int -> ReadS DescribeDataSourcePermissions
Prelude.Read, Int -> DescribeDataSourcePermissions -> ShowS
[DescribeDataSourcePermissions] -> ShowS
DescribeDataSourcePermissions -> String
(Int -> DescribeDataSourcePermissions -> ShowS)
-> (DescribeDataSourcePermissions -> String)
-> ([DescribeDataSourcePermissions] -> ShowS)
-> Show DescribeDataSourcePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSourcePermissions] -> ShowS
$cshowList :: [DescribeDataSourcePermissions] -> ShowS
show :: DescribeDataSourcePermissions -> String
$cshow :: DescribeDataSourcePermissions -> String
showsPrec :: Int -> DescribeDataSourcePermissions -> ShowS
$cshowsPrec :: Int -> DescribeDataSourcePermissions -> ShowS
Prelude.Show, (forall x.
 DescribeDataSourcePermissions
 -> Rep DescribeDataSourcePermissions x)
-> (forall x.
    Rep DescribeDataSourcePermissions x
    -> DescribeDataSourcePermissions)
-> Generic DescribeDataSourcePermissions
forall x.
Rep DescribeDataSourcePermissions x
-> DescribeDataSourcePermissions
forall x.
DescribeDataSourcePermissions
-> Rep DescribeDataSourcePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDataSourcePermissions x
-> DescribeDataSourcePermissions
$cfrom :: forall x.
DescribeDataSourcePermissions
-> Rep DescribeDataSourcePermissions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDataSourcePermissions' 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:
--
-- 'awsAccountId', 'describeDataSourcePermissions_awsAccountId' - The Amazon Web Services account ID.
--
-- 'dataSourceId', 'describeDataSourcePermissions_dataSourceId' - The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
newDescribeDataSourcePermissions ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'dataSourceId'
  Prelude.Text ->
  DescribeDataSourcePermissions
newDescribeDataSourcePermissions :: Text -> Text -> DescribeDataSourcePermissions
newDescribeDataSourcePermissions
  Text
pAwsAccountId_
  Text
pDataSourceId_ =
    DescribeDataSourcePermissions' :: Text -> Text -> DescribeDataSourcePermissions
DescribeDataSourcePermissions'
      { $sel:awsAccountId:DescribeDataSourcePermissions' :: Text
awsAccountId =
          Text
pAwsAccountId_,
        $sel:dataSourceId:DescribeDataSourcePermissions' :: Text
dataSourceId = Text
pDataSourceId_
      }

-- | The Amazon Web Services account ID.
describeDataSourcePermissions_awsAccountId :: Lens.Lens' DescribeDataSourcePermissions Prelude.Text
describeDataSourcePermissions_awsAccountId :: (Text -> f Text)
-> DescribeDataSourcePermissions -> f DescribeDataSourcePermissions
describeDataSourcePermissions_awsAccountId = (DescribeDataSourcePermissions -> Text)
-> (DescribeDataSourcePermissions
    -> Text -> DescribeDataSourcePermissions)
-> Lens
     DescribeDataSourcePermissions
     DescribeDataSourcePermissions
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcePermissions' {Text
awsAccountId :: Text
$sel:awsAccountId:DescribeDataSourcePermissions' :: DescribeDataSourcePermissions -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DescribeDataSourcePermissions
s@DescribeDataSourcePermissions' {} Text
a -> DescribeDataSourcePermissions
s {$sel:awsAccountId:DescribeDataSourcePermissions' :: Text
awsAccountId = Text
a} :: DescribeDataSourcePermissions)

-- | The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
describeDataSourcePermissions_dataSourceId :: Lens.Lens' DescribeDataSourcePermissions Prelude.Text
describeDataSourcePermissions_dataSourceId :: (Text -> f Text)
-> DescribeDataSourcePermissions -> f DescribeDataSourcePermissions
describeDataSourcePermissions_dataSourceId = (DescribeDataSourcePermissions -> Text)
-> (DescribeDataSourcePermissions
    -> Text -> DescribeDataSourcePermissions)
-> Lens
     DescribeDataSourcePermissions
     DescribeDataSourcePermissions
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcePermissions' {Text
dataSourceId :: Text
$sel:dataSourceId:DescribeDataSourcePermissions' :: DescribeDataSourcePermissions -> Text
dataSourceId} -> Text
dataSourceId) (\s :: DescribeDataSourcePermissions
s@DescribeDataSourcePermissions' {} Text
a -> DescribeDataSourcePermissions
s {$sel:dataSourceId:DescribeDataSourcePermissions' :: Text
dataSourceId = Text
a} :: DescribeDataSourcePermissions)

instance
  Core.AWSRequest
    DescribeDataSourcePermissions
  where
  type
    AWSResponse DescribeDataSourcePermissions =
      DescribeDataSourcePermissionsResponse
  request :: DescribeDataSourcePermissions
-> Request DescribeDataSourcePermissions
request = Service
-> DescribeDataSourcePermissions
-> Request DescribeDataSourcePermissions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeDataSourcePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDataSourcePermissions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeDataSourcePermissions))
-> Logger
-> Service
-> Proxy DescribeDataSourcePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDataSourcePermissions)))
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
-> Maybe (NonEmpty ResourcePermission)
-> Int
-> DescribeDataSourcePermissionsResponse
DescribeDataSourcePermissionsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty ResourcePermission)
 -> Int
 -> DescribeDataSourcePermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty ResourcePermission)
      -> Int
      -> DescribeDataSourcePermissionsResponse)
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
"RequestId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty ResourcePermission)
   -> Int
   -> DescribeDataSourcePermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (NonEmpty ResourcePermission)
      -> Int
      -> DescribeDataSourcePermissionsResponse)
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
"DataSourceId")
            Either
  String
  (Maybe Text
   -> Maybe (NonEmpty ResourcePermission)
   -> Int
   -> DescribeDataSourcePermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty ResourcePermission)
      -> Int -> DescribeDataSourcePermissionsResponse)
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
"DataSourceArn")
            Either
  String
  (Maybe (NonEmpty ResourcePermission)
   -> Int -> DescribeDataSourcePermissionsResponse)
-> Either String (Maybe (NonEmpty ResourcePermission))
-> Either String (Int -> DescribeDataSourcePermissionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (NonEmpty ResourcePermission))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Permissions")
            Either String (Int -> DescribeDataSourcePermissionsResponse)
-> Either String Int
-> Either String DescribeDataSourcePermissionsResponse
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
    DescribeDataSourcePermissions

instance Prelude.NFData DescribeDataSourcePermissions

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

instance Core.ToPath DescribeDataSourcePermissions where
  toPath :: DescribeDataSourcePermissions -> ByteString
toPath DescribeDataSourcePermissions' {Text
dataSourceId :: Text
awsAccountId :: Text
$sel:dataSourceId:DescribeDataSourcePermissions' :: DescribeDataSourcePermissions -> Text
$sel:awsAccountId:DescribeDataSourcePermissions' :: DescribeDataSourcePermissions -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/data-sources/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dataSourceId,
        ByteString
"/permissions"
      ]

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

-- | /See:/ 'newDescribeDataSourcePermissionsResponse' smart constructor.
data DescribeDataSourcePermissionsResponse = DescribeDataSourcePermissionsResponse'
  { -- | The Amazon Web Services request ID for this operation.
    DescribeDataSourcePermissionsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the data source. This ID is unique per Amazon Web Services
    -- Region for each Amazon Web Services account.
    DescribeDataSourcePermissionsResponse -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the data source.
    DescribeDataSourcePermissionsResponse -> Maybe Text
dataSourceArn :: Prelude.Maybe Prelude.Text,
    -- | A list of resource permissions on the data source.
    DescribeDataSourcePermissionsResponse
-> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
    -- | The HTTP status of the request.
    DescribeDataSourcePermissionsResponse -> Int
status :: Prelude.Int
  }
  deriving (DescribeDataSourcePermissionsResponse
-> DescribeDataSourcePermissionsResponse -> Bool
(DescribeDataSourcePermissionsResponse
 -> DescribeDataSourcePermissionsResponse -> Bool)
-> (DescribeDataSourcePermissionsResponse
    -> DescribeDataSourcePermissionsResponse -> Bool)
-> Eq DescribeDataSourcePermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSourcePermissionsResponse
-> DescribeDataSourcePermissionsResponse -> Bool
$c/= :: DescribeDataSourcePermissionsResponse
-> DescribeDataSourcePermissionsResponse -> Bool
== :: DescribeDataSourcePermissionsResponse
-> DescribeDataSourcePermissionsResponse -> Bool
$c== :: DescribeDataSourcePermissionsResponse
-> DescribeDataSourcePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDataSourcePermissionsResponse]
ReadPrec DescribeDataSourcePermissionsResponse
Int -> ReadS DescribeDataSourcePermissionsResponse
ReadS [DescribeDataSourcePermissionsResponse]
(Int -> ReadS DescribeDataSourcePermissionsResponse)
-> ReadS [DescribeDataSourcePermissionsResponse]
-> ReadPrec DescribeDataSourcePermissionsResponse
-> ReadPrec [DescribeDataSourcePermissionsResponse]
-> Read DescribeDataSourcePermissionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSourcePermissionsResponse]
$creadListPrec :: ReadPrec [DescribeDataSourcePermissionsResponse]
readPrec :: ReadPrec DescribeDataSourcePermissionsResponse
$creadPrec :: ReadPrec DescribeDataSourcePermissionsResponse
readList :: ReadS [DescribeDataSourcePermissionsResponse]
$creadList :: ReadS [DescribeDataSourcePermissionsResponse]
readsPrec :: Int -> ReadS DescribeDataSourcePermissionsResponse
$creadsPrec :: Int -> ReadS DescribeDataSourcePermissionsResponse
Prelude.Read, Int -> DescribeDataSourcePermissionsResponse -> ShowS
[DescribeDataSourcePermissionsResponse] -> ShowS
DescribeDataSourcePermissionsResponse -> String
(Int -> DescribeDataSourcePermissionsResponse -> ShowS)
-> (DescribeDataSourcePermissionsResponse -> String)
-> ([DescribeDataSourcePermissionsResponse] -> ShowS)
-> Show DescribeDataSourcePermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSourcePermissionsResponse] -> ShowS
$cshowList :: [DescribeDataSourcePermissionsResponse] -> ShowS
show :: DescribeDataSourcePermissionsResponse -> String
$cshow :: DescribeDataSourcePermissionsResponse -> String
showsPrec :: Int -> DescribeDataSourcePermissionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeDataSourcePermissionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDataSourcePermissionsResponse
 -> Rep DescribeDataSourcePermissionsResponse x)
-> (forall x.
    Rep DescribeDataSourcePermissionsResponse x
    -> DescribeDataSourcePermissionsResponse)
-> Generic DescribeDataSourcePermissionsResponse
forall x.
Rep DescribeDataSourcePermissionsResponse x
-> DescribeDataSourcePermissionsResponse
forall x.
DescribeDataSourcePermissionsResponse
-> Rep DescribeDataSourcePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDataSourcePermissionsResponse x
-> DescribeDataSourcePermissionsResponse
$cfrom :: forall x.
DescribeDataSourcePermissionsResponse
-> Rep DescribeDataSourcePermissionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDataSourcePermissionsResponse' 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:
--
-- 'requestId', 'describeDataSourcePermissionsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'dataSourceId', 'describeDataSourcePermissionsResponse_dataSourceId' - The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
--
-- 'dataSourceArn', 'describeDataSourcePermissionsResponse_dataSourceArn' - The Amazon Resource Name (ARN) of the data source.
--
-- 'permissions', 'describeDataSourcePermissionsResponse_permissions' - A list of resource permissions on the data source.
--
-- 'status', 'describeDataSourcePermissionsResponse_status' - The HTTP status of the request.
newDescribeDataSourcePermissionsResponse ::
  -- | 'status'
  Prelude.Int ->
  DescribeDataSourcePermissionsResponse
newDescribeDataSourcePermissionsResponse :: Int -> DescribeDataSourcePermissionsResponse
newDescribeDataSourcePermissionsResponse Int
pStatus_ =
  DescribeDataSourcePermissionsResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty ResourcePermission)
-> Int
-> DescribeDataSourcePermissionsResponse
DescribeDataSourcePermissionsResponse'
    { $sel:requestId:DescribeDataSourcePermissionsResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceId:DescribeDataSourcePermissionsResponse' :: Maybe Text
dataSourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceArn:DescribeDataSourcePermissionsResponse' :: Maybe Text
dataSourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissions:DescribeDataSourcePermissionsResponse' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeDataSourcePermissionsResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
describeDataSourcePermissionsResponse_requestId :: Lens.Lens' DescribeDataSourcePermissionsResponse (Prelude.Maybe Prelude.Text)
describeDataSourcePermissionsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSourcePermissionsResponse
-> f DescribeDataSourcePermissionsResponse
describeDataSourcePermissionsResponse_requestId = (DescribeDataSourcePermissionsResponse -> Maybe Text)
-> (DescribeDataSourcePermissionsResponse
    -> Maybe Text -> DescribeDataSourcePermissionsResponse)
-> Lens
     DescribeDataSourcePermissionsResponse
     DescribeDataSourcePermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcePermissionsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DescribeDataSourcePermissionsResponse' :: DescribeDataSourcePermissionsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DescribeDataSourcePermissionsResponse
s@DescribeDataSourcePermissionsResponse' {} Maybe Text
a -> DescribeDataSourcePermissionsResponse
s {$sel:requestId:DescribeDataSourcePermissionsResponse' :: Maybe Text
requestId = Maybe Text
a} :: DescribeDataSourcePermissionsResponse)

-- | The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
describeDataSourcePermissionsResponse_dataSourceId :: Lens.Lens' DescribeDataSourcePermissionsResponse (Prelude.Maybe Prelude.Text)
describeDataSourcePermissionsResponse_dataSourceId :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSourcePermissionsResponse
-> f DescribeDataSourcePermissionsResponse
describeDataSourcePermissionsResponse_dataSourceId = (DescribeDataSourcePermissionsResponse -> Maybe Text)
-> (DescribeDataSourcePermissionsResponse
    -> Maybe Text -> DescribeDataSourcePermissionsResponse)
-> Lens
     DescribeDataSourcePermissionsResponse
     DescribeDataSourcePermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcePermissionsResponse' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:DescribeDataSourcePermissionsResponse' :: DescribeDataSourcePermissionsResponse -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: DescribeDataSourcePermissionsResponse
s@DescribeDataSourcePermissionsResponse' {} Maybe Text
a -> DescribeDataSourcePermissionsResponse
s {$sel:dataSourceId:DescribeDataSourcePermissionsResponse' :: Maybe Text
dataSourceId = Maybe Text
a} :: DescribeDataSourcePermissionsResponse)

-- | The Amazon Resource Name (ARN) of the data source.
describeDataSourcePermissionsResponse_dataSourceArn :: Lens.Lens' DescribeDataSourcePermissionsResponse (Prelude.Maybe Prelude.Text)
describeDataSourcePermissionsResponse_dataSourceArn :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSourcePermissionsResponse
-> f DescribeDataSourcePermissionsResponse
describeDataSourcePermissionsResponse_dataSourceArn = (DescribeDataSourcePermissionsResponse -> Maybe Text)
-> (DescribeDataSourcePermissionsResponse
    -> Maybe Text -> DescribeDataSourcePermissionsResponse)
-> Lens
     DescribeDataSourcePermissionsResponse
     DescribeDataSourcePermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcePermissionsResponse' {Maybe Text
dataSourceArn :: Maybe Text
$sel:dataSourceArn:DescribeDataSourcePermissionsResponse' :: DescribeDataSourcePermissionsResponse -> Maybe Text
dataSourceArn} -> Maybe Text
dataSourceArn) (\s :: DescribeDataSourcePermissionsResponse
s@DescribeDataSourcePermissionsResponse' {} Maybe Text
a -> DescribeDataSourcePermissionsResponse
s {$sel:dataSourceArn:DescribeDataSourcePermissionsResponse' :: Maybe Text
dataSourceArn = Maybe Text
a} :: DescribeDataSourcePermissionsResponse)

-- | A list of resource permissions on the data source.
describeDataSourcePermissionsResponse_permissions :: Lens.Lens' DescribeDataSourcePermissionsResponse (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
describeDataSourcePermissionsResponse_permissions :: (Maybe (NonEmpty ResourcePermission)
 -> f (Maybe (NonEmpty ResourcePermission)))
-> DescribeDataSourcePermissionsResponse
-> f DescribeDataSourcePermissionsResponse
describeDataSourcePermissionsResponse_permissions = (DescribeDataSourcePermissionsResponse
 -> Maybe (NonEmpty ResourcePermission))
-> (DescribeDataSourcePermissionsResponse
    -> Maybe (NonEmpty ResourcePermission)
    -> DescribeDataSourcePermissionsResponse)
-> Lens
     DescribeDataSourcePermissionsResponse
     DescribeDataSourcePermissionsResponse
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcePermissionsResponse' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:DescribeDataSourcePermissionsResponse' :: DescribeDataSourcePermissionsResponse
-> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: DescribeDataSourcePermissionsResponse
s@DescribeDataSourcePermissionsResponse' {} Maybe (NonEmpty ResourcePermission)
a -> DescribeDataSourcePermissionsResponse
s {$sel:permissions:DescribeDataSourcePermissionsResponse' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: DescribeDataSourcePermissionsResponse) ((Maybe (NonEmpty ResourcePermission)
  -> f (Maybe (NonEmpty ResourcePermission)))
 -> DescribeDataSourcePermissionsResponse
 -> f DescribeDataSourcePermissionsResponse)
-> ((Maybe (NonEmpty ResourcePermission)
     -> f (Maybe (NonEmpty ResourcePermission)))
    -> Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> DescribeDataSourcePermissionsResponse
-> f DescribeDataSourcePermissionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
-> Iso
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
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
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The HTTP status of the request.
describeDataSourcePermissionsResponse_status :: Lens.Lens' DescribeDataSourcePermissionsResponse Prelude.Int
describeDataSourcePermissionsResponse_status :: (Int -> f Int)
-> DescribeDataSourcePermissionsResponse
-> f DescribeDataSourcePermissionsResponse
describeDataSourcePermissionsResponse_status = (DescribeDataSourcePermissionsResponse -> Int)
-> (DescribeDataSourcePermissionsResponse
    -> Int -> DescribeDataSourcePermissionsResponse)
-> Lens
     DescribeDataSourcePermissionsResponse
     DescribeDataSourcePermissionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcePermissionsResponse' {Int
status :: Int
$sel:status:DescribeDataSourcePermissionsResponse' :: DescribeDataSourcePermissionsResponse -> Int
status} -> Int
status) (\s :: DescribeDataSourcePermissionsResponse
s@DescribeDataSourcePermissionsResponse' {} Int
a -> DescribeDataSourcePermissionsResponse
s {$sel:status:DescribeDataSourcePermissionsResponse' :: Int
status = Int
a} :: DescribeDataSourcePermissionsResponse)

instance
  Prelude.NFData
    DescribeDataSourcePermissionsResponse