{-# 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.KinesisAnalyticsV2.Types.S3ContentBaseLocationUpdate
-- 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.KinesisAnalyticsV2.Types.S3ContentBaseLocationUpdate where

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

-- | The information required to update the S3 base location that holds the
-- application.
--
-- /See:/ 'newS3ContentBaseLocationUpdate' smart constructor.
data S3ContentBaseLocationUpdate = S3ContentBaseLocationUpdate'
  { -- | The updated Amazon Resource Name (ARN) of the S3 bucket.
    S3ContentBaseLocationUpdate -> Maybe Text
bucketARNUpdate :: Prelude.Maybe Prelude.Text,
    -- | The updated S3 bucket path.
    S3ContentBaseLocationUpdate -> Maybe Text
basePathUpdate :: Prelude.Maybe Prelude.Text
  }
  deriving (S3ContentBaseLocationUpdate -> S3ContentBaseLocationUpdate -> Bool
(S3ContentBaseLocationUpdate
 -> S3ContentBaseLocationUpdate -> Bool)
-> (S3ContentBaseLocationUpdate
    -> S3ContentBaseLocationUpdate -> Bool)
-> Eq S3ContentBaseLocationUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ContentBaseLocationUpdate -> S3ContentBaseLocationUpdate -> Bool
$c/= :: S3ContentBaseLocationUpdate -> S3ContentBaseLocationUpdate -> Bool
== :: S3ContentBaseLocationUpdate -> S3ContentBaseLocationUpdate -> Bool
$c== :: S3ContentBaseLocationUpdate -> S3ContentBaseLocationUpdate -> Bool
Prelude.Eq, ReadPrec [S3ContentBaseLocationUpdate]
ReadPrec S3ContentBaseLocationUpdate
Int -> ReadS S3ContentBaseLocationUpdate
ReadS [S3ContentBaseLocationUpdate]
(Int -> ReadS S3ContentBaseLocationUpdate)
-> ReadS [S3ContentBaseLocationUpdate]
-> ReadPrec S3ContentBaseLocationUpdate
-> ReadPrec [S3ContentBaseLocationUpdate]
-> Read S3ContentBaseLocationUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ContentBaseLocationUpdate]
$creadListPrec :: ReadPrec [S3ContentBaseLocationUpdate]
readPrec :: ReadPrec S3ContentBaseLocationUpdate
$creadPrec :: ReadPrec S3ContentBaseLocationUpdate
readList :: ReadS [S3ContentBaseLocationUpdate]
$creadList :: ReadS [S3ContentBaseLocationUpdate]
readsPrec :: Int -> ReadS S3ContentBaseLocationUpdate
$creadsPrec :: Int -> ReadS S3ContentBaseLocationUpdate
Prelude.Read, Int -> S3ContentBaseLocationUpdate -> ShowS
[S3ContentBaseLocationUpdate] -> ShowS
S3ContentBaseLocationUpdate -> String
(Int -> S3ContentBaseLocationUpdate -> ShowS)
-> (S3ContentBaseLocationUpdate -> String)
-> ([S3ContentBaseLocationUpdate] -> ShowS)
-> Show S3ContentBaseLocationUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ContentBaseLocationUpdate] -> ShowS
$cshowList :: [S3ContentBaseLocationUpdate] -> ShowS
show :: S3ContentBaseLocationUpdate -> String
$cshow :: S3ContentBaseLocationUpdate -> String
showsPrec :: Int -> S3ContentBaseLocationUpdate -> ShowS
$cshowsPrec :: Int -> S3ContentBaseLocationUpdate -> ShowS
Prelude.Show, (forall x.
 S3ContentBaseLocationUpdate -> Rep S3ContentBaseLocationUpdate x)
-> (forall x.
    Rep S3ContentBaseLocationUpdate x -> S3ContentBaseLocationUpdate)
-> Generic S3ContentBaseLocationUpdate
forall x.
Rep S3ContentBaseLocationUpdate x -> S3ContentBaseLocationUpdate
forall x.
S3ContentBaseLocationUpdate -> Rep S3ContentBaseLocationUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3ContentBaseLocationUpdate x -> S3ContentBaseLocationUpdate
$cfrom :: forall x.
S3ContentBaseLocationUpdate -> Rep S3ContentBaseLocationUpdate x
Prelude.Generic)

-- |
-- Create a value of 'S3ContentBaseLocationUpdate' 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', 's3ContentBaseLocationUpdate_bucketARNUpdate' - The updated Amazon Resource Name (ARN) of the S3 bucket.
--
-- 'basePathUpdate', 's3ContentBaseLocationUpdate_basePathUpdate' - The updated S3 bucket path.
newS3ContentBaseLocationUpdate ::
  S3ContentBaseLocationUpdate
newS3ContentBaseLocationUpdate :: S3ContentBaseLocationUpdate
newS3ContentBaseLocationUpdate =
  S3ContentBaseLocationUpdate' :: Maybe Text -> Maybe Text -> S3ContentBaseLocationUpdate
S3ContentBaseLocationUpdate'
    { $sel:bucketARNUpdate:S3ContentBaseLocationUpdate' :: Maybe Text
bucketARNUpdate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:basePathUpdate:S3ContentBaseLocationUpdate' :: Maybe Text
basePathUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The updated S3 bucket path.
s3ContentBaseLocationUpdate_basePathUpdate :: Lens.Lens' S3ContentBaseLocationUpdate (Prelude.Maybe Prelude.Text)
s3ContentBaseLocationUpdate_basePathUpdate :: (Maybe Text -> f (Maybe Text))
-> S3ContentBaseLocationUpdate -> f S3ContentBaseLocationUpdate
s3ContentBaseLocationUpdate_basePathUpdate = (S3ContentBaseLocationUpdate -> Maybe Text)
-> (S3ContentBaseLocationUpdate
    -> Maybe Text -> S3ContentBaseLocationUpdate)
-> Lens
     S3ContentBaseLocationUpdate
     S3ContentBaseLocationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ContentBaseLocationUpdate' {Maybe Text
basePathUpdate :: Maybe Text
$sel:basePathUpdate:S3ContentBaseLocationUpdate' :: S3ContentBaseLocationUpdate -> Maybe Text
basePathUpdate} -> Maybe Text
basePathUpdate) (\s :: S3ContentBaseLocationUpdate
s@S3ContentBaseLocationUpdate' {} Maybe Text
a -> S3ContentBaseLocationUpdate
s {$sel:basePathUpdate:S3ContentBaseLocationUpdate' :: Maybe Text
basePathUpdate = Maybe Text
a} :: S3ContentBaseLocationUpdate)

instance Prelude.Hashable S3ContentBaseLocationUpdate

instance Prelude.NFData S3ContentBaseLocationUpdate

instance Core.ToJSON S3ContentBaseLocationUpdate where
  toJSON :: S3ContentBaseLocationUpdate -> Value
toJSON S3ContentBaseLocationUpdate' {Maybe Text
basePathUpdate :: Maybe Text
bucketARNUpdate :: Maybe Text
$sel:basePathUpdate:S3ContentBaseLocationUpdate' :: S3ContentBaseLocationUpdate -> Maybe Text
$sel:bucketARNUpdate:S3ContentBaseLocationUpdate' :: S3ContentBaseLocationUpdate -> 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
"BasePathUpdate" 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
basePathUpdate
          ]
      )