{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DataExchange.Types.RedshiftDataShareAsset where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$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 :: Lens' RedshiftDataShareAsset Text
redshiftDataShareAsset_arn = 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 Data.FromJSON RedshiftDataShareAsset where
  parseJSON :: Value -> Parser RedshiftDataShareAsset
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RedshiftDataShareAsset"
      ( \Object
x ->
          Text -> RedshiftDataShareAsset
RedshiftDataShareAsset'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Arn")
      )

instance Prelude.Hashable RedshiftDataShareAsset where
  hashWithSalt :: Int -> RedshiftDataShareAsset -> Int
hashWithSalt Int
_salt RedshiftDataShareAsset' {Text
arn :: Text
$sel:arn:RedshiftDataShareAsset' :: RedshiftDataShareAsset -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData RedshiftDataShareAsset where
  rnf :: RedshiftDataShareAsset -> ()
rnf RedshiftDataShareAsset' {Text
arn :: Text
$sel:arn:RedshiftDataShareAsset' :: RedshiftDataShareAsset -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn