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

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

-- | Describes an update for the Amazon S3 code content location for an
-- application.
--
-- /See:/ 'newS3ContentLocationUpdate' smart constructor.
data S3ContentLocationUpdate = S3ContentLocationUpdate'
  { -- | The new Amazon Resource Name (ARN) for the S3 bucket containing the
    -- application code.
    S3ContentLocationUpdate -> Maybe Text
bucketARNUpdate :: Prelude.Maybe Prelude.Text,
    -- | The new file key for the object containing the application code.
    S3ContentLocationUpdate -> Maybe Text
fileKeyUpdate :: Prelude.Maybe Prelude.Text,
    -- | The new version of the object containing the application code.
    S3ContentLocationUpdate -> Maybe Text
objectVersionUpdate :: Prelude.Maybe Prelude.Text
  }
  deriving (S3ContentLocationUpdate -> S3ContentLocationUpdate -> Bool
(S3ContentLocationUpdate -> S3ContentLocationUpdate -> Bool)
-> (S3ContentLocationUpdate -> S3ContentLocationUpdate -> Bool)
-> Eq S3ContentLocationUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ContentLocationUpdate -> S3ContentLocationUpdate -> Bool
$c/= :: S3ContentLocationUpdate -> S3ContentLocationUpdate -> Bool
== :: S3ContentLocationUpdate -> S3ContentLocationUpdate -> Bool
$c== :: S3ContentLocationUpdate -> S3ContentLocationUpdate -> Bool
Prelude.Eq, ReadPrec [S3ContentLocationUpdate]
ReadPrec S3ContentLocationUpdate
Int -> ReadS S3ContentLocationUpdate
ReadS [S3ContentLocationUpdate]
(Int -> ReadS S3ContentLocationUpdate)
-> ReadS [S3ContentLocationUpdate]
-> ReadPrec S3ContentLocationUpdate
-> ReadPrec [S3ContentLocationUpdate]
-> Read S3ContentLocationUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ContentLocationUpdate]
$creadListPrec :: ReadPrec [S3ContentLocationUpdate]
readPrec :: ReadPrec S3ContentLocationUpdate
$creadPrec :: ReadPrec S3ContentLocationUpdate
readList :: ReadS [S3ContentLocationUpdate]
$creadList :: ReadS [S3ContentLocationUpdate]
readsPrec :: Int -> ReadS S3ContentLocationUpdate
$creadsPrec :: Int -> ReadS S3ContentLocationUpdate
Prelude.Read, Int -> S3ContentLocationUpdate -> ShowS
[S3ContentLocationUpdate] -> ShowS
S3ContentLocationUpdate -> String
(Int -> S3ContentLocationUpdate -> ShowS)
-> (S3ContentLocationUpdate -> String)
-> ([S3ContentLocationUpdate] -> ShowS)
-> Show S3ContentLocationUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ContentLocationUpdate] -> ShowS
$cshowList :: [S3ContentLocationUpdate] -> ShowS
show :: S3ContentLocationUpdate -> String
$cshow :: S3ContentLocationUpdate -> String
showsPrec :: Int -> S3ContentLocationUpdate -> ShowS
$cshowsPrec :: Int -> S3ContentLocationUpdate -> ShowS
Prelude.Show, (forall x.
 S3ContentLocationUpdate -> Rep S3ContentLocationUpdate x)
-> (forall x.
    Rep S3ContentLocationUpdate x -> S3ContentLocationUpdate)
-> Generic S3ContentLocationUpdate
forall x. Rep S3ContentLocationUpdate x -> S3ContentLocationUpdate
forall x. S3ContentLocationUpdate -> Rep S3ContentLocationUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3ContentLocationUpdate x -> S3ContentLocationUpdate
$cfrom :: forall x. S3ContentLocationUpdate -> Rep S3ContentLocationUpdate x
Prelude.Generic)

-- |
-- Create a value of 'S3ContentLocationUpdate' 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', 's3ContentLocationUpdate_bucketARNUpdate' - The new Amazon Resource Name (ARN) for the S3 bucket containing the
-- application code.
--
-- 'fileKeyUpdate', 's3ContentLocationUpdate_fileKeyUpdate' - The new file key for the object containing the application code.
--
-- 'objectVersionUpdate', 's3ContentLocationUpdate_objectVersionUpdate' - The new version of the object containing the application code.
newS3ContentLocationUpdate ::
  S3ContentLocationUpdate
newS3ContentLocationUpdate :: S3ContentLocationUpdate
newS3ContentLocationUpdate =
  S3ContentLocationUpdate' :: Maybe Text -> Maybe Text -> Maybe Text -> S3ContentLocationUpdate
S3ContentLocationUpdate'
    { $sel:bucketARNUpdate:S3ContentLocationUpdate' :: Maybe Text
bucketARNUpdate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fileKeyUpdate:S3ContentLocationUpdate' :: Maybe Text
fileKeyUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:objectVersionUpdate:S3ContentLocationUpdate' :: Maybe Text
objectVersionUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The new Amazon Resource Name (ARN) for the S3 bucket containing the
-- application code.
s3ContentLocationUpdate_bucketARNUpdate :: Lens.Lens' S3ContentLocationUpdate (Prelude.Maybe Prelude.Text)
s3ContentLocationUpdate_bucketARNUpdate :: (Maybe Text -> f (Maybe Text))
-> S3ContentLocationUpdate -> f S3ContentLocationUpdate
s3ContentLocationUpdate_bucketARNUpdate = (S3ContentLocationUpdate -> Maybe Text)
-> (S3ContentLocationUpdate
    -> Maybe Text -> S3ContentLocationUpdate)
-> Lens
     S3ContentLocationUpdate
     S3ContentLocationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ContentLocationUpdate' {Maybe Text
bucketARNUpdate :: Maybe Text
$sel:bucketARNUpdate:S3ContentLocationUpdate' :: S3ContentLocationUpdate -> Maybe Text
bucketARNUpdate} -> Maybe Text
bucketARNUpdate) (\s :: S3ContentLocationUpdate
s@S3ContentLocationUpdate' {} Maybe Text
a -> S3ContentLocationUpdate
s {$sel:bucketARNUpdate:S3ContentLocationUpdate' :: Maybe Text
bucketARNUpdate = Maybe Text
a} :: S3ContentLocationUpdate)

-- | The new file key for the object containing the application code.
s3ContentLocationUpdate_fileKeyUpdate :: Lens.Lens' S3ContentLocationUpdate (Prelude.Maybe Prelude.Text)
s3ContentLocationUpdate_fileKeyUpdate :: (Maybe Text -> f (Maybe Text))
-> S3ContentLocationUpdate -> f S3ContentLocationUpdate
s3ContentLocationUpdate_fileKeyUpdate = (S3ContentLocationUpdate -> Maybe Text)
-> (S3ContentLocationUpdate
    -> Maybe Text -> S3ContentLocationUpdate)
-> Lens
     S3ContentLocationUpdate
     S3ContentLocationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ContentLocationUpdate' {Maybe Text
fileKeyUpdate :: Maybe Text
$sel:fileKeyUpdate:S3ContentLocationUpdate' :: S3ContentLocationUpdate -> Maybe Text
fileKeyUpdate} -> Maybe Text
fileKeyUpdate) (\s :: S3ContentLocationUpdate
s@S3ContentLocationUpdate' {} Maybe Text
a -> S3ContentLocationUpdate
s {$sel:fileKeyUpdate:S3ContentLocationUpdate' :: Maybe Text
fileKeyUpdate = Maybe Text
a} :: S3ContentLocationUpdate)

-- | The new version of the object containing the application code.
s3ContentLocationUpdate_objectVersionUpdate :: Lens.Lens' S3ContentLocationUpdate (Prelude.Maybe Prelude.Text)
s3ContentLocationUpdate_objectVersionUpdate :: (Maybe Text -> f (Maybe Text))
-> S3ContentLocationUpdate -> f S3ContentLocationUpdate
s3ContentLocationUpdate_objectVersionUpdate = (S3ContentLocationUpdate -> Maybe Text)
-> (S3ContentLocationUpdate
    -> Maybe Text -> S3ContentLocationUpdate)
-> Lens
     S3ContentLocationUpdate
     S3ContentLocationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ContentLocationUpdate' {Maybe Text
objectVersionUpdate :: Maybe Text
$sel:objectVersionUpdate:S3ContentLocationUpdate' :: S3ContentLocationUpdate -> Maybe Text
objectVersionUpdate} -> Maybe Text
objectVersionUpdate) (\s :: S3ContentLocationUpdate
s@S3ContentLocationUpdate' {} Maybe Text
a -> S3ContentLocationUpdate
s {$sel:objectVersionUpdate:S3ContentLocationUpdate' :: Maybe Text
objectVersionUpdate = Maybe Text
a} :: S3ContentLocationUpdate)

instance Prelude.Hashable S3ContentLocationUpdate

instance Prelude.NFData S3ContentLocationUpdate

instance Core.ToJSON S3ContentLocationUpdate where
  toJSON :: S3ContentLocationUpdate -> Value
toJSON S3ContentLocationUpdate' {Maybe Text
objectVersionUpdate :: Maybe Text
fileKeyUpdate :: Maybe Text
bucketARNUpdate :: Maybe Text
$sel:objectVersionUpdate:S3ContentLocationUpdate' :: S3ContentLocationUpdate -> Maybe Text
$sel:fileKeyUpdate:S3ContentLocationUpdate' :: S3ContentLocationUpdate -> Maybe Text
$sel:bucketARNUpdate:S3ContentLocationUpdate' :: S3ContentLocationUpdate -> 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
"ObjectVersionUpdate" 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
objectVersionUpdate
          ]
      )