{-# 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.ExportEC2InstanceRecommendations
-- 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)
--
-- Exports optimization recommendations for Amazon EC2 instances.
--
-- 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 EC2 instance export job in progress per
-- Amazon Web Services Region.
module Amazonka.ComputeOptimizer.ExportEC2InstanceRecommendations
  ( -- * Creating a Request
    ExportEC2InstanceRecommendations (..),
    newExportEC2InstanceRecommendations,

    -- * Request Lenses
    exportEC2InstanceRecommendations_accountIds,
    exportEC2InstanceRecommendations_fileFormat,
    exportEC2InstanceRecommendations_filters,
    exportEC2InstanceRecommendations_fieldsToExport,
    exportEC2InstanceRecommendations_includeMemberAccounts,
    exportEC2InstanceRecommendations_recommendationPreferences,
    exportEC2InstanceRecommendations_s3DestinationConfig,

    -- * Destructuring the Response
    ExportEC2InstanceRecommendationsResponse (..),
    newExportEC2InstanceRecommendationsResponse,

    -- * Response Lenses
    exportEC2InstanceRecommendationsResponse_jobId,
    exportEC2InstanceRecommendationsResponse_s3Destination,
    exportEC2InstanceRecommendationsResponse_httpStatus,
  )
where

import Amazonka.ComputeOptimizer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newExportEC2InstanceRecommendations' smart constructor.
data ExportEC2InstanceRecommendations = ExportEC2InstanceRecommendations'
  { -- | The IDs of the Amazon Web Services accounts for which to export instance
    -- 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.
    ExportEC2InstanceRecommendations -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
    -- | The format of the export file.
    --
    -- The only export file format currently supported is @Csv@.
    ExportEC2InstanceRecommendations -> Maybe FileFormat
fileFormat :: Prelude.Maybe FileFormat,
    -- | An array of objects to specify a filter that exports a more specific set
    -- of instance recommendations.
    ExportEC2InstanceRecommendations -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | 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/.
    ExportEC2InstanceRecommendations -> Maybe [ExportableInstanceField]
fieldsToExport :: Prelude.Maybe [ExportableInstanceField],
    -- | 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.
    --
    -- Recommendations for member accounts are not included in the export if
    -- this parameter, or the account IDs parameter, is omitted.
    ExportEC2InstanceRecommendations -> Maybe Bool
includeMemberAccounts :: Prelude.Maybe Prelude.Bool,
    -- | An object to specify the preferences for the Amazon EC2 instance
    -- recommendations to export.
    ExportEC2InstanceRecommendations -> Maybe RecommendationPreferences
recommendationPreferences :: Prelude.Maybe RecommendationPreferences,
    -- | An object to specify the destination Amazon Simple Storage Service
    -- (Amazon S3) bucket name and key prefix for the export job.
    --
    -- You must create the destination Amazon S3 bucket for your
    -- recommendations export before you create the export job. Compute
    -- Optimizer does not create the S3 bucket for you. After you create the S3
    -- bucket, ensure that it has the required permissions policy policy to
    -- allow Compute Optimizer to write the export file to it. If you plan to
    -- specify an object prefix when you create the export job, you must
    -- include the object prefix in the that you add to the S3 bucket. For more
    -- information, see
    -- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html Amazon S3 Bucket Policy for Compute Optimizer>
    -- in the /Compute Optimizer User Guide/.
    ExportEC2InstanceRecommendations -> S3DestinationConfig
s3DestinationConfig :: S3DestinationConfig
  }
  deriving (ExportEC2InstanceRecommendations
-> ExportEC2InstanceRecommendations -> Bool
(ExportEC2InstanceRecommendations
 -> ExportEC2InstanceRecommendations -> Bool)
-> (ExportEC2InstanceRecommendations
    -> ExportEC2InstanceRecommendations -> Bool)
-> Eq ExportEC2InstanceRecommendations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportEC2InstanceRecommendations
-> ExportEC2InstanceRecommendations -> Bool
$c/= :: ExportEC2InstanceRecommendations
-> ExportEC2InstanceRecommendations -> Bool
== :: ExportEC2InstanceRecommendations
-> ExportEC2InstanceRecommendations -> Bool
$c== :: ExportEC2InstanceRecommendations
-> ExportEC2InstanceRecommendations -> Bool
Prelude.Eq, ReadPrec [ExportEC2InstanceRecommendations]
ReadPrec ExportEC2InstanceRecommendations
Int -> ReadS ExportEC2InstanceRecommendations
ReadS [ExportEC2InstanceRecommendations]
(Int -> ReadS ExportEC2InstanceRecommendations)
-> ReadS [ExportEC2InstanceRecommendations]
-> ReadPrec ExportEC2InstanceRecommendations
-> ReadPrec [ExportEC2InstanceRecommendations]
-> Read ExportEC2InstanceRecommendations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportEC2InstanceRecommendations]
$creadListPrec :: ReadPrec [ExportEC2InstanceRecommendations]
readPrec :: ReadPrec ExportEC2InstanceRecommendations
$creadPrec :: ReadPrec ExportEC2InstanceRecommendations
readList :: ReadS [ExportEC2InstanceRecommendations]
$creadList :: ReadS [ExportEC2InstanceRecommendations]
readsPrec :: Int -> ReadS ExportEC2InstanceRecommendations
$creadsPrec :: Int -> ReadS ExportEC2InstanceRecommendations
Prelude.Read, Int -> ExportEC2InstanceRecommendations -> ShowS
[ExportEC2InstanceRecommendations] -> ShowS
ExportEC2InstanceRecommendations -> String
(Int -> ExportEC2InstanceRecommendations -> ShowS)
-> (ExportEC2InstanceRecommendations -> String)
-> ([ExportEC2InstanceRecommendations] -> ShowS)
-> Show ExportEC2InstanceRecommendations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportEC2InstanceRecommendations] -> ShowS
$cshowList :: [ExportEC2InstanceRecommendations] -> ShowS
show :: ExportEC2InstanceRecommendations -> String
$cshow :: ExportEC2InstanceRecommendations -> String
showsPrec :: Int -> ExportEC2InstanceRecommendations -> ShowS
$cshowsPrec :: Int -> ExportEC2InstanceRecommendations -> ShowS
Prelude.Show, (forall x.
 ExportEC2InstanceRecommendations
 -> Rep ExportEC2InstanceRecommendations x)
-> (forall x.
    Rep ExportEC2InstanceRecommendations x
    -> ExportEC2InstanceRecommendations)
-> Generic ExportEC2InstanceRecommendations
forall x.
Rep ExportEC2InstanceRecommendations x
-> ExportEC2InstanceRecommendations
forall x.
ExportEC2InstanceRecommendations
-> Rep ExportEC2InstanceRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportEC2InstanceRecommendations x
-> ExportEC2InstanceRecommendations
$cfrom :: forall x.
ExportEC2InstanceRecommendations
-> Rep ExportEC2InstanceRecommendations x
Prelude.Generic)

-- |
-- Create a value of 'ExportEC2InstanceRecommendations' 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', 'exportEC2InstanceRecommendations_accountIds' - The IDs of the Amazon Web Services accounts for which to export instance
-- 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.
--
-- 'fileFormat', 'exportEC2InstanceRecommendations_fileFormat' - The format of the export file.
--
-- The only export file format currently supported is @Csv@.
--
-- 'filters', 'exportEC2InstanceRecommendations_filters' - An array of objects to specify a filter that exports a more specific set
-- of instance recommendations.
--
-- 'fieldsToExport', 'exportEC2InstanceRecommendations_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/.
--
-- 'includeMemberAccounts', 'exportEC2InstanceRecommendations_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.
--
-- Recommendations for member accounts are not included in the export if
-- this parameter, or the account IDs parameter, is omitted.
--
-- 'recommendationPreferences', 'exportEC2InstanceRecommendations_recommendationPreferences' - An object to specify the preferences for the Amazon EC2 instance
-- recommendations to export.
--
-- 's3DestinationConfig', 'exportEC2InstanceRecommendations_s3DestinationConfig' - An object to specify the destination Amazon Simple Storage Service
-- (Amazon S3) bucket name and key prefix for the export job.
--
-- You must create the destination Amazon S3 bucket for your
-- recommendations export before you create the export job. Compute
-- Optimizer does not create the S3 bucket for you. After you create the S3
-- bucket, ensure that it has the required permissions policy policy to
-- allow Compute Optimizer to write the export file to it. If you plan to
-- specify an object prefix when you create the export job, you must
-- include the object prefix in the that you add to the S3 bucket. For more
-- information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html Amazon S3 Bucket Policy for Compute Optimizer>
-- in the /Compute Optimizer User Guide/.
newExportEC2InstanceRecommendations ::
  -- | 's3DestinationConfig'
  S3DestinationConfig ->
  ExportEC2InstanceRecommendations
newExportEC2InstanceRecommendations :: S3DestinationConfig -> ExportEC2InstanceRecommendations
newExportEC2InstanceRecommendations
  S3DestinationConfig
pS3DestinationConfig_ =
    ExportEC2InstanceRecommendations' :: Maybe [Text]
-> Maybe FileFormat
-> Maybe [Filter]
-> Maybe [ExportableInstanceField]
-> Maybe Bool
-> Maybe RecommendationPreferences
-> S3DestinationConfig
-> ExportEC2InstanceRecommendations
ExportEC2InstanceRecommendations'
      { $sel:accountIds:ExportEC2InstanceRecommendations' :: Maybe [Text]
accountIds =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:fileFormat:ExportEC2InstanceRecommendations' :: Maybe FileFormat
fileFormat = Maybe FileFormat
forall a. Maybe a
Prelude.Nothing,
        $sel:filters:ExportEC2InstanceRecommendations' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
        $sel:fieldsToExport:ExportEC2InstanceRecommendations' :: Maybe [ExportableInstanceField]
fieldsToExport = Maybe [ExportableInstanceField]
forall a. Maybe a
Prelude.Nothing,
        $sel:includeMemberAccounts:ExportEC2InstanceRecommendations' :: Maybe Bool
includeMemberAccounts = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationPreferences:ExportEC2InstanceRecommendations' :: Maybe RecommendationPreferences
recommendationPreferences =
          Maybe RecommendationPreferences
forall a. Maybe a
Prelude.Nothing,
        $sel:s3DestinationConfig:ExportEC2InstanceRecommendations' :: S3DestinationConfig
s3DestinationConfig =
          S3DestinationConfig
pS3DestinationConfig_
      }

-- | The IDs of the Amazon Web Services accounts for which to export instance
-- 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.
exportEC2InstanceRecommendations_accountIds :: Lens.Lens' ExportEC2InstanceRecommendations (Prelude.Maybe [Prelude.Text])
exportEC2InstanceRecommendations_accountIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
exportEC2InstanceRecommendations_accountIds = (ExportEC2InstanceRecommendations -> Maybe [Text])
-> (ExportEC2InstanceRecommendations
    -> Maybe [Text] -> ExportEC2InstanceRecommendations)
-> Lens
     ExportEC2InstanceRecommendations
     ExportEC2InstanceRecommendations
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendations' {Maybe [Text]
accountIds :: Maybe [Text]
$sel:accountIds:ExportEC2InstanceRecommendations' :: ExportEC2InstanceRecommendations -> Maybe [Text]
accountIds} -> Maybe [Text]
accountIds) (\s :: ExportEC2InstanceRecommendations
s@ExportEC2InstanceRecommendations' {} Maybe [Text]
a -> ExportEC2InstanceRecommendations
s {$sel:accountIds:ExportEC2InstanceRecommendations' :: Maybe [Text]
accountIds = Maybe [Text]
a} :: ExportEC2InstanceRecommendations) ((Maybe [Text] -> f (Maybe [Text]))
 -> ExportEC2InstanceRecommendations
 -> f ExportEC2InstanceRecommendations)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
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@.
exportEC2InstanceRecommendations_fileFormat :: Lens.Lens' ExportEC2InstanceRecommendations (Prelude.Maybe FileFormat)
exportEC2InstanceRecommendations_fileFormat :: (Maybe FileFormat -> f (Maybe FileFormat))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
exportEC2InstanceRecommendations_fileFormat = (ExportEC2InstanceRecommendations -> Maybe FileFormat)
-> (ExportEC2InstanceRecommendations
    -> Maybe FileFormat -> ExportEC2InstanceRecommendations)
-> Lens
     ExportEC2InstanceRecommendations
     ExportEC2InstanceRecommendations
     (Maybe FileFormat)
     (Maybe FileFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendations' {Maybe FileFormat
fileFormat :: Maybe FileFormat
$sel:fileFormat:ExportEC2InstanceRecommendations' :: ExportEC2InstanceRecommendations -> Maybe FileFormat
fileFormat} -> Maybe FileFormat
fileFormat) (\s :: ExportEC2InstanceRecommendations
s@ExportEC2InstanceRecommendations' {} Maybe FileFormat
a -> ExportEC2InstanceRecommendations
s {$sel:fileFormat:ExportEC2InstanceRecommendations' :: Maybe FileFormat
fileFormat = Maybe FileFormat
a} :: ExportEC2InstanceRecommendations)

-- | An array of objects to specify a filter that exports a more specific set
-- of instance recommendations.
exportEC2InstanceRecommendations_filters :: Lens.Lens' ExportEC2InstanceRecommendations (Prelude.Maybe [Filter])
exportEC2InstanceRecommendations_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
exportEC2InstanceRecommendations_filters = (ExportEC2InstanceRecommendations -> Maybe [Filter])
-> (ExportEC2InstanceRecommendations
    -> Maybe [Filter] -> ExportEC2InstanceRecommendations)
-> Lens
     ExportEC2InstanceRecommendations
     ExportEC2InstanceRecommendations
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendations' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ExportEC2InstanceRecommendations' :: ExportEC2InstanceRecommendations -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ExportEC2InstanceRecommendations
s@ExportEC2InstanceRecommendations' {} Maybe [Filter]
a -> ExportEC2InstanceRecommendations
s {$sel:filters:ExportEC2InstanceRecommendations' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ExportEC2InstanceRecommendations) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> ExportEC2InstanceRecommendations
 -> f ExportEC2InstanceRecommendations)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 AnIso [Filter] [Filter] [Filter] [Filter]
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/.
exportEC2InstanceRecommendations_fieldsToExport :: Lens.Lens' ExportEC2InstanceRecommendations (Prelude.Maybe [ExportableInstanceField])
exportEC2InstanceRecommendations_fieldsToExport :: (Maybe [ExportableInstanceField]
 -> f (Maybe [ExportableInstanceField]))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
exportEC2InstanceRecommendations_fieldsToExport = (ExportEC2InstanceRecommendations
 -> Maybe [ExportableInstanceField])
-> (ExportEC2InstanceRecommendations
    -> Maybe [ExportableInstanceField]
    -> ExportEC2InstanceRecommendations)
-> Lens
     ExportEC2InstanceRecommendations
     ExportEC2InstanceRecommendations
     (Maybe [ExportableInstanceField])
     (Maybe [ExportableInstanceField])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendations' {Maybe [ExportableInstanceField]
fieldsToExport :: Maybe [ExportableInstanceField]
$sel:fieldsToExport:ExportEC2InstanceRecommendations' :: ExportEC2InstanceRecommendations -> Maybe [ExportableInstanceField]
fieldsToExport} -> Maybe [ExportableInstanceField]
fieldsToExport) (\s :: ExportEC2InstanceRecommendations
s@ExportEC2InstanceRecommendations' {} Maybe [ExportableInstanceField]
a -> ExportEC2InstanceRecommendations
s {$sel:fieldsToExport:ExportEC2InstanceRecommendations' :: Maybe [ExportableInstanceField]
fieldsToExport = Maybe [ExportableInstanceField]
a} :: ExportEC2InstanceRecommendations) ((Maybe [ExportableInstanceField]
  -> f (Maybe [ExportableInstanceField]))
 -> ExportEC2InstanceRecommendations
 -> f ExportEC2InstanceRecommendations)
-> ((Maybe [ExportableInstanceField]
     -> f (Maybe [ExportableInstanceField]))
    -> Maybe [ExportableInstanceField]
    -> f (Maybe [ExportableInstanceField]))
-> (Maybe [ExportableInstanceField]
    -> f (Maybe [ExportableInstanceField]))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ExportableInstanceField]
  [ExportableInstanceField]
  [ExportableInstanceField]
  [ExportableInstanceField]
-> Iso
     (Maybe [ExportableInstanceField])
     (Maybe [ExportableInstanceField])
     (Maybe [ExportableInstanceField])
     (Maybe [ExportableInstanceField])
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 AnIso
  [ExportableInstanceField]
  [ExportableInstanceField]
  [ExportableInstanceField]
  [ExportableInstanceField]
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.
--
-- Recommendations for member accounts are not included in the export if
-- this parameter, or the account IDs parameter, is omitted.
exportEC2InstanceRecommendations_includeMemberAccounts :: Lens.Lens' ExportEC2InstanceRecommendations (Prelude.Maybe Prelude.Bool)
exportEC2InstanceRecommendations_includeMemberAccounts :: (Maybe Bool -> f (Maybe Bool))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
exportEC2InstanceRecommendations_includeMemberAccounts = (ExportEC2InstanceRecommendations -> Maybe Bool)
-> (ExportEC2InstanceRecommendations
    -> Maybe Bool -> ExportEC2InstanceRecommendations)
-> Lens
     ExportEC2InstanceRecommendations
     ExportEC2InstanceRecommendations
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendations' {Maybe Bool
includeMemberAccounts :: Maybe Bool
$sel:includeMemberAccounts:ExportEC2InstanceRecommendations' :: ExportEC2InstanceRecommendations -> Maybe Bool
includeMemberAccounts} -> Maybe Bool
includeMemberAccounts) (\s :: ExportEC2InstanceRecommendations
s@ExportEC2InstanceRecommendations' {} Maybe Bool
a -> ExportEC2InstanceRecommendations
s {$sel:includeMemberAccounts:ExportEC2InstanceRecommendations' :: Maybe Bool
includeMemberAccounts = Maybe Bool
a} :: ExportEC2InstanceRecommendations)

-- | An object to specify the preferences for the Amazon EC2 instance
-- recommendations to export.
exportEC2InstanceRecommendations_recommendationPreferences :: Lens.Lens' ExportEC2InstanceRecommendations (Prelude.Maybe RecommendationPreferences)
exportEC2InstanceRecommendations_recommendationPreferences :: (Maybe RecommendationPreferences
 -> f (Maybe RecommendationPreferences))
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
exportEC2InstanceRecommendations_recommendationPreferences = (ExportEC2InstanceRecommendations
 -> Maybe RecommendationPreferences)
-> (ExportEC2InstanceRecommendations
    -> Maybe RecommendationPreferences
    -> ExportEC2InstanceRecommendations)
-> Lens
     ExportEC2InstanceRecommendations
     ExportEC2InstanceRecommendations
     (Maybe RecommendationPreferences)
     (Maybe RecommendationPreferences)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendations' {Maybe RecommendationPreferences
recommendationPreferences :: Maybe RecommendationPreferences
$sel:recommendationPreferences:ExportEC2InstanceRecommendations' :: ExportEC2InstanceRecommendations -> Maybe RecommendationPreferences
recommendationPreferences} -> Maybe RecommendationPreferences
recommendationPreferences) (\s :: ExportEC2InstanceRecommendations
s@ExportEC2InstanceRecommendations' {} Maybe RecommendationPreferences
a -> ExportEC2InstanceRecommendations
s {$sel:recommendationPreferences:ExportEC2InstanceRecommendations' :: Maybe RecommendationPreferences
recommendationPreferences = Maybe RecommendationPreferences
a} :: ExportEC2InstanceRecommendations)

-- | An object to specify the destination Amazon Simple Storage Service
-- (Amazon S3) bucket name and key prefix for the export job.
--
-- You must create the destination Amazon S3 bucket for your
-- recommendations export before you create the export job. Compute
-- Optimizer does not create the S3 bucket for you. After you create the S3
-- bucket, ensure that it has the required permissions policy policy to
-- allow Compute Optimizer to write the export file to it. If you plan to
-- specify an object prefix when you create the export job, you must
-- include the object prefix in the that you add to the S3 bucket. For more
-- information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html Amazon S3 Bucket Policy for Compute Optimizer>
-- in the /Compute Optimizer User Guide/.
exportEC2InstanceRecommendations_s3DestinationConfig :: Lens.Lens' ExportEC2InstanceRecommendations S3DestinationConfig
exportEC2InstanceRecommendations_s3DestinationConfig :: (S3DestinationConfig -> f S3DestinationConfig)
-> ExportEC2InstanceRecommendations
-> f ExportEC2InstanceRecommendations
exportEC2InstanceRecommendations_s3DestinationConfig = (ExportEC2InstanceRecommendations -> S3DestinationConfig)
-> (ExportEC2InstanceRecommendations
    -> S3DestinationConfig -> ExportEC2InstanceRecommendations)
-> Lens
     ExportEC2InstanceRecommendations
     ExportEC2InstanceRecommendations
     S3DestinationConfig
     S3DestinationConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendations' {S3DestinationConfig
s3DestinationConfig :: S3DestinationConfig
$sel:s3DestinationConfig:ExportEC2InstanceRecommendations' :: ExportEC2InstanceRecommendations -> S3DestinationConfig
s3DestinationConfig} -> S3DestinationConfig
s3DestinationConfig) (\s :: ExportEC2InstanceRecommendations
s@ExportEC2InstanceRecommendations' {} S3DestinationConfig
a -> ExportEC2InstanceRecommendations
s {$sel:s3DestinationConfig:ExportEC2InstanceRecommendations' :: S3DestinationConfig
s3DestinationConfig = S3DestinationConfig
a} :: ExportEC2InstanceRecommendations)

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

instance
  Prelude.Hashable
    ExportEC2InstanceRecommendations

instance
  Prelude.NFData
    ExportEC2InstanceRecommendations

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

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

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

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

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

-- |
-- Create a value of 'ExportEC2InstanceRecommendationsResponse' 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', 'exportEC2InstanceRecommendationsResponse_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', 'exportEC2InstanceRecommendationsResponse_s3Destination' - An object that describes the destination Amazon S3 bucket of a
-- recommendations export file.
--
-- 'httpStatus', 'exportEC2InstanceRecommendationsResponse_httpStatus' - The response's http status code.
newExportEC2InstanceRecommendationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ExportEC2InstanceRecommendationsResponse
newExportEC2InstanceRecommendationsResponse :: Int -> ExportEC2InstanceRecommendationsResponse
newExportEC2InstanceRecommendationsResponse
  Int
pHttpStatus_ =
    ExportEC2InstanceRecommendationsResponse' :: Maybe Text
-> Maybe S3Destination
-> Int
-> ExportEC2InstanceRecommendationsResponse
ExportEC2InstanceRecommendationsResponse'
      { $sel:jobId:ExportEC2InstanceRecommendationsResponse' :: Maybe Text
jobId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:s3Destination:ExportEC2InstanceRecommendationsResponse' :: Maybe S3Destination
s3Destination = Maybe S3Destination
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ExportEC2InstanceRecommendationsResponse' :: 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.
exportEC2InstanceRecommendationsResponse_jobId :: Lens.Lens' ExportEC2InstanceRecommendationsResponse (Prelude.Maybe Prelude.Text)
exportEC2InstanceRecommendationsResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> ExportEC2InstanceRecommendationsResponse
-> f ExportEC2InstanceRecommendationsResponse
exportEC2InstanceRecommendationsResponse_jobId = (ExportEC2InstanceRecommendationsResponse -> Maybe Text)
-> (ExportEC2InstanceRecommendationsResponse
    -> Maybe Text -> ExportEC2InstanceRecommendationsResponse)
-> Lens
     ExportEC2InstanceRecommendationsResponse
     ExportEC2InstanceRecommendationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendationsResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:ExportEC2InstanceRecommendationsResponse' :: ExportEC2InstanceRecommendationsResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: ExportEC2InstanceRecommendationsResponse
s@ExportEC2InstanceRecommendationsResponse' {} Maybe Text
a -> ExportEC2InstanceRecommendationsResponse
s {$sel:jobId:ExportEC2InstanceRecommendationsResponse' :: Maybe Text
jobId = Maybe Text
a} :: ExportEC2InstanceRecommendationsResponse)

-- | An object that describes the destination Amazon S3 bucket of a
-- recommendations export file.
exportEC2InstanceRecommendationsResponse_s3Destination :: Lens.Lens' ExportEC2InstanceRecommendationsResponse (Prelude.Maybe S3Destination)
exportEC2InstanceRecommendationsResponse_s3Destination :: (Maybe S3Destination -> f (Maybe S3Destination))
-> ExportEC2InstanceRecommendationsResponse
-> f ExportEC2InstanceRecommendationsResponse
exportEC2InstanceRecommendationsResponse_s3Destination = (ExportEC2InstanceRecommendationsResponse -> Maybe S3Destination)
-> (ExportEC2InstanceRecommendationsResponse
    -> Maybe S3Destination -> ExportEC2InstanceRecommendationsResponse)
-> Lens
     ExportEC2InstanceRecommendationsResponse
     ExportEC2InstanceRecommendationsResponse
     (Maybe S3Destination)
     (Maybe S3Destination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportEC2InstanceRecommendationsResponse' {Maybe S3Destination
s3Destination :: Maybe S3Destination
$sel:s3Destination:ExportEC2InstanceRecommendationsResponse' :: ExportEC2InstanceRecommendationsResponse -> Maybe S3Destination
s3Destination} -> Maybe S3Destination
s3Destination) (\s :: ExportEC2InstanceRecommendationsResponse
s@ExportEC2InstanceRecommendationsResponse' {} Maybe S3Destination
a -> ExportEC2InstanceRecommendationsResponse
s {$sel:s3Destination:ExportEC2InstanceRecommendationsResponse' :: Maybe S3Destination
s3Destination = Maybe S3Destination
a} :: ExportEC2InstanceRecommendationsResponse)

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

instance
  Prelude.NFData
    ExportEC2InstanceRecommendationsResponse