{-# 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.S3ReferenceDataSourceUpdate
-- 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.S3ReferenceDataSourceUpdate where

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

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

-- |
-- Create a value of 'S3ReferenceDataSourceUpdate' 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:
--
-- 'bucketARNUpdate', 's3ReferenceDataSourceUpdate_bucketARNUpdate' - Amazon Resource Name (ARN) of the S3 bucket.
--
-- 'fileKeyUpdate', 's3ReferenceDataSourceUpdate_fileKeyUpdate' - Object key name.
--
-- 'referenceRoleARNUpdate', 's3ReferenceDataSourceUpdate_referenceRoleARNUpdate' - ARN of the IAM role that Amazon Kinesis Analytics can assume to read the
-- Amazon S3 object and populate the in-application.
newS3ReferenceDataSourceUpdate ::
  S3ReferenceDataSourceUpdate
newS3ReferenceDataSourceUpdate :: S3ReferenceDataSourceUpdate
newS3ReferenceDataSourceUpdate =
  S3ReferenceDataSourceUpdate' :: Maybe Text
-> Maybe Text -> Maybe Text -> S3ReferenceDataSourceUpdate
S3ReferenceDataSourceUpdate'
    { $sel:bucketARNUpdate:S3ReferenceDataSourceUpdate' :: Maybe Text
bucketARNUpdate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fileKeyUpdate:S3ReferenceDataSourceUpdate' :: Maybe Text
fileKeyUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:referenceRoleARNUpdate:S3ReferenceDataSourceUpdate' :: Maybe Text
referenceRoleARNUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | Object key name.
s3ReferenceDataSourceUpdate_fileKeyUpdate :: Lens.Lens' S3ReferenceDataSourceUpdate (Prelude.Maybe Prelude.Text)
s3ReferenceDataSourceUpdate_fileKeyUpdate :: (Maybe Text -> f (Maybe Text))
-> S3ReferenceDataSourceUpdate -> f S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate_fileKeyUpdate = (S3ReferenceDataSourceUpdate -> Maybe Text)
-> (S3ReferenceDataSourceUpdate
    -> Maybe Text -> S3ReferenceDataSourceUpdate)
-> Lens
     S3ReferenceDataSourceUpdate
     S3ReferenceDataSourceUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ReferenceDataSourceUpdate' {Maybe Text
fileKeyUpdate :: Maybe Text
$sel:fileKeyUpdate:S3ReferenceDataSourceUpdate' :: S3ReferenceDataSourceUpdate -> Maybe Text
fileKeyUpdate} -> Maybe Text
fileKeyUpdate) (\s :: S3ReferenceDataSourceUpdate
s@S3ReferenceDataSourceUpdate' {} Maybe Text
a -> S3ReferenceDataSourceUpdate
s {$sel:fileKeyUpdate:S3ReferenceDataSourceUpdate' :: Maybe Text
fileKeyUpdate = Maybe Text
a} :: S3ReferenceDataSourceUpdate)

-- | ARN of the IAM role that Amazon Kinesis Analytics can assume to read the
-- Amazon S3 object and populate the in-application.
s3ReferenceDataSourceUpdate_referenceRoleARNUpdate :: Lens.Lens' S3ReferenceDataSourceUpdate (Prelude.Maybe Prelude.Text)
s3ReferenceDataSourceUpdate_referenceRoleARNUpdate :: (Maybe Text -> f (Maybe Text))
-> S3ReferenceDataSourceUpdate -> f S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate_referenceRoleARNUpdate = (S3ReferenceDataSourceUpdate -> Maybe Text)
-> (S3ReferenceDataSourceUpdate
    -> Maybe Text -> S3ReferenceDataSourceUpdate)
-> Lens
     S3ReferenceDataSourceUpdate
     S3ReferenceDataSourceUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ReferenceDataSourceUpdate' {Maybe Text
referenceRoleARNUpdate :: Maybe Text
$sel:referenceRoleARNUpdate:S3ReferenceDataSourceUpdate' :: S3ReferenceDataSourceUpdate -> Maybe Text
referenceRoleARNUpdate} -> Maybe Text
referenceRoleARNUpdate) (\s :: S3ReferenceDataSourceUpdate
s@S3ReferenceDataSourceUpdate' {} Maybe Text
a -> S3ReferenceDataSourceUpdate
s {$sel:referenceRoleARNUpdate:S3ReferenceDataSourceUpdate' :: Maybe Text
referenceRoleARNUpdate = Maybe Text
a} :: S3ReferenceDataSourceUpdate)

instance Prelude.Hashable S3ReferenceDataSourceUpdate

instance Prelude.NFData S3ReferenceDataSourceUpdate

instance Core.ToJSON S3ReferenceDataSourceUpdate where
  toJSON :: S3ReferenceDataSourceUpdate -> Value
toJSON S3ReferenceDataSourceUpdate' {Maybe Text
referenceRoleARNUpdate :: Maybe Text
fileKeyUpdate :: Maybe Text
bucketARNUpdate :: Maybe Text
$sel:referenceRoleARNUpdate:S3ReferenceDataSourceUpdate' :: S3ReferenceDataSourceUpdate -> Maybe Text
$sel:fileKeyUpdate:S3ReferenceDataSourceUpdate' :: S3ReferenceDataSourceUpdate -> Maybe Text
$sel:bucketARNUpdate:S3ReferenceDataSourceUpdate' :: S3ReferenceDataSourceUpdate -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"BucketARNUpdate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bucketARNUpdate,
            (Text
"FileKeyUpdate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fileKeyUpdate,
            (Text
"ReferenceRoleARNUpdate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
referenceRoleARNUpdate
          ]
      )