{-# 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.KinesisAnalytics.Types.S3ReferenceDataSourceDescription
-- 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.KinesisAnalytics.Types.S3ReferenceDataSourceDescription where

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

-- | Provides the bucket name and object key name that stores the reference
-- data.
--
-- /See:/ 'newS3ReferenceDataSourceDescription' smart constructor.
data S3ReferenceDataSourceDescription = S3ReferenceDataSourceDescription'
  { -- | Amazon Resource Name (ARN) of the S3 bucket.
    S3ReferenceDataSourceDescription -> Text
bucketARN :: Prelude.Text,
    -- | Amazon S3 object key name.
    S3ReferenceDataSourceDescription -> Text
fileKey :: Prelude.Text,
    -- | ARN of the IAM role that Amazon Kinesis Analytics can assume to read the
    -- Amazon S3 object on your behalf to populate the in-application reference
    -- table.
    S3ReferenceDataSourceDescription -> Text
referenceRoleARN :: Prelude.Text
  }
  deriving (S3ReferenceDataSourceDescription
-> S3ReferenceDataSourceDescription -> Bool
(S3ReferenceDataSourceDescription
 -> S3ReferenceDataSourceDescription -> Bool)
-> (S3ReferenceDataSourceDescription
    -> S3ReferenceDataSourceDescription -> Bool)
-> Eq S3ReferenceDataSourceDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ReferenceDataSourceDescription
-> S3ReferenceDataSourceDescription -> Bool
$c/= :: S3ReferenceDataSourceDescription
-> S3ReferenceDataSourceDescription -> Bool
== :: S3ReferenceDataSourceDescription
-> S3ReferenceDataSourceDescription -> Bool
$c== :: S3ReferenceDataSourceDescription
-> S3ReferenceDataSourceDescription -> Bool
Prelude.Eq, ReadPrec [S3ReferenceDataSourceDescription]
ReadPrec S3ReferenceDataSourceDescription
Int -> ReadS S3ReferenceDataSourceDescription
ReadS [S3ReferenceDataSourceDescription]
(Int -> ReadS S3ReferenceDataSourceDescription)
-> ReadS [S3ReferenceDataSourceDescription]
-> ReadPrec S3ReferenceDataSourceDescription
-> ReadPrec [S3ReferenceDataSourceDescription]
-> Read S3ReferenceDataSourceDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ReferenceDataSourceDescription]
$creadListPrec :: ReadPrec [S3ReferenceDataSourceDescription]
readPrec :: ReadPrec S3ReferenceDataSourceDescription
$creadPrec :: ReadPrec S3ReferenceDataSourceDescription
readList :: ReadS [S3ReferenceDataSourceDescription]
$creadList :: ReadS [S3ReferenceDataSourceDescription]
readsPrec :: Int -> ReadS S3ReferenceDataSourceDescription
$creadsPrec :: Int -> ReadS S3ReferenceDataSourceDescription
Prelude.Read, Int -> S3ReferenceDataSourceDescription -> ShowS
[S3ReferenceDataSourceDescription] -> ShowS
S3ReferenceDataSourceDescription -> String
(Int -> S3ReferenceDataSourceDescription -> ShowS)
-> (S3ReferenceDataSourceDescription -> String)
-> ([S3ReferenceDataSourceDescription] -> ShowS)
-> Show S3ReferenceDataSourceDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ReferenceDataSourceDescription] -> ShowS
$cshowList :: [S3ReferenceDataSourceDescription] -> ShowS
show :: S3ReferenceDataSourceDescription -> String
$cshow :: S3ReferenceDataSourceDescription -> String
showsPrec :: Int -> S3ReferenceDataSourceDescription -> ShowS
$cshowsPrec :: Int -> S3ReferenceDataSourceDescription -> ShowS
Prelude.Show, (forall x.
 S3ReferenceDataSourceDescription
 -> Rep S3ReferenceDataSourceDescription x)
-> (forall x.
    Rep S3ReferenceDataSourceDescription x
    -> S3ReferenceDataSourceDescription)
-> Generic S3ReferenceDataSourceDescription
forall x.
Rep S3ReferenceDataSourceDescription x
-> S3ReferenceDataSourceDescription
forall x.
S3ReferenceDataSourceDescription
-> Rep S3ReferenceDataSourceDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3ReferenceDataSourceDescription x
-> S3ReferenceDataSourceDescription
$cfrom :: forall x.
S3ReferenceDataSourceDescription
-> Rep S3ReferenceDataSourceDescription x
Prelude.Generic)

-- |
-- Create a value of 'S3ReferenceDataSourceDescription' 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:
--
-- 'bucketARN', 's3ReferenceDataSourceDescription_bucketARN' - Amazon Resource Name (ARN) of the S3 bucket.
--
-- 'fileKey', 's3ReferenceDataSourceDescription_fileKey' - Amazon S3 object key name.
--
-- 'referenceRoleARN', 's3ReferenceDataSourceDescription_referenceRoleARN' - ARN of the IAM role that Amazon Kinesis Analytics can assume to read the
-- Amazon S3 object on your behalf to populate the in-application reference
-- table.
newS3ReferenceDataSourceDescription ::
  -- | 'bucketARN'
  Prelude.Text ->
  -- | 'fileKey'
  Prelude.Text ->
  -- | 'referenceRoleARN'
  Prelude.Text ->
  S3ReferenceDataSourceDescription
newS3ReferenceDataSourceDescription :: Text -> Text -> Text -> S3ReferenceDataSourceDescription
newS3ReferenceDataSourceDescription
  Text
pBucketARN_
  Text
pFileKey_
  Text
pReferenceRoleARN_ =
    S3ReferenceDataSourceDescription' :: Text -> Text -> Text -> S3ReferenceDataSourceDescription
S3ReferenceDataSourceDescription'
      { $sel:bucketARN:S3ReferenceDataSourceDescription' :: Text
bucketARN =
          Text
pBucketARN_,
        $sel:fileKey:S3ReferenceDataSourceDescription' :: Text
fileKey = Text
pFileKey_,
        $sel:referenceRoleARN:S3ReferenceDataSourceDescription' :: Text
referenceRoleARN = Text
pReferenceRoleARN_
      }

-- | Amazon Resource Name (ARN) of the S3 bucket.
s3ReferenceDataSourceDescription_bucketARN :: Lens.Lens' S3ReferenceDataSourceDescription Prelude.Text
s3ReferenceDataSourceDescription_bucketARN :: (Text -> f Text)
-> S3ReferenceDataSourceDescription
-> f S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription_bucketARN = (S3ReferenceDataSourceDescription -> Text)
-> (S3ReferenceDataSourceDescription
    -> Text -> S3ReferenceDataSourceDescription)
-> Lens
     S3ReferenceDataSourceDescription
     S3ReferenceDataSourceDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ReferenceDataSourceDescription' {Text
bucketARN :: Text
$sel:bucketARN:S3ReferenceDataSourceDescription' :: S3ReferenceDataSourceDescription -> Text
bucketARN} -> Text
bucketARN) (\s :: S3ReferenceDataSourceDescription
s@S3ReferenceDataSourceDescription' {} Text
a -> S3ReferenceDataSourceDescription
s {$sel:bucketARN:S3ReferenceDataSourceDescription' :: Text
bucketARN = Text
a} :: S3ReferenceDataSourceDescription)

-- | Amazon S3 object key name.
s3ReferenceDataSourceDescription_fileKey :: Lens.Lens' S3ReferenceDataSourceDescription Prelude.Text
s3ReferenceDataSourceDescription_fileKey :: (Text -> f Text)
-> S3ReferenceDataSourceDescription
-> f S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription_fileKey = (S3ReferenceDataSourceDescription -> Text)
-> (S3ReferenceDataSourceDescription
    -> Text -> S3ReferenceDataSourceDescription)
-> Lens
     S3ReferenceDataSourceDescription
     S3ReferenceDataSourceDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ReferenceDataSourceDescription' {Text
fileKey :: Text
$sel:fileKey:S3ReferenceDataSourceDescription' :: S3ReferenceDataSourceDescription -> Text
fileKey} -> Text
fileKey) (\s :: S3ReferenceDataSourceDescription
s@S3ReferenceDataSourceDescription' {} Text
a -> S3ReferenceDataSourceDescription
s {$sel:fileKey:S3ReferenceDataSourceDescription' :: Text
fileKey = Text
a} :: S3ReferenceDataSourceDescription)

-- | ARN of the IAM role that Amazon Kinesis Analytics can assume to read the
-- Amazon S3 object on your behalf to populate the in-application reference
-- table.
s3ReferenceDataSourceDescription_referenceRoleARN :: Lens.Lens' S3ReferenceDataSourceDescription Prelude.Text
s3ReferenceDataSourceDescription_referenceRoleARN :: (Text -> f Text)
-> S3ReferenceDataSourceDescription
-> f S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription_referenceRoleARN = (S3ReferenceDataSourceDescription -> Text)
-> (S3ReferenceDataSourceDescription
    -> Text -> S3ReferenceDataSourceDescription)
-> Lens
     S3ReferenceDataSourceDescription
     S3ReferenceDataSourceDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ReferenceDataSourceDescription' {Text
referenceRoleARN :: Text
$sel:referenceRoleARN:S3ReferenceDataSourceDescription' :: S3ReferenceDataSourceDescription -> Text
referenceRoleARN} -> Text
referenceRoleARN) (\s :: S3ReferenceDataSourceDescription
s@S3ReferenceDataSourceDescription' {} Text
a -> S3ReferenceDataSourceDescription
s {$sel:referenceRoleARN:S3ReferenceDataSourceDescription' :: Text
referenceRoleARN = Text
a} :: S3ReferenceDataSourceDescription)

instance
  Core.FromJSON
    S3ReferenceDataSourceDescription
  where
  parseJSON :: Value -> Parser S3ReferenceDataSourceDescription
parseJSON =
    String
-> (Object -> Parser S3ReferenceDataSourceDescription)
-> Value
-> Parser S3ReferenceDataSourceDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"S3ReferenceDataSourceDescription"
      ( \Object
x ->
          Text -> Text -> Text -> S3ReferenceDataSourceDescription
S3ReferenceDataSourceDescription'
            (Text -> Text -> Text -> S3ReferenceDataSourceDescription)
-> Parser Text
-> Parser (Text -> Text -> S3ReferenceDataSourceDescription)
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
"BucketARN")
            Parser (Text -> Text -> S3ReferenceDataSourceDescription)
-> Parser Text -> Parser (Text -> S3ReferenceDataSourceDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FileKey")
            Parser (Text -> S3ReferenceDataSourceDescription)
-> Parser Text -> Parser S3ReferenceDataSourceDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ReferenceRoleARN")
      )

instance
  Prelude.Hashable
    S3ReferenceDataSourceDescription

instance
  Prelude.NFData
    S3ReferenceDataSourceDescription