{-# 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.DataExchange.Types.RedshiftDataShareAsset
-- 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.DataExchange.Types.RedshiftDataShareAsset where

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

-- | The Amazon Redshift datashare asset.
--
-- /See:/ 'newRedshiftDataShareAsset' smart constructor.
data RedshiftDataShareAsset = RedshiftDataShareAsset'
  { -- | The Amazon Resource Name (ARN) of the datashare asset.
    RedshiftDataShareAsset -> Text
arn :: Prelude.Text
  }
  deriving (RedshiftDataShareAsset -> RedshiftDataShareAsset -> Bool
(RedshiftDataShareAsset -> RedshiftDataShareAsset -> Bool)
-> (RedshiftDataShareAsset -> RedshiftDataShareAsset -> Bool)
-> Eq RedshiftDataShareAsset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftDataShareAsset -> RedshiftDataShareAsset -> Bool
$c/= :: RedshiftDataShareAsset -> RedshiftDataShareAsset -> Bool
== :: RedshiftDataShareAsset -> RedshiftDataShareAsset -> Bool
$c== :: RedshiftDataShareAsset -> RedshiftDataShareAsset -> Bool
Prelude.Eq, ReadPrec [RedshiftDataShareAsset]
ReadPrec RedshiftDataShareAsset
Int -> ReadS RedshiftDataShareAsset
ReadS [RedshiftDataShareAsset]
(Int -> ReadS RedshiftDataShareAsset)
-> ReadS [RedshiftDataShareAsset]
-> ReadPrec RedshiftDataShareAsset
-> ReadPrec [RedshiftDataShareAsset]
-> Read RedshiftDataShareAsset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftDataShareAsset]
$creadListPrec :: ReadPrec [RedshiftDataShareAsset]
readPrec :: ReadPrec RedshiftDataShareAsset
$creadPrec :: ReadPrec RedshiftDataShareAsset
readList :: ReadS [RedshiftDataShareAsset]
$creadList :: ReadS [RedshiftDataShareAsset]
readsPrec :: Int -> ReadS RedshiftDataShareAsset
$creadsPrec :: Int -> ReadS RedshiftDataShareAsset
Prelude.Read, Int -> RedshiftDataShareAsset -> ShowS
[RedshiftDataShareAsset] -> ShowS
RedshiftDataShareAsset -> String
(Int -> RedshiftDataShareAsset -> ShowS)
-> (RedshiftDataShareAsset -> String)
-> ([RedshiftDataShareAsset] -> ShowS)
-> Show RedshiftDataShareAsset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftDataShareAsset] -> ShowS
$cshowList :: [RedshiftDataShareAsset] -> ShowS
show :: RedshiftDataShareAsset -> String
$cshow :: RedshiftDataShareAsset -> String
showsPrec :: Int -> RedshiftDataShareAsset -> ShowS
$cshowsPrec :: Int -> RedshiftDataShareAsset -> ShowS
Prelude.Show, (forall x. RedshiftDataShareAsset -> Rep RedshiftDataShareAsset x)
-> (forall x.
    Rep RedshiftDataShareAsset x -> RedshiftDataShareAsset)
-> Generic RedshiftDataShareAsset
forall x. Rep RedshiftDataShareAsset x -> RedshiftDataShareAsset
forall x. RedshiftDataShareAsset -> Rep RedshiftDataShareAsset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedshiftDataShareAsset x -> RedshiftDataShareAsset
$cfrom :: forall x. RedshiftDataShareAsset -> Rep RedshiftDataShareAsset x
Prelude.Generic)

-- |
-- Create a value of 'RedshiftDataShareAsset' 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:
--
-- 'arn', 'redshiftDataShareAsset_arn' - The Amazon Resource Name (ARN) of the datashare asset.
newRedshiftDataShareAsset ::
  -- | 'arn'
  Prelude.Text ->
  RedshiftDataShareAsset
newRedshiftDataShareAsset :: Text -> RedshiftDataShareAsset
newRedshiftDataShareAsset Text
pArn_ =
  RedshiftDataShareAsset' :: Text -> RedshiftDataShareAsset
RedshiftDataShareAsset' {$sel:arn:RedshiftDataShareAsset' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the datashare asset.
redshiftDataShareAsset_arn :: Lens.Lens' RedshiftDataShareAsset Prelude.Text
redshiftDataShareAsset_arn :: (Text -> f Text)
-> RedshiftDataShareAsset -> f RedshiftDataShareAsset
redshiftDataShareAsset_arn = (RedshiftDataShareAsset -> Text)
-> (RedshiftDataShareAsset -> Text -> RedshiftDataShareAsset)
-> Lens RedshiftDataShareAsset RedshiftDataShareAsset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDataShareAsset' {Text
arn :: Text
$sel:arn:RedshiftDataShareAsset' :: RedshiftDataShareAsset -> Text
arn} -> Text
arn) (\s :: RedshiftDataShareAsset
s@RedshiftDataShareAsset' {} Text
a -> RedshiftDataShareAsset
s {$sel:arn:RedshiftDataShareAsset' :: Text
arn = Text
a} :: RedshiftDataShareAsset)

instance Core.FromJSON RedshiftDataShareAsset where
  parseJSON :: Value -> Parser RedshiftDataShareAsset
parseJSON =
    String
-> (Object -> Parser RedshiftDataShareAsset)
-> Value
-> Parser RedshiftDataShareAsset
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RedshiftDataShareAsset"
      ( \Object
x ->
          Text -> RedshiftDataShareAsset
RedshiftDataShareAsset'
            (Text -> RedshiftDataShareAsset)
-> Parser Text -> Parser RedshiftDataShareAsset
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
      )

instance Prelude.Hashable RedshiftDataShareAsset

instance Prelude.NFData RedshiftDataShareAsset