{-# 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 #-}
module Amazonka.ComputeOptimizer.ExportEC2InstanceRecommendations
(
ExportEC2InstanceRecommendations (..),
newExportEC2InstanceRecommendations,
exportEC2InstanceRecommendations_accountIds,
exportEC2InstanceRecommendations_fileFormat,
exportEC2InstanceRecommendations_filters,
exportEC2InstanceRecommendations_fieldsToExport,
exportEC2InstanceRecommendations_includeMemberAccounts,
exportEC2InstanceRecommendations_recommendationPreferences,
exportEC2InstanceRecommendations_s3DestinationConfig,
ExportEC2InstanceRecommendationsResponse (..),
newExportEC2InstanceRecommendationsResponse,
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
data ExportEC2InstanceRecommendations = ExportEC2InstanceRecommendations'
{
ExportEC2InstanceRecommendations -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
ExportEC2InstanceRecommendations -> Maybe FileFormat
fileFormat :: Prelude.Maybe FileFormat,
ExportEC2InstanceRecommendations -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
ExportEC2InstanceRecommendations -> Maybe [ExportableInstanceField]
fieldsToExport :: Prelude.Maybe [ExportableInstanceField],
ExportEC2InstanceRecommendations -> Maybe Bool
includeMemberAccounts :: Prelude.Maybe Prelude.Bool,
ExportEC2InstanceRecommendations -> Maybe RecommendationPreferences
recommendationPreferences :: Prelude.Maybe RecommendationPreferences,
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)
newExportEC2InstanceRecommendations ::
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_
}
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
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)
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
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
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)
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)
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
data ExportEC2InstanceRecommendationsResponse = ExportEC2InstanceRecommendationsResponse'
{
ExportEC2InstanceRecommendationsResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
ExportEC2InstanceRecommendationsResponse -> Maybe S3Destination
s3Destination :: Prelude.Maybe S3Destination,
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)
newExportEC2InstanceRecommendationsResponse ::
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_
}
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)
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)
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