{-# 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.QuickSight.Types.S3Parameters
-- 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.QuickSight.Types.S3Parameters 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
import Amazonka.QuickSight.Types.ManifestFileLocation

-- | The parameters for S3.
--
-- /See:/ 'newS3Parameters' smart constructor.
data S3Parameters = S3Parameters'
  { -- | Location of the Amazon S3 manifest file. This is NULL if the manifest
    -- file was uploaded into Amazon QuickSight.
    S3Parameters -> ManifestFileLocation
manifestFileLocation :: ManifestFileLocation
  }
  deriving (S3Parameters -> S3Parameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3Parameters -> S3Parameters -> Bool
$c/= :: S3Parameters -> S3Parameters -> Bool
== :: S3Parameters -> S3Parameters -> Bool
$c== :: S3Parameters -> S3Parameters -> Bool
Prelude.Eq, ReadPrec [S3Parameters]
ReadPrec S3Parameters
Int -> ReadS S3Parameters
ReadS [S3Parameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3Parameters]
$creadListPrec :: ReadPrec [S3Parameters]
readPrec :: ReadPrec S3Parameters
$creadPrec :: ReadPrec S3Parameters
readList :: ReadS [S3Parameters]
$creadList :: ReadS [S3Parameters]
readsPrec :: Int -> ReadS S3Parameters
$creadsPrec :: Int -> ReadS S3Parameters
Prelude.Read, Int -> S3Parameters -> ShowS
[S3Parameters] -> ShowS
S3Parameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3Parameters] -> ShowS
$cshowList :: [S3Parameters] -> ShowS
show :: S3Parameters -> String
$cshow :: S3Parameters -> String
showsPrec :: Int -> S3Parameters -> ShowS
$cshowsPrec :: Int -> S3Parameters -> ShowS
Prelude.Show, forall x. Rep S3Parameters x -> S3Parameters
forall x. S3Parameters -> Rep S3Parameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3Parameters x -> S3Parameters
$cfrom :: forall x. S3Parameters -> Rep S3Parameters x
Prelude.Generic)

-- |
-- Create a value of 'S3Parameters' 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:
--
-- 'manifestFileLocation', 's3Parameters_manifestFileLocation' - Location of the Amazon S3 manifest file. This is NULL if the manifest
-- file was uploaded into Amazon QuickSight.
newS3Parameters ::
  -- | 'manifestFileLocation'
  ManifestFileLocation ->
  S3Parameters
newS3Parameters :: ManifestFileLocation -> S3Parameters
newS3Parameters ManifestFileLocation
pManifestFileLocation_ =
  S3Parameters'
    { $sel:manifestFileLocation:S3Parameters' :: ManifestFileLocation
manifestFileLocation =
        ManifestFileLocation
pManifestFileLocation_
    }

-- | Location of the Amazon S3 manifest file. This is NULL if the manifest
-- file was uploaded into Amazon QuickSight.
s3Parameters_manifestFileLocation :: Lens.Lens' S3Parameters ManifestFileLocation
s3Parameters_manifestFileLocation :: Lens' S3Parameters ManifestFileLocation
s3Parameters_manifestFileLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Parameters' {ManifestFileLocation
manifestFileLocation :: ManifestFileLocation
$sel:manifestFileLocation:S3Parameters' :: S3Parameters -> ManifestFileLocation
manifestFileLocation} -> ManifestFileLocation
manifestFileLocation) (\s :: S3Parameters
s@S3Parameters' {} ManifestFileLocation
a -> S3Parameters
s {$sel:manifestFileLocation:S3Parameters' :: ManifestFileLocation
manifestFileLocation = ManifestFileLocation
a} :: S3Parameters)

instance Data.FromJSON S3Parameters where
  parseJSON :: Value -> Parser S3Parameters
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"S3Parameters"
      ( \Object
x ->
          ManifestFileLocation -> S3Parameters
S3Parameters'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ManifestFileLocation")
      )

instance Prelude.Hashable S3Parameters where
  hashWithSalt :: Int -> S3Parameters -> Int
hashWithSalt Int
_salt S3Parameters' {ManifestFileLocation
manifestFileLocation :: ManifestFileLocation
$sel:manifestFileLocation:S3Parameters' :: S3Parameters -> ManifestFileLocation
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ManifestFileLocation
manifestFileLocation

instance Prelude.NFData S3Parameters where
  rnf :: S3Parameters -> ()
rnf S3Parameters' {ManifestFileLocation
manifestFileLocation :: ManifestFileLocation
$sel:manifestFileLocation:S3Parameters' :: S3Parameters -> ManifestFileLocation
..} =
    forall a. NFData a => a -> ()
Prelude.rnf ManifestFileLocation
manifestFileLocation

instance Data.ToJSON S3Parameters where
  toJSON :: S3Parameters -> Value
toJSON S3Parameters' {ManifestFileLocation
manifestFileLocation :: ManifestFileLocation
$sel:manifestFileLocation:S3Parameters' :: S3Parameters -> ManifestFileLocation
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"ManifestFileLocation"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ManifestFileLocation
manifestFileLocation
              )
          ]
      )