{-# 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.TimeStreamQuery.Types.S3ReportLocation
-- 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.TimeStreamQuery.Types.S3ReportLocation 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

-- | S3 report location for the scheduled query run.
--
-- /See:/ 'newS3ReportLocation' smart constructor.
data S3ReportLocation = S3ReportLocation'
  { -- | S3 bucket name.
    S3ReportLocation -> Maybe Text
bucketName :: Prelude.Maybe Prelude.Text,
    -- | S3 key.
    S3ReportLocation -> Maybe Text
objectKey :: Prelude.Maybe Prelude.Text
  }
  deriving (S3ReportLocation -> S3ReportLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ReportLocation -> S3ReportLocation -> Bool
$c/= :: S3ReportLocation -> S3ReportLocation -> Bool
== :: S3ReportLocation -> S3ReportLocation -> Bool
$c== :: S3ReportLocation -> S3ReportLocation -> Bool
Prelude.Eq, ReadPrec [S3ReportLocation]
ReadPrec S3ReportLocation
Int -> ReadS S3ReportLocation
ReadS [S3ReportLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ReportLocation]
$creadListPrec :: ReadPrec [S3ReportLocation]
readPrec :: ReadPrec S3ReportLocation
$creadPrec :: ReadPrec S3ReportLocation
readList :: ReadS [S3ReportLocation]
$creadList :: ReadS [S3ReportLocation]
readsPrec :: Int -> ReadS S3ReportLocation
$creadsPrec :: Int -> ReadS S3ReportLocation
Prelude.Read, Int -> S3ReportLocation -> ShowS
[S3ReportLocation] -> ShowS
S3ReportLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ReportLocation] -> ShowS
$cshowList :: [S3ReportLocation] -> ShowS
show :: S3ReportLocation -> String
$cshow :: S3ReportLocation -> String
showsPrec :: Int -> S3ReportLocation -> ShowS
$cshowsPrec :: Int -> S3ReportLocation -> ShowS
Prelude.Show, forall x. Rep S3ReportLocation x -> S3ReportLocation
forall x. S3ReportLocation -> Rep S3ReportLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3ReportLocation x -> S3ReportLocation
$cfrom :: forall x. S3ReportLocation -> Rep S3ReportLocation x
Prelude.Generic)

-- |
-- Create a value of 'S3ReportLocation' 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:
--
-- 'bucketName', 's3ReportLocation_bucketName' - S3 bucket name.
--
-- 'objectKey', 's3ReportLocation_objectKey' - S3 key.
newS3ReportLocation ::
  S3ReportLocation
newS3ReportLocation :: S3ReportLocation
newS3ReportLocation =
  S3ReportLocation'
    { $sel:bucketName:S3ReportLocation' :: Maybe Text
bucketName = forall a. Maybe a
Prelude.Nothing,
      $sel:objectKey:S3ReportLocation' :: Maybe Text
objectKey = forall a. Maybe a
Prelude.Nothing
    }

-- | S3 bucket name.
s3ReportLocation_bucketName :: Lens.Lens' S3ReportLocation (Prelude.Maybe Prelude.Text)
s3ReportLocation_bucketName :: Lens' S3ReportLocation (Maybe Text)
s3ReportLocation_bucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ReportLocation' {Maybe Text
bucketName :: Maybe Text
$sel:bucketName:S3ReportLocation' :: S3ReportLocation -> Maybe Text
bucketName} -> Maybe Text
bucketName) (\s :: S3ReportLocation
s@S3ReportLocation' {} Maybe Text
a -> S3ReportLocation
s {$sel:bucketName:S3ReportLocation' :: Maybe Text
bucketName = Maybe Text
a} :: S3ReportLocation)

-- | S3 key.
s3ReportLocation_objectKey :: Lens.Lens' S3ReportLocation (Prelude.Maybe Prelude.Text)
s3ReportLocation_objectKey :: Lens' S3ReportLocation (Maybe Text)
s3ReportLocation_objectKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ReportLocation' {Maybe Text
objectKey :: Maybe Text
$sel:objectKey:S3ReportLocation' :: S3ReportLocation -> Maybe Text
objectKey} -> Maybe Text
objectKey) (\s :: S3ReportLocation
s@S3ReportLocation' {} Maybe Text
a -> S3ReportLocation
s {$sel:objectKey:S3ReportLocation' :: Maybe Text
objectKey = Maybe Text
a} :: S3ReportLocation)

instance Data.FromJSON S3ReportLocation where
  parseJSON :: Value -> Parser S3ReportLocation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"S3ReportLocation"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> S3ReportLocation
S3ReportLocation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BucketName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ObjectKey")
      )

instance Prelude.Hashable S3ReportLocation where
  hashWithSalt :: Int -> S3ReportLocation -> Int
hashWithSalt Int
_salt S3ReportLocation' {Maybe Text
objectKey :: Maybe Text
bucketName :: Maybe Text
$sel:objectKey:S3ReportLocation' :: S3ReportLocation -> Maybe Text
$sel:bucketName:S3ReportLocation' :: S3ReportLocation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucketName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
objectKey

instance Prelude.NFData S3ReportLocation where
  rnf :: S3ReportLocation -> ()
rnf S3ReportLocation' {Maybe Text
objectKey :: Maybe Text
bucketName :: Maybe Text
$sel:objectKey:S3ReportLocation' :: S3ReportLocation -> Maybe Text
$sel:bucketName:S3ReportLocation' :: S3ReportLocation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
objectKey