{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.DetailsMap
-- 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)
module Amazonka.LakeFormation.Types.DetailsMap where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A structure containing the additional details to be returned in the
-- @AdditionalDetails@ attribute of @PrincipalResourcePermissions@.
--
-- If a catalog resource is shared through AWS Resource Access Manager (AWS
-- RAM), then there will exist a corresponding RAM resource share ARN.
--
-- /See:/ 'newDetailsMap' smart constructor.
data DetailsMap = DetailsMap'
  { -- | A resource share ARN for a catalog resource shared through AWS Resource
    -- Access Manager (AWS RAM).
    DetailsMap -> Maybe [Text]
resourceShare :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DetailsMap -> DetailsMap -> Bool
(DetailsMap -> DetailsMap -> Bool)
-> (DetailsMap -> DetailsMap -> Bool) -> Eq DetailsMap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetailsMap -> DetailsMap -> Bool
$c/= :: DetailsMap -> DetailsMap -> Bool
== :: DetailsMap -> DetailsMap -> Bool
$c== :: DetailsMap -> DetailsMap -> Bool
Prelude.Eq, ReadPrec [DetailsMap]
ReadPrec DetailsMap
Int -> ReadS DetailsMap
ReadS [DetailsMap]
(Int -> ReadS DetailsMap)
-> ReadS [DetailsMap]
-> ReadPrec DetailsMap
-> ReadPrec [DetailsMap]
-> Read DetailsMap
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetailsMap]
$creadListPrec :: ReadPrec [DetailsMap]
readPrec :: ReadPrec DetailsMap
$creadPrec :: ReadPrec DetailsMap
readList :: ReadS [DetailsMap]
$creadList :: ReadS [DetailsMap]
readsPrec :: Int -> ReadS DetailsMap
$creadsPrec :: Int -> ReadS DetailsMap
Prelude.Read, Int -> DetailsMap -> ShowS
[DetailsMap] -> ShowS
DetailsMap -> String
(Int -> DetailsMap -> ShowS)
-> (DetailsMap -> String)
-> ([DetailsMap] -> ShowS)
-> Show DetailsMap
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetailsMap] -> ShowS
$cshowList :: [DetailsMap] -> ShowS
show :: DetailsMap -> String
$cshow :: DetailsMap -> String
showsPrec :: Int -> DetailsMap -> ShowS
$cshowsPrec :: Int -> DetailsMap -> ShowS
Prelude.Show, (forall x. DetailsMap -> Rep DetailsMap x)
-> (forall x. Rep DetailsMap x -> DetailsMap) -> Generic DetailsMap
forall x. Rep DetailsMap x -> DetailsMap
forall x. DetailsMap -> Rep DetailsMap x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetailsMap x -> DetailsMap
$cfrom :: forall x. DetailsMap -> Rep DetailsMap x
Prelude.Generic)

-- |
-- Create a value of 'DetailsMap' 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:
--
-- 'resourceShare', 'detailsMap_resourceShare' - A resource share ARN for a catalog resource shared through AWS Resource
-- Access Manager (AWS RAM).
newDetailsMap ::
  DetailsMap
newDetailsMap :: DetailsMap
newDetailsMap =
  DetailsMap' :: Maybe [Text] -> DetailsMap
DetailsMap' {$sel:resourceShare:DetailsMap' :: Maybe [Text]
resourceShare = Maybe [Text]
forall a. Maybe a
Prelude.Nothing}

-- | A resource share ARN for a catalog resource shared through AWS Resource
-- Access Manager (AWS RAM).
detailsMap_resourceShare :: Lens.Lens' DetailsMap (Prelude.Maybe [Prelude.Text])
detailsMap_resourceShare :: (Maybe [Text] -> f (Maybe [Text])) -> DetailsMap -> f DetailsMap
detailsMap_resourceShare = (DetailsMap -> Maybe [Text])
-> (DetailsMap -> Maybe [Text] -> DetailsMap)
-> Lens DetailsMap DetailsMap (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetailsMap' {Maybe [Text]
resourceShare :: Maybe [Text]
$sel:resourceShare:DetailsMap' :: DetailsMap -> Maybe [Text]
resourceShare} -> Maybe [Text]
resourceShare) (\s :: DetailsMap
s@DetailsMap' {} Maybe [Text]
a -> DetailsMap
s {$sel:resourceShare:DetailsMap' :: Maybe [Text]
resourceShare = Maybe [Text]
a} :: DetailsMap) ((Maybe [Text] -> f (Maybe [Text])) -> DetailsMap -> f DetailsMap)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DetailsMap
-> f DetailsMap
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON DetailsMap where
  parseJSON :: Value -> Parser DetailsMap
parseJSON =
    String
-> (Object -> Parser DetailsMap) -> Value -> Parser DetailsMap
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DetailsMap"
      ( \Object
x ->
          Maybe [Text] -> DetailsMap
DetailsMap'
            (Maybe [Text] -> DetailsMap)
-> Parser (Maybe [Text]) -> Parser DetailsMap
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceShare" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable DetailsMap

instance Prelude.NFData DetailsMap