{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ExportEBSVolumeRecommendations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Exports optimization recommendations for Amazon EBS volumes.
--
-- Recommendations are exported in a comma-separated values (.csv) file,
-- and its metadata in a JavaScript Object Notation (JSON) (.json) file, to
-- an existing Amazon Simple Storage Service (Amazon S3) bucket that you
-- specify. For more information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html Exporting Recommendations>
-- in the /Compute Optimizer User Guide/.
--
-- You can have only one Amazon EBS volume export job in progress per
-- Amazon Web Services Region.
module Amazonka.ComputeOptimizer.ExportEBSVolumeRecommendations
  ( -- * Creating a Request
    ExportEBSVolumeRecommendations (..),
    newExportEBSVolumeRecommendations,

    -- * Request Lenses
    exportEBSVolumeRecommendations_accountIds,
    exportEBSVolumeRecommendations_fieldsToExport,
    exportEBSVolumeRecommendations_fileFormat,
    exportEBSVolumeRecommendations_filters,
    exportEBSVolumeRecommendations_includeMemberAccounts,
    exportEBSVolumeRecommendations_s3DestinationConfig,

    -- * Destructuring the Response
    ExportEBSVolumeRecommendationsResponse (..),
    newExportEBSVolumeRecommendationsResponse,

    -- * Response Lenses
    exportEBSVolumeRecommendationsResponse_jobId,
    exportEBSVolumeRecommendationsResponse_s3Destination,
    exportEBSVolumeRecommendationsResponse_httpStatus,
  )
where

import Amazonka.ComputeOptimizer.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newExportEBSVolumeRecommendations' smart constructor.
data ExportEBSVolumeRecommendations = ExportEBSVolumeRecommendations'
  { -- | The IDs of the Amazon Web Services accounts for which to export Amazon
    -- EBS volume recommendations.
    --
    -- If your account is the management account of an organization, use this
    -- parameter to specify the member account for which you want to export
    -- recommendations.
    --
    -- This parameter cannot be specified together with the include member
    -- accounts parameter. The parameters are mutually exclusive.
    --
    -- Recommendations for member accounts are not included in the export if
    -- this parameter, or the include member accounts parameter, is omitted.
    --
    -- You can specify multiple account IDs per request.
    ExportEBSVolumeRecommendations -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
    -- | The recommendations data to include in the export file. For more
    -- information about the fields that can be exported, see
    -- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html#exported-files Exported files>
    -- in the /Compute Optimizer User Guide/.
    ExportEBSVolumeRecommendations -> Maybe [ExportableVolumeField]
fieldsToExport :: Prelude.Maybe [ExportableVolumeField],
    -- | The format of the export file.
    --
    -- The only export file format currently supported is @Csv@.
    ExportEBSVolumeRecommendations -> Maybe FileFormat
fileFormat :: Prelude.Maybe FileFormat,
    -- | An array of objects to specify a filter that exports a more specific set
    -- of Amazon EBS volume recommendations.
    ExportEBSVolumeRecommendations -> Maybe [EBSFilter]
filters :: Prelude.Maybe [EBSFilter],
    -- | Indicates whether to include recommendations for resources in all member
    -- accounts of the organization if your account is the management account
    -- of an organization.
    --
    -- The member accounts must also be opted in to Compute Optimizer, and
    -- trusted access for Compute Optimizer must be enabled in the organization
    -- account. For more information, see
    -- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html#trusted-service-access Compute Optimizer and Amazon Web Services Organizations trusted access>
    -- in the /Compute Optimizer User Guide/.
    --
    -- Recommendations for member accounts of the organization are not included
    -- in the export file if this parameter is omitted.
    --
    -- This parameter cannot be specified together with the account IDs
    -- parameter. The parameters are mutually exclusive.
    --
    -- Recommendations for member accounts are not included in the export if
    -- this parameter, or the account IDs parameter, is omitted.
    ExportEBSVolumeRecommendations -> Maybe Bool
includeMemberAccounts :: Prelude.Maybe Prelude.Bool,
    ExportEBSVolumeRecommendations -> S3DestinationConfig
s3DestinationConfig :: S3DestinationConfig
  }
  deriving (ExportEBSVolumeRecommendations
-> ExportEBSVolumeRecommendations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportEBSVolumeRecommendations
-> ExportEBSVolumeRecommendations -> Bool
$c/= :: ExportEBSVolumeRecommendations
-> ExportEBSVolumeRecommendations -> Bool
== :: ExportEBSVolumeRecommendations
-> ExportEBSVolumeRecommendations -> Bool
$c== :: ExportEBSVolumeRecommendations
-> ExportEBSVolumeRecommendations -> Bool
Prelude.Eq, ReadPrec [ExportEBSVolumeRecommendations]
ReadPrec ExportEBSVolumeRecommendations
Int -> ReadS ExportEBSVolumeRecommendations
ReadS [ExportEBSVolumeRecommendations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportEBSVolumeRecommendations]
$creadListPrec :: ReadPrec [ExportEBSVolumeRecommendations]
readPrec :: ReadPrec ExportEBSVolumeRecommendations
$creadPrec :: ReadPrec ExportEBSVolumeRecommendations
readList :: ReadS [ExportEBSVolumeRecommendations]
$creadList :: ReadS [ExportEBSVolumeRecommendations]
readsPrec :: Int -> ReadS ExportEBSVolumeRecommendations
$creadsPrec :: Int -> ReadS ExportEBSVolumeRecommendations
Prelude.Read, Int -> ExportEBSVolumeRecommendations -> ShowS
[ExportEBSVolumeRecommendations] -> ShowS
ExportEBSVolumeRecommendations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportEBSVolumeRecommendations] -> ShowS
$cshowList :: [ExportEBSVolumeRecommendations] -> ShowS
show :: ExportEBSVolumeRecommendations -> String
$cshow :: ExportEBSVolumeRecommendations -> String
showsPrec :: Int -> ExportEBSVolumeRecommendations -> ShowS
$cshowsPrec :: Int -> ExportEBSVolumeRecommendations -> ShowS
Prelude.Show, forall x.
Rep ExportEBSVolumeRecommendations x
-> ExportEBSVolumeRecommendations
forall x.
ExportEBSVolumeRecommendations
-> Rep ExportEBSVolumeRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportEBSVolumeRecommendations x
-> ExportEBSVolumeRecommendations
$cfrom :: forall x.
ExportEBSVolumeRecommendations
-> Rep ExportEBSVolumeRecommendations x
Prelude.Generic)

-- |
-- Create a value of 'ExportEBSVolumeRecommendations' 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:
--
-- 'accountIds', 'exportEBSVolumeRecommendations_accountIds' - The IDs of the Amazon Web Services accounts for which to export Amazon
-- EBS volume recommendations.
--
-- If your account is the management account of an organization, use this
-- parameter to specify the member account for which you want to export
-- recommendations.
--
-- This parameter cannot be specified together with the include member
-- accounts parameter. The parameters are mutually exclusive.
--
-- Recommendations for member accounts are not included in the export if
-- this parameter, or the include member accounts parameter, is omitted.
--
-- You can specify multiple account IDs per request.
--
-- 'fieldsToExport', 'exportEBSVolumeRecommendations_fieldsToExport' - The recommendations data to include in the export file. For more
-- information about the fields that can be exported, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html#exported-files Exported files>
-- in the /Compute Optimizer User Guide/.
--
-- 'fileFormat', 'exportEBSVolumeRecommendations_fileFormat' - The format of the export file.
--
-- The only export file format currently supported is @Csv@.
--
-- 'filters', 'exportEBSVolumeRecommendations_filters' - An array of objects to specify a filter that exports a more specific set
-- of Amazon EBS volume recommendations.
--
-- 'includeMemberAccounts', 'exportEBSVolumeRecommendations_includeMemberAccounts' - Indicates whether to include recommendations for resources in all member
-- accounts of the organization if your account is the management account
-- of an organization.
--
-- The member accounts must also be opted in to Compute Optimizer, and
-- trusted access for Compute Optimizer must be enabled in the organization
-- account. For more information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html#trusted-service-access Compute Optimizer and Amazon Web Services Organizations trusted access>
-- in the /Compute Optimizer User Guide/.
--
-- Recommendations for member accounts of the organization are not included
-- in the export file if this parameter is omitted.
--
-- This parameter cannot be specified together with the account IDs
-- parameter. The parameters are mutually exclusive.
--
-- Recommendations for member accounts are not included in the export if
-- this parameter, or the account IDs parameter, is omitted.
--
-- 's3DestinationConfig', 'exportEBSVolumeRecommendations_s3DestinationConfig' - Undocumented member.
newExportEBSVolumeRecommendations ::
  -- | 's3DestinationConfig'
  S3DestinationConfig ->
  ExportEBSVolumeRecommendations
newExportEBSVolumeRecommendations :: S3DestinationConfig -> ExportEBSVolumeRecommendations
newExportEBSVolumeRecommendations
  S3DestinationConfig
pS3DestinationConfig_ =
    ExportEBSVolumeRecommendations'
      { $sel:accountIds:ExportEBSVolumeRecommendations' :: Maybe [Text]
accountIds =
          forall a. Maybe a
Prelude.Nothing,
        $sel:fieldsToExport:ExportEBSVolumeRecommendations' :: Maybe [ExportableVolumeField]
fieldsToExport = forall a. Maybe a
Prelude.Nothing,
        $sel:fileFormat:ExportEBSVolumeRecommendations' :: Maybe FileFormat
fileFormat = forall a. Maybe a
Prelude.Nothing,
        $sel:filters:ExportEBSVolumeRecommendations' :: Maybe [EBSFilter]
filters = forall a. Maybe a
Prelude.Nothing,
        $sel:includeMemberAccounts:ExportEBSVolumeRecommendations' :: Maybe Bool
includeMemberAccounts = forall a. Maybe a
Prelude.Nothing,
        $sel:s3DestinationConfig:ExportEBSVolumeRecommendations' :: S3DestinationConfig
s3DestinationConfig = S3DestinationConfig
pS3DestinationConfig_
      }

-- | The IDs of the Amazon Web Services accounts for which to export Amazon
-- EBS volume recommendations.
--
-- If your account is the management account of an organization, use this
-- parameter to specify the member account for which you want to export
-- recommendations.
--
-- This parameter cannot be specified together with the include member
-- accounts parameter. The parameters are mutually exclusive.
--
-- Recommendations for member accounts are not included in the export if
-- this parameter, or the include member accounts parameter, is omitted.
--
-- You can specify multiple account IDs per request.
exportEBSVolumeRecommendations_accountIds :: Lens.Lens' ExportEBSVolumeRecommendations (Prelude.Maybe [Prelude.Text])
exportEBSVolumeRecommendations_accountIds :: Lens' ExportEBSVolumeRecommendations (Maybe [Text])
exportEBSVolumeRecommendations_accountIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendations' {Maybe [Text]
accountIds :: Maybe [Text]
$sel:accountIds:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [Text]
accountIds} -> Maybe [Text]
accountIds) (\s :: ExportEBSVolumeRecommendations
s@ExportEBSVolumeRecommendations' {} Maybe [Text]
a -> ExportEBSVolumeRecommendations
s {$sel:accountIds:ExportEBSVolumeRecommendations' :: Maybe [Text]
accountIds = Maybe [Text]
a} :: ExportEBSVolumeRecommendations) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The recommendations data to include in the export file. For more
-- information about the fields that can be exported, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html#exported-files Exported files>
-- in the /Compute Optimizer User Guide/.
exportEBSVolumeRecommendations_fieldsToExport :: Lens.Lens' ExportEBSVolumeRecommendations (Prelude.Maybe [ExportableVolumeField])
exportEBSVolumeRecommendations_fieldsToExport :: Lens'
  ExportEBSVolumeRecommendations (Maybe [ExportableVolumeField])
exportEBSVolumeRecommendations_fieldsToExport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendations' {Maybe [ExportableVolumeField]
fieldsToExport :: Maybe [ExportableVolumeField]
$sel:fieldsToExport:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [ExportableVolumeField]
fieldsToExport} -> Maybe [ExportableVolumeField]
fieldsToExport) (\s :: ExportEBSVolumeRecommendations
s@ExportEBSVolumeRecommendations' {} Maybe [ExportableVolumeField]
a -> ExportEBSVolumeRecommendations
s {$sel:fieldsToExport:ExportEBSVolumeRecommendations' :: Maybe [ExportableVolumeField]
fieldsToExport = Maybe [ExportableVolumeField]
a} :: ExportEBSVolumeRecommendations) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The format of the export file.
--
-- The only export file format currently supported is @Csv@.
exportEBSVolumeRecommendations_fileFormat :: Lens.Lens' ExportEBSVolumeRecommendations (Prelude.Maybe FileFormat)
exportEBSVolumeRecommendations_fileFormat :: Lens' ExportEBSVolumeRecommendations (Maybe FileFormat)
exportEBSVolumeRecommendations_fileFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendations' {Maybe FileFormat
fileFormat :: Maybe FileFormat
$sel:fileFormat:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe FileFormat
fileFormat} -> Maybe FileFormat
fileFormat) (\s :: ExportEBSVolumeRecommendations
s@ExportEBSVolumeRecommendations' {} Maybe FileFormat
a -> ExportEBSVolumeRecommendations
s {$sel:fileFormat:ExportEBSVolumeRecommendations' :: Maybe FileFormat
fileFormat = Maybe FileFormat
a} :: ExportEBSVolumeRecommendations)

-- | An array of objects to specify a filter that exports a more specific set
-- of Amazon EBS volume recommendations.
exportEBSVolumeRecommendations_filters :: Lens.Lens' ExportEBSVolumeRecommendations (Prelude.Maybe [EBSFilter])
exportEBSVolumeRecommendations_filters :: Lens' ExportEBSVolumeRecommendations (Maybe [EBSFilter])
exportEBSVolumeRecommendations_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendations' {Maybe [EBSFilter]
filters :: Maybe [EBSFilter]
$sel:filters:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [EBSFilter]
filters} -> Maybe [EBSFilter]
filters) (\s :: ExportEBSVolumeRecommendations
s@ExportEBSVolumeRecommendations' {} Maybe [EBSFilter]
a -> ExportEBSVolumeRecommendations
s {$sel:filters:ExportEBSVolumeRecommendations' :: Maybe [EBSFilter]
filters = Maybe [EBSFilter]
a} :: ExportEBSVolumeRecommendations) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether to include recommendations for resources in all member
-- accounts of the organization if your account is the management account
-- of an organization.
--
-- The member accounts must also be opted in to Compute Optimizer, and
-- trusted access for Compute Optimizer must be enabled in the organization
-- account. For more information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html#trusted-service-access Compute Optimizer and Amazon Web Services Organizations trusted access>
-- in the /Compute Optimizer User Guide/.
--
-- Recommendations for member accounts of the organization are not included
-- in the export file if this parameter is omitted.
--
-- This parameter cannot be specified together with the account IDs
-- parameter. The parameters are mutually exclusive.
--
-- Recommendations for member accounts are not included in the export if
-- this parameter, or the account IDs parameter, is omitted.
exportEBSVolumeRecommendations_includeMemberAccounts :: Lens.Lens' ExportEBSVolumeRecommendations (Prelude.Maybe Prelude.Bool)
exportEBSVolumeRecommendations_includeMemberAccounts :: Lens' ExportEBSVolumeRecommendations (Maybe Bool)
exportEBSVolumeRecommendations_includeMemberAccounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendations' {Maybe Bool
includeMemberAccounts :: Maybe Bool
$sel:includeMemberAccounts:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe Bool
includeMemberAccounts} -> Maybe Bool
includeMemberAccounts) (\s :: ExportEBSVolumeRecommendations
s@ExportEBSVolumeRecommendations' {} Maybe Bool
a -> ExportEBSVolumeRecommendations
s {$sel:includeMemberAccounts:ExportEBSVolumeRecommendations' :: Maybe Bool
includeMemberAccounts = Maybe Bool
a} :: ExportEBSVolumeRecommendations)

-- | Undocumented member.
exportEBSVolumeRecommendations_s3DestinationConfig :: Lens.Lens' ExportEBSVolumeRecommendations S3DestinationConfig
exportEBSVolumeRecommendations_s3DestinationConfig :: Lens' ExportEBSVolumeRecommendations S3DestinationConfig
exportEBSVolumeRecommendations_s3DestinationConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendations' {S3DestinationConfig
s3DestinationConfig :: S3DestinationConfig
$sel:s3DestinationConfig:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> S3DestinationConfig
s3DestinationConfig} -> S3DestinationConfig
s3DestinationConfig) (\s :: ExportEBSVolumeRecommendations
s@ExportEBSVolumeRecommendations' {} S3DestinationConfig
a -> ExportEBSVolumeRecommendations
s {$sel:s3DestinationConfig:ExportEBSVolumeRecommendations' :: S3DestinationConfig
s3DestinationConfig = S3DestinationConfig
a} :: ExportEBSVolumeRecommendations)

instance
  Core.AWSRequest
    ExportEBSVolumeRecommendations
  where
  type
    AWSResponse ExportEBSVolumeRecommendations =
      ExportEBSVolumeRecommendationsResponse
  request :: (Service -> Service)
-> ExportEBSVolumeRecommendations
-> Request ExportEBSVolumeRecommendations
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ExportEBSVolumeRecommendations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ExportEBSVolumeRecommendations)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe S3Destination
-> Int
-> ExportEBSVolumeRecommendationsResponse
ExportEBSVolumeRecommendationsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"jobId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"s3Destination")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ExportEBSVolumeRecommendations
  where
  hashWithSalt :: Int -> ExportEBSVolumeRecommendations -> Int
hashWithSalt
    Int
_salt
    ExportEBSVolumeRecommendations' {Maybe Bool
Maybe [Text]
Maybe [EBSFilter]
Maybe [ExportableVolumeField]
Maybe FileFormat
S3DestinationConfig
s3DestinationConfig :: S3DestinationConfig
includeMemberAccounts :: Maybe Bool
filters :: Maybe [EBSFilter]
fileFormat :: Maybe FileFormat
fieldsToExport :: Maybe [ExportableVolumeField]
accountIds :: Maybe [Text]
$sel:s3DestinationConfig:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> S3DestinationConfig
$sel:includeMemberAccounts:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe Bool
$sel:filters:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [EBSFilter]
$sel:fileFormat:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe FileFormat
$sel:fieldsToExport:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [ExportableVolumeField]
$sel:accountIds:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
accountIds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ExportableVolumeField]
fieldsToExport
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FileFormat
fileFormat
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EBSFilter]
filters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeMemberAccounts
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3DestinationConfig
s3DestinationConfig

instance
  Prelude.NFData
    ExportEBSVolumeRecommendations
  where
  rnf :: ExportEBSVolumeRecommendations -> ()
rnf ExportEBSVolumeRecommendations' {Maybe Bool
Maybe [Text]
Maybe [EBSFilter]
Maybe [ExportableVolumeField]
Maybe FileFormat
S3DestinationConfig
s3DestinationConfig :: S3DestinationConfig
includeMemberAccounts :: Maybe Bool
filters :: Maybe [EBSFilter]
fileFormat :: Maybe FileFormat
fieldsToExport :: Maybe [ExportableVolumeField]
accountIds :: Maybe [Text]
$sel:s3DestinationConfig:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> S3DestinationConfig
$sel:includeMemberAccounts:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe Bool
$sel:filters:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [EBSFilter]
$sel:fileFormat:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe FileFormat
$sel:fieldsToExport:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [ExportableVolumeField]
$sel:accountIds:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
accountIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ExportableVolumeField]
fieldsToExport
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FileFormat
fileFormat
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EBSFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeMemberAccounts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf S3DestinationConfig
s3DestinationConfig

instance
  Data.ToHeaders
    ExportEBSVolumeRecommendations
  where
  toHeaders :: ExportEBSVolumeRecommendations -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"ComputeOptimizerService.ExportEBSVolumeRecommendations" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ExportEBSVolumeRecommendations where
  toJSON :: ExportEBSVolumeRecommendations -> Value
toJSON ExportEBSVolumeRecommendations' {Maybe Bool
Maybe [Text]
Maybe [EBSFilter]
Maybe [ExportableVolumeField]
Maybe FileFormat
S3DestinationConfig
s3DestinationConfig :: S3DestinationConfig
includeMemberAccounts :: Maybe Bool
filters :: Maybe [EBSFilter]
fileFormat :: Maybe FileFormat
fieldsToExport :: Maybe [ExportableVolumeField]
accountIds :: Maybe [Text]
$sel:s3DestinationConfig:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> S3DestinationConfig
$sel:includeMemberAccounts:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe Bool
$sel:filters:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [EBSFilter]
$sel:fileFormat:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe FileFormat
$sel:fieldsToExport:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [ExportableVolumeField]
$sel:accountIds:ExportEBSVolumeRecommendations' :: ExportEBSVolumeRecommendations -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"accountIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
accountIds,
            (Key
"fieldsToExport" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ExportableVolumeField]
fieldsToExport,
            (Key
"fileFormat" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FileFormat
fileFormat,
            (Key
"filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EBSFilter]
filters,
            (Key
"includeMemberAccounts" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeMemberAccounts,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"s3DestinationConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3DestinationConfig
s3DestinationConfig)
          ]
      )

instance Data.ToPath ExportEBSVolumeRecommendations where
  toPath :: ExportEBSVolumeRecommendations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ExportEBSVolumeRecommendations where
  toQuery :: ExportEBSVolumeRecommendations -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newExportEBSVolumeRecommendationsResponse' smart constructor.
data ExportEBSVolumeRecommendationsResponse = ExportEBSVolumeRecommendationsResponse'
  { -- | The identification number of the export job.
    --
    -- Use the DescribeRecommendationExportJobs action, and specify the job ID
    -- to view the status of an export job.
    ExportEBSVolumeRecommendationsResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    ExportEBSVolumeRecommendationsResponse -> Maybe S3Destination
s3Destination :: Prelude.Maybe S3Destination,
    -- | The response's http status code.
    ExportEBSVolumeRecommendationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ExportEBSVolumeRecommendationsResponse
-> ExportEBSVolumeRecommendationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportEBSVolumeRecommendationsResponse
-> ExportEBSVolumeRecommendationsResponse -> Bool
$c/= :: ExportEBSVolumeRecommendationsResponse
-> ExportEBSVolumeRecommendationsResponse -> Bool
== :: ExportEBSVolumeRecommendationsResponse
-> ExportEBSVolumeRecommendationsResponse -> Bool
$c== :: ExportEBSVolumeRecommendationsResponse
-> ExportEBSVolumeRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [ExportEBSVolumeRecommendationsResponse]
ReadPrec ExportEBSVolumeRecommendationsResponse
Int -> ReadS ExportEBSVolumeRecommendationsResponse
ReadS [ExportEBSVolumeRecommendationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportEBSVolumeRecommendationsResponse]
$creadListPrec :: ReadPrec [ExportEBSVolumeRecommendationsResponse]
readPrec :: ReadPrec ExportEBSVolumeRecommendationsResponse
$creadPrec :: ReadPrec ExportEBSVolumeRecommendationsResponse
readList :: ReadS [ExportEBSVolumeRecommendationsResponse]
$creadList :: ReadS [ExportEBSVolumeRecommendationsResponse]
readsPrec :: Int -> ReadS ExportEBSVolumeRecommendationsResponse
$creadsPrec :: Int -> ReadS ExportEBSVolumeRecommendationsResponse
Prelude.Read, Int -> ExportEBSVolumeRecommendationsResponse -> ShowS
[ExportEBSVolumeRecommendationsResponse] -> ShowS
ExportEBSVolumeRecommendationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportEBSVolumeRecommendationsResponse] -> ShowS
$cshowList :: [ExportEBSVolumeRecommendationsResponse] -> ShowS
show :: ExportEBSVolumeRecommendationsResponse -> String
$cshow :: ExportEBSVolumeRecommendationsResponse -> String
showsPrec :: Int -> ExportEBSVolumeRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> ExportEBSVolumeRecommendationsResponse -> ShowS
Prelude.Show, forall x.
Rep ExportEBSVolumeRecommendationsResponse x
-> ExportEBSVolumeRecommendationsResponse
forall x.
ExportEBSVolumeRecommendationsResponse
-> Rep ExportEBSVolumeRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportEBSVolumeRecommendationsResponse x
-> ExportEBSVolumeRecommendationsResponse
$cfrom :: forall x.
ExportEBSVolumeRecommendationsResponse
-> Rep ExportEBSVolumeRecommendationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ExportEBSVolumeRecommendationsResponse' 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:
--
-- 'jobId', 'exportEBSVolumeRecommendationsResponse_jobId' - The identification number of the export job.
--
-- Use the DescribeRecommendationExportJobs action, and specify the job ID
-- to view the status of an export job.
--
-- 's3Destination', 'exportEBSVolumeRecommendationsResponse_s3Destination' - Undocumented member.
--
-- 'httpStatus', 'exportEBSVolumeRecommendationsResponse_httpStatus' - The response's http status code.
newExportEBSVolumeRecommendationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ExportEBSVolumeRecommendationsResponse
newExportEBSVolumeRecommendationsResponse :: Int -> ExportEBSVolumeRecommendationsResponse
newExportEBSVolumeRecommendationsResponse
  Int
pHttpStatus_ =
    ExportEBSVolumeRecommendationsResponse'
      { $sel:jobId:ExportEBSVolumeRecommendationsResponse' :: Maybe Text
jobId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:s3Destination:ExportEBSVolumeRecommendationsResponse' :: Maybe S3Destination
s3Destination = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ExportEBSVolumeRecommendationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The identification number of the export job.
--
-- Use the DescribeRecommendationExportJobs action, and specify the job ID
-- to view the status of an export job.
exportEBSVolumeRecommendationsResponse_jobId :: Lens.Lens' ExportEBSVolumeRecommendationsResponse (Prelude.Maybe Prelude.Text)
exportEBSVolumeRecommendationsResponse_jobId :: Lens' ExportEBSVolumeRecommendationsResponse (Maybe Text)
exportEBSVolumeRecommendationsResponse_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendationsResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:ExportEBSVolumeRecommendationsResponse' :: ExportEBSVolumeRecommendationsResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: ExportEBSVolumeRecommendationsResponse
s@ExportEBSVolumeRecommendationsResponse' {} Maybe Text
a -> ExportEBSVolumeRecommendationsResponse
s {$sel:jobId:ExportEBSVolumeRecommendationsResponse' :: Maybe Text
jobId = Maybe Text
a} :: ExportEBSVolumeRecommendationsResponse)

-- | Undocumented member.
exportEBSVolumeRecommendationsResponse_s3Destination :: Lens.Lens' ExportEBSVolumeRecommendationsResponse (Prelude.Maybe S3Destination)
exportEBSVolumeRecommendationsResponse_s3Destination :: Lens' ExportEBSVolumeRecommendationsResponse (Maybe S3Destination)
exportEBSVolumeRecommendationsResponse_s3Destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendationsResponse' {Maybe S3Destination
s3Destination :: Maybe S3Destination
$sel:s3Destination:ExportEBSVolumeRecommendationsResponse' :: ExportEBSVolumeRecommendationsResponse -> Maybe S3Destination
s3Destination} -> Maybe S3Destination
s3Destination) (\s :: ExportEBSVolumeRecommendationsResponse
s@ExportEBSVolumeRecommendationsResponse' {} Maybe S3Destination
a -> ExportEBSVolumeRecommendationsResponse
s {$sel:s3Destination:ExportEBSVolumeRecommendationsResponse' :: Maybe S3Destination
s3Destination = Maybe S3Destination
a} :: ExportEBSVolumeRecommendationsResponse)

-- | The response's http status code.
exportEBSVolumeRecommendationsResponse_httpStatus :: Lens.Lens' ExportEBSVolumeRecommendationsResponse Prelude.Int
exportEBSVolumeRecommendationsResponse_httpStatus :: Lens' ExportEBSVolumeRecommendationsResponse Int
exportEBSVolumeRecommendationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEBSVolumeRecommendationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ExportEBSVolumeRecommendationsResponse' :: ExportEBSVolumeRecommendationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ExportEBSVolumeRecommendationsResponse
s@ExportEBSVolumeRecommendationsResponse' {} Int
a -> ExportEBSVolumeRecommendationsResponse
s {$sel:httpStatus:ExportEBSVolumeRecommendationsResponse' :: Int
httpStatus = Int
a} :: ExportEBSVolumeRecommendationsResponse)

instance
  Prelude.NFData
    ExportEBSVolumeRecommendationsResponse
  where
  rnf :: ExportEBSVolumeRecommendationsResponse -> ()
rnf ExportEBSVolumeRecommendationsResponse' {Int
Maybe Text
Maybe S3Destination
httpStatus :: Int
s3Destination :: Maybe S3Destination
jobId :: Maybe Text
$sel:httpStatus:ExportEBSVolumeRecommendationsResponse' :: ExportEBSVolumeRecommendationsResponse -> Int
$sel:s3Destination:ExportEBSVolumeRecommendationsResponse' :: ExportEBSVolumeRecommendationsResponse -> Maybe S3Destination
$sel:jobId:ExportEBSVolumeRecommendationsResponse' :: ExportEBSVolumeRecommendationsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Destination
s3Destination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus