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

-- | 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
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]
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
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. 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'
    { $sel:bucketARNUpdate:S3ContentLocationUpdate' :: Maybe Text
bucketARNUpdate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fileKeyUpdate:S3ContentLocationUpdate' :: Maybe Text
fileKeyUpdate = forall a. Maybe a
Prelude.Nothing,
      $sel:objectVersionUpdate:S3ContentLocationUpdate' :: Maybe Text
objectVersionUpdate = 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 :: Lens' S3ContentLocationUpdate (Maybe Text)
s3ContentLocationUpdate_bucketARNUpdate = 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 :: Lens' S3ContentLocationUpdate (Maybe Text)
s3ContentLocationUpdate_fileKeyUpdate = 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 :: Lens' S3ContentLocationUpdate (Maybe Text)
s3ContentLocationUpdate_objectVersionUpdate = 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 where
  hashWithSalt :: Int -> S3ContentLocationUpdate -> Int
hashWithSalt Int
_salt 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
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucketARNUpdate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fileKeyUpdate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
objectVersionUpdate

instance Prelude.NFData S3ContentLocationUpdate where
  rnf :: S3ContentLocationUpdate -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketARNUpdate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileKeyUpdate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
objectVersionUpdate

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BucketARNUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bucketARNUpdate,
            (Key
"FileKeyUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fileKeyUpdate,
            (Key
"ObjectVersionUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
objectVersionUpdate
          ]
      )