{-# 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.EC2.Types.ExportTaskS3LocationRequest
-- 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.EC2.Types.ExportTaskS3LocationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Describes the destination for an export image task.
--
-- /See:/ 'newExportTaskS3LocationRequest' smart constructor.
data ExportTaskS3LocationRequest = ExportTaskS3LocationRequest'
  { -- | The prefix (logical hierarchy) in the bucket.
    ExportTaskS3LocationRequest -> Maybe Text
s3Prefix :: Prelude.Maybe Prelude.Text,
    -- | The destination Amazon S3 bucket.
    ExportTaskS3LocationRequest -> Text
s3Bucket :: Prelude.Text
  }
  deriving (ExportTaskS3LocationRequest -> ExportTaskS3LocationRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportTaskS3LocationRequest -> ExportTaskS3LocationRequest -> Bool
$c/= :: ExportTaskS3LocationRequest -> ExportTaskS3LocationRequest -> Bool
== :: ExportTaskS3LocationRequest -> ExportTaskS3LocationRequest -> Bool
$c== :: ExportTaskS3LocationRequest -> ExportTaskS3LocationRequest -> Bool
Prelude.Eq, ReadPrec [ExportTaskS3LocationRequest]
ReadPrec ExportTaskS3LocationRequest
Int -> ReadS ExportTaskS3LocationRequest
ReadS [ExportTaskS3LocationRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportTaskS3LocationRequest]
$creadListPrec :: ReadPrec [ExportTaskS3LocationRequest]
readPrec :: ReadPrec ExportTaskS3LocationRequest
$creadPrec :: ReadPrec ExportTaskS3LocationRequest
readList :: ReadS [ExportTaskS3LocationRequest]
$creadList :: ReadS [ExportTaskS3LocationRequest]
readsPrec :: Int -> ReadS ExportTaskS3LocationRequest
$creadsPrec :: Int -> ReadS ExportTaskS3LocationRequest
Prelude.Read, Int -> ExportTaskS3LocationRequest -> ShowS
[ExportTaskS3LocationRequest] -> ShowS
ExportTaskS3LocationRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportTaskS3LocationRequest] -> ShowS
$cshowList :: [ExportTaskS3LocationRequest] -> ShowS
show :: ExportTaskS3LocationRequest -> String
$cshow :: ExportTaskS3LocationRequest -> String
showsPrec :: Int -> ExportTaskS3LocationRequest -> ShowS
$cshowsPrec :: Int -> ExportTaskS3LocationRequest -> ShowS
Prelude.Show, forall x.
Rep ExportTaskS3LocationRequest x -> ExportTaskS3LocationRequest
forall x.
ExportTaskS3LocationRequest -> Rep ExportTaskS3LocationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportTaskS3LocationRequest x -> ExportTaskS3LocationRequest
$cfrom :: forall x.
ExportTaskS3LocationRequest -> Rep ExportTaskS3LocationRequest x
Prelude.Generic)

-- |
-- Create a value of 'ExportTaskS3LocationRequest' 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:
--
-- 's3Prefix', 'exportTaskS3LocationRequest_s3Prefix' - The prefix (logical hierarchy) in the bucket.
--
-- 's3Bucket', 'exportTaskS3LocationRequest_s3Bucket' - The destination Amazon S3 bucket.
newExportTaskS3LocationRequest ::
  -- | 's3Bucket'
  Prelude.Text ->
  ExportTaskS3LocationRequest
newExportTaskS3LocationRequest :: Text -> ExportTaskS3LocationRequest
newExportTaskS3LocationRequest Text
pS3Bucket_ =
  ExportTaskS3LocationRequest'
    { $sel:s3Prefix:ExportTaskS3LocationRequest' :: Maybe Text
s3Prefix =
        forall a. Maybe a
Prelude.Nothing,
      $sel:s3Bucket:ExportTaskS3LocationRequest' :: Text
s3Bucket = Text
pS3Bucket_
    }

-- | The prefix (logical hierarchy) in the bucket.
exportTaskS3LocationRequest_s3Prefix :: Lens.Lens' ExportTaskS3LocationRequest (Prelude.Maybe Prelude.Text)
exportTaskS3LocationRequest_s3Prefix :: Lens' ExportTaskS3LocationRequest (Maybe Text)
exportTaskS3LocationRequest_s3Prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTaskS3LocationRequest' {Maybe Text
s3Prefix :: Maybe Text
$sel:s3Prefix:ExportTaskS3LocationRequest' :: ExportTaskS3LocationRequest -> Maybe Text
s3Prefix} -> Maybe Text
s3Prefix) (\s :: ExportTaskS3LocationRequest
s@ExportTaskS3LocationRequest' {} Maybe Text
a -> ExportTaskS3LocationRequest
s {$sel:s3Prefix:ExportTaskS3LocationRequest' :: Maybe Text
s3Prefix = Maybe Text
a} :: ExportTaskS3LocationRequest)

-- | The destination Amazon S3 bucket.
exportTaskS3LocationRequest_s3Bucket :: Lens.Lens' ExportTaskS3LocationRequest Prelude.Text
exportTaskS3LocationRequest_s3Bucket :: Lens' ExportTaskS3LocationRequest Text
exportTaskS3LocationRequest_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTaskS3LocationRequest' {Text
s3Bucket :: Text
$sel:s3Bucket:ExportTaskS3LocationRequest' :: ExportTaskS3LocationRequest -> Text
s3Bucket} -> Text
s3Bucket) (\s :: ExportTaskS3LocationRequest
s@ExportTaskS3LocationRequest' {} Text
a -> ExportTaskS3LocationRequest
s {$sel:s3Bucket:ExportTaskS3LocationRequest' :: Text
s3Bucket = Text
a} :: ExportTaskS3LocationRequest)

instance Prelude.Hashable ExportTaskS3LocationRequest where
  hashWithSalt :: Int -> ExportTaskS3LocationRequest -> Int
hashWithSalt Int
_salt ExportTaskS3LocationRequest' {Maybe Text
Text
s3Bucket :: Text
s3Prefix :: Maybe Text
$sel:s3Bucket:ExportTaskS3LocationRequest' :: ExportTaskS3LocationRequest -> Text
$sel:s3Prefix:ExportTaskS3LocationRequest' :: ExportTaskS3LocationRequest -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Prefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3Bucket

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

instance Data.ToQuery ExportTaskS3LocationRequest where
  toQuery :: ExportTaskS3LocationRequest -> QueryString
toQuery ExportTaskS3LocationRequest' {Maybe Text
Text
s3Bucket :: Text
s3Prefix :: Maybe Text
$sel:s3Bucket:ExportTaskS3LocationRequest' :: ExportTaskS3LocationRequest -> Text
$sel:s3Prefix:ExportTaskS3LocationRequest' :: ExportTaskS3LocationRequest -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"S3Prefix" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
s3Prefix,
        ByteString
"S3Bucket" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
s3Bucket
      ]