{-# 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.AlexaBusiness.Types.BusinessReportS3Location
-- 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.AlexaBusiness.Types.BusinessReportS3Location where

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

-- | The S3 location of the output reports.
--
-- /See:/ 'newBusinessReportS3Location' smart constructor.
data BusinessReportS3Location = BusinessReportS3Location'
  { -- | The path of the business report.
    BusinessReportS3Location -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | The S3 bucket name of the output reports.
    BusinessReportS3Location -> Maybe Text
bucketName :: Prelude.Maybe Prelude.Text
  }
  deriving (BusinessReportS3Location -> BusinessReportS3Location -> Bool
(BusinessReportS3Location -> BusinessReportS3Location -> Bool)
-> (BusinessReportS3Location -> BusinessReportS3Location -> Bool)
-> Eq BusinessReportS3Location
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BusinessReportS3Location -> BusinessReportS3Location -> Bool
$c/= :: BusinessReportS3Location -> BusinessReportS3Location -> Bool
== :: BusinessReportS3Location -> BusinessReportS3Location -> Bool
$c== :: BusinessReportS3Location -> BusinessReportS3Location -> Bool
Prelude.Eq, ReadPrec [BusinessReportS3Location]
ReadPrec BusinessReportS3Location
Int -> ReadS BusinessReportS3Location
ReadS [BusinessReportS3Location]
(Int -> ReadS BusinessReportS3Location)
-> ReadS [BusinessReportS3Location]
-> ReadPrec BusinessReportS3Location
-> ReadPrec [BusinessReportS3Location]
-> Read BusinessReportS3Location
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BusinessReportS3Location]
$creadListPrec :: ReadPrec [BusinessReportS3Location]
readPrec :: ReadPrec BusinessReportS3Location
$creadPrec :: ReadPrec BusinessReportS3Location
readList :: ReadS [BusinessReportS3Location]
$creadList :: ReadS [BusinessReportS3Location]
readsPrec :: Int -> ReadS BusinessReportS3Location
$creadsPrec :: Int -> ReadS BusinessReportS3Location
Prelude.Read, Int -> BusinessReportS3Location -> ShowS
[BusinessReportS3Location] -> ShowS
BusinessReportS3Location -> String
(Int -> BusinessReportS3Location -> ShowS)
-> (BusinessReportS3Location -> String)
-> ([BusinessReportS3Location] -> ShowS)
-> Show BusinessReportS3Location
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BusinessReportS3Location] -> ShowS
$cshowList :: [BusinessReportS3Location] -> ShowS
show :: BusinessReportS3Location -> String
$cshow :: BusinessReportS3Location -> String
showsPrec :: Int -> BusinessReportS3Location -> ShowS
$cshowsPrec :: Int -> BusinessReportS3Location -> ShowS
Prelude.Show, (forall x.
 BusinessReportS3Location -> Rep BusinessReportS3Location x)
-> (forall x.
    Rep BusinessReportS3Location x -> BusinessReportS3Location)
-> Generic BusinessReportS3Location
forall x.
Rep BusinessReportS3Location x -> BusinessReportS3Location
forall x.
BusinessReportS3Location -> Rep BusinessReportS3Location x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BusinessReportS3Location x -> BusinessReportS3Location
$cfrom :: forall x.
BusinessReportS3Location -> Rep BusinessReportS3Location x
Prelude.Generic)

-- |
-- Create a value of 'BusinessReportS3Location' 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:
--
-- 'path', 'businessReportS3Location_path' - The path of the business report.
--
-- 'bucketName', 'businessReportS3Location_bucketName' - The S3 bucket name of the output reports.
newBusinessReportS3Location ::
  BusinessReportS3Location
newBusinessReportS3Location :: BusinessReportS3Location
newBusinessReportS3Location =
  BusinessReportS3Location' :: Maybe Text -> Maybe Text -> BusinessReportS3Location
BusinessReportS3Location'
    { $sel:path:BusinessReportS3Location' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketName:BusinessReportS3Location' :: Maybe Text
bucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The path of the business report.
businessReportS3Location_path :: Lens.Lens' BusinessReportS3Location (Prelude.Maybe Prelude.Text)
businessReportS3Location_path :: (Maybe Text -> f (Maybe Text))
-> BusinessReportS3Location -> f BusinessReportS3Location
businessReportS3Location_path = (BusinessReportS3Location -> Maybe Text)
-> (BusinessReportS3Location
    -> Maybe Text -> BusinessReportS3Location)
-> Lens
     BusinessReportS3Location
     BusinessReportS3Location
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BusinessReportS3Location' {Maybe Text
path :: Maybe Text
$sel:path:BusinessReportS3Location' :: BusinessReportS3Location -> Maybe Text
path} -> Maybe Text
path) (\s :: BusinessReportS3Location
s@BusinessReportS3Location' {} Maybe Text
a -> BusinessReportS3Location
s {$sel:path:BusinessReportS3Location' :: Maybe Text
path = Maybe Text
a} :: BusinessReportS3Location)

-- | The S3 bucket name of the output reports.
businessReportS3Location_bucketName :: Lens.Lens' BusinessReportS3Location (Prelude.Maybe Prelude.Text)
businessReportS3Location_bucketName :: (Maybe Text -> f (Maybe Text))
-> BusinessReportS3Location -> f BusinessReportS3Location
businessReportS3Location_bucketName = (BusinessReportS3Location -> Maybe Text)
-> (BusinessReportS3Location
    -> Maybe Text -> BusinessReportS3Location)
-> Lens
     BusinessReportS3Location
     BusinessReportS3Location
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BusinessReportS3Location' {Maybe Text
bucketName :: Maybe Text
$sel:bucketName:BusinessReportS3Location' :: BusinessReportS3Location -> Maybe Text
bucketName} -> Maybe Text
bucketName) (\s :: BusinessReportS3Location
s@BusinessReportS3Location' {} Maybe Text
a -> BusinessReportS3Location
s {$sel:bucketName:BusinessReportS3Location' :: Maybe Text
bucketName = Maybe Text
a} :: BusinessReportS3Location)

instance Core.FromJSON BusinessReportS3Location where
  parseJSON :: Value -> Parser BusinessReportS3Location
parseJSON =
    String
-> (Object -> Parser BusinessReportS3Location)
-> Value
-> Parser BusinessReportS3Location
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BusinessReportS3Location"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> BusinessReportS3Location
BusinessReportS3Location'
            (Maybe Text -> Maybe Text -> BusinessReportS3Location)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> BusinessReportS3Location)
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
"Path")
            Parser (Maybe Text -> BusinessReportS3Location)
-> Parser (Maybe Text) -> Parser BusinessReportS3Location
forall (f :: * -> *) a b. Applicative f => 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
"BucketName")
      )

instance Prelude.Hashable BusinessReportS3Location

instance Prelude.NFData BusinessReportS3Location