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

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

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

-- |
-- Create a value of 'S3ContentBaseLocationDescription' 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:
--
-- 'basePath', 's3ContentBaseLocationDescription_basePath' - The base path for the S3 bucket.
--
-- 'bucketARN', 's3ContentBaseLocationDescription_bucketARN' - The Amazon Resource Name (ARN) of the S3 bucket.
newS3ContentBaseLocationDescription ::
  -- | 'bucketARN'
  Prelude.Text ->
  S3ContentBaseLocationDescription
newS3ContentBaseLocationDescription :: Text -> S3ContentBaseLocationDescription
newS3ContentBaseLocationDescription Text
pBucketARN_ =
  S3ContentBaseLocationDescription' :: Maybe Text -> Text -> S3ContentBaseLocationDescription
S3ContentBaseLocationDescription'
    { $sel:basePath:S3ContentBaseLocationDescription' :: Maybe Text
basePath =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketARN:S3ContentBaseLocationDescription' :: Text
bucketARN = Text
pBucketARN_
    }

-- | The base path for the S3 bucket.
s3ContentBaseLocationDescription_basePath :: Lens.Lens' S3ContentBaseLocationDescription (Prelude.Maybe Prelude.Text)
s3ContentBaseLocationDescription_basePath :: (Maybe Text -> f (Maybe Text))
-> S3ContentBaseLocationDescription
-> f S3ContentBaseLocationDescription
s3ContentBaseLocationDescription_basePath = (S3ContentBaseLocationDescription -> Maybe Text)
-> (S3ContentBaseLocationDescription
    -> Maybe Text -> S3ContentBaseLocationDescription)
-> Lens
     S3ContentBaseLocationDescription
     S3ContentBaseLocationDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ContentBaseLocationDescription' {Maybe Text
basePath :: Maybe Text
$sel:basePath:S3ContentBaseLocationDescription' :: S3ContentBaseLocationDescription -> Maybe Text
basePath} -> Maybe Text
basePath) (\s :: S3ContentBaseLocationDescription
s@S3ContentBaseLocationDescription' {} Maybe Text
a -> S3ContentBaseLocationDescription
s {$sel:basePath:S3ContentBaseLocationDescription' :: Maybe Text
basePath = Maybe Text
a} :: S3ContentBaseLocationDescription)

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

instance
  Core.FromJSON
    S3ContentBaseLocationDescription
  where
  parseJSON :: Value -> Parser S3ContentBaseLocationDescription
parseJSON =
    String
-> (Object -> Parser S3ContentBaseLocationDescription)
-> Value
-> Parser S3ContentBaseLocationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"S3ContentBaseLocationDescription"
      ( \Object
x ->
          Maybe Text -> Text -> S3ContentBaseLocationDescription
S3ContentBaseLocationDescription'
            (Maybe Text -> Text -> S3ContentBaseLocationDescription)
-> Parser (Maybe Text)
-> Parser (Text -> S3ContentBaseLocationDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BasePath")
            Parser (Text -> S3ContentBaseLocationDescription)
-> Parser Text -> Parser S3ContentBaseLocationDescription
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
"BucketARN")
      )

instance
  Prelude.Hashable
    S3ContentBaseLocationDescription

instance
  Prelude.NFData
    S3ContentBaseLocationDescription