{-# 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.ExportTaskS3Location
-- 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.ExportTaskS3Location 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:/ 'newExportTaskS3Location' smart constructor.
data ExportTaskS3Location = ExportTaskS3Location'
  { -- | The destination Amazon S3 bucket.
    ExportTaskS3Location -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
    -- | The prefix (logical hierarchy) in the bucket.
    ExportTaskS3Location -> Maybe Text
s3Prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (ExportTaskS3Location -> ExportTaskS3Location -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportTaskS3Location -> ExportTaskS3Location -> Bool
$c/= :: ExportTaskS3Location -> ExportTaskS3Location -> Bool
== :: ExportTaskS3Location -> ExportTaskS3Location -> Bool
$c== :: ExportTaskS3Location -> ExportTaskS3Location -> Bool
Prelude.Eq, ReadPrec [ExportTaskS3Location]
ReadPrec ExportTaskS3Location
Int -> ReadS ExportTaskS3Location
ReadS [ExportTaskS3Location]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportTaskS3Location]
$creadListPrec :: ReadPrec [ExportTaskS3Location]
readPrec :: ReadPrec ExportTaskS3Location
$creadPrec :: ReadPrec ExportTaskS3Location
readList :: ReadS [ExportTaskS3Location]
$creadList :: ReadS [ExportTaskS3Location]
readsPrec :: Int -> ReadS ExportTaskS3Location
$creadsPrec :: Int -> ReadS ExportTaskS3Location
Prelude.Read, Int -> ExportTaskS3Location -> ShowS
[ExportTaskS3Location] -> ShowS
ExportTaskS3Location -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportTaskS3Location] -> ShowS
$cshowList :: [ExportTaskS3Location] -> ShowS
show :: ExportTaskS3Location -> String
$cshow :: ExportTaskS3Location -> String
showsPrec :: Int -> ExportTaskS3Location -> ShowS
$cshowsPrec :: Int -> ExportTaskS3Location -> ShowS
Prelude.Show, forall x. Rep ExportTaskS3Location x -> ExportTaskS3Location
forall x. ExportTaskS3Location -> Rep ExportTaskS3Location x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportTaskS3Location x -> ExportTaskS3Location
$cfrom :: forall x. ExportTaskS3Location -> Rep ExportTaskS3Location x
Prelude.Generic)

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

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

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

instance Data.FromXML ExportTaskS3Location where
  parseXML :: [Node] -> Either String ExportTaskS3Location
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> ExportTaskS3Location
ExportTaskS3Location'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"s3Bucket")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"s3Prefix")

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

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