{-# 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.ComputeOptimizer.Types.ExportDestination
-- 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.ComputeOptimizer.Types.ExportDestination where

import Amazonka.ComputeOptimizer.Types.S3Destination
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

-- | Describes the destination of the recommendations export and metadata
-- files.
--
-- /See:/ 'newExportDestination' smart constructor.
data ExportDestination = ExportDestination'
  { -- | An object that describes the destination Amazon Simple Storage Service
    -- (Amazon S3) bucket name and object keys of a recommendations export
    -- file, and its associated metadata file.
    ExportDestination -> Maybe S3Destination
s3 :: Prelude.Maybe S3Destination
  }
  deriving (ExportDestination -> ExportDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportDestination -> ExportDestination -> Bool
$c/= :: ExportDestination -> ExportDestination -> Bool
== :: ExportDestination -> ExportDestination -> Bool
$c== :: ExportDestination -> ExportDestination -> Bool
Prelude.Eq, ReadPrec [ExportDestination]
ReadPrec ExportDestination
Int -> ReadS ExportDestination
ReadS [ExportDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportDestination]
$creadListPrec :: ReadPrec [ExportDestination]
readPrec :: ReadPrec ExportDestination
$creadPrec :: ReadPrec ExportDestination
readList :: ReadS [ExportDestination]
$creadList :: ReadS [ExportDestination]
readsPrec :: Int -> ReadS ExportDestination
$creadsPrec :: Int -> ReadS ExportDestination
Prelude.Read, Int -> ExportDestination -> ShowS
[ExportDestination] -> ShowS
ExportDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportDestination] -> ShowS
$cshowList :: [ExportDestination] -> ShowS
show :: ExportDestination -> String
$cshow :: ExportDestination -> String
showsPrec :: Int -> ExportDestination -> ShowS
$cshowsPrec :: Int -> ExportDestination -> ShowS
Prelude.Show, forall x. Rep ExportDestination x -> ExportDestination
forall x. ExportDestination -> Rep ExportDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportDestination x -> ExportDestination
$cfrom :: forall x. ExportDestination -> Rep ExportDestination x
Prelude.Generic)

-- |
-- Create a value of 'ExportDestination' 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:
--
-- 's3', 'exportDestination_s3' - An object that describes the destination Amazon Simple Storage Service
-- (Amazon S3) bucket name and object keys of a recommendations export
-- file, and its associated metadata file.
newExportDestination ::
  ExportDestination
newExportDestination :: ExportDestination
newExportDestination =
  ExportDestination' {$sel:s3:ExportDestination' :: Maybe S3Destination
s3 = forall a. Maybe a
Prelude.Nothing}

-- | An object that describes the destination Amazon Simple Storage Service
-- (Amazon S3) bucket name and object keys of a recommendations export
-- file, and its associated metadata file.
exportDestination_s3 :: Lens.Lens' ExportDestination (Prelude.Maybe S3Destination)
exportDestination_s3 :: Lens' ExportDestination (Maybe S3Destination)
exportDestination_s3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportDestination' {Maybe S3Destination
s3 :: Maybe S3Destination
$sel:s3:ExportDestination' :: ExportDestination -> Maybe S3Destination
s3} -> Maybe S3Destination
s3) (\s :: ExportDestination
s@ExportDestination' {} Maybe S3Destination
a -> ExportDestination
s {$sel:s3:ExportDestination' :: Maybe S3Destination
s3 = Maybe S3Destination
a} :: ExportDestination)

instance Data.FromJSON ExportDestination where
  parseJSON :: Value -> Parser ExportDestination
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExportDestination"
      ( \Object
x ->
          Maybe S3Destination -> ExportDestination
ExportDestination' 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
"s3")
      )

instance Prelude.Hashable ExportDestination where
  hashWithSalt :: Int -> ExportDestination -> Int
hashWithSalt Int
_salt ExportDestination' {Maybe S3Destination
s3 :: Maybe S3Destination
$sel:s3:ExportDestination' :: ExportDestination -> Maybe S3Destination
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Destination
s3

instance Prelude.NFData ExportDestination where
  rnf :: ExportDestination -> ()
rnf ExportDestination' {Maybe S3Destination
s3 :: Maybe S3Destination
$sel:s3:ExportDestination' :: ExportDestination -> Maybe S3Destination
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Destination
s3