{-# 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.MigrationHubStrategy.StartRecommendationReportGeneration
(
StartRecommendationReportGeneration (..),
newStartRecommendationReportGeneration,
startRecommendationReportGeneration_groupIdFilter,
startRecommendationReportGeneration_outputFormat,
StartRecommendationReportGenerationResponse (..),
newStartRecommendationReportGenerationResponse,
startRecommendationReportGenerationResponse_id,
startRecommendationReportGenerationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartRecommendationReportGeneration = StartRecommendationReportGeneration'
{
StartRecommendationReportGeneration -> Maybe [Group]
groupIdFilter :: Prelude.Maybe [Group],
StartRecommendationReportGeneration -> Maybe OutputFormat
outputFormat :: Prelude.Maybe OutputFormat
}
deriving (StartRecommendationReportGeneration
-> StartRecommendationReportGeneration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRecommendationReportGeneration
-> StartRecommendationReportGeneration -> Bool
$c/= :: StartRecommendationReportGeneration
-> StartRecommendationReportGeneration -> Bool
== :: StartRecommendationReportGeneration
-> StartRecommendationReportGeneration -> Bool
$c== :: StartRecommendationReportGeneration
-> StartRecommendationReportGeneration -> Bool
Prelude.Eq, ReadPrec [StartRecommendationReportGeneration]
ReadPrec StartRecommendationReportGeneration
Int -> ReadS StartRecommendationReportGeneration
ReadS [StartRecommendationReportGeneration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRecommendationReportGeneration]
$creadListPrec :: ReadPrec [StartRecommendationReportGeneration]
readPrec :: ReadPrec StartRecommendationReportGeneration
$creadPrec :: ReadPrec StartRecommendationReportGeneration
readList :: ReadS [StartRecommendationReportGeneration]
$creadList :: ReadS [StartRecommendationReportGeneration]
readsPrec :: Int -> ReadS StartRecommendationReportGeneration
$creadsPrec :: Int -> ReadS StartRecommendationReportGeneration
Prelude.Read, Int -> StartRecommendationReportGeneration -> ShowS
[StartRecommendationReportGeneration] -> ShowS
StartRecommendationReportGeneration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRecommendationReportGeneration] -> ShowS
$cshowList :: [StartRecommendationReportGeneration] -> ShowS
show :: StartRecommendationReportGeneration -> String
$cshow :: StartRecommendationReportGeneration -> String
showsPrec :: Int -> StartRecommendationReportGeneration -> ShowS
$cshowsPrec :: Int -> StartRecommendationReportGeneration -> ShowS
Prelude.Show, forall x.
Rep StartRecommendationReportGeneration x
-> StartRecommendationReportGeneration
forall x.
StartRecommendationReportGeneration
-> Rep StartRecommendationReportGeneration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartRecommendationReportGeneration x
-> StartRecommendationReportGeneration
$cfrom :: forall x.
StartRecommendationReportGeneration
-> Rep StartRecommendationReportGeneration x
Prelude.Generic)
newStartRecommendationReportGeneration ::
StartRecommendationReportGeneration
newStartRecommendationReportGeneration :: StartRecommendationReportGeneration
newStartRecommendationReportGeneration =
StartRecommendationReportGeneration'
{ $sel:groupIdFilter:StartRecommendationReportGeneration' :: Maybe [Group]
groupIdFilter =
forall a. Maybe a
Prelude.Nothing,
$sel:outputFormat:StartRecommendationReportGeneration' :: Maybe OutputFormat
outputFormat = forall a. Maybe a
Prelude.Nothing
}
startRecommendationReportGeneration_groupIdFilter :: Lens.Lens' StartRecommendationReportGeneration (Prelude.Maybe [Group])
startRecommendationReportGeneration_groupIdFilter :: Lens' StartRecommendationReportGeneration (Maybe [Group])
startRecommendationReportGeneration_groupIdFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRecommendationReportGeneration' {Maybe [Group]
groupIdFilter :: Maybe [Group]
$sel:groupIdFilter:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe [Group]
groupIdFilter} -> Maybe [Group]
groupIdFilter) (\s :: StartRecommendationReportGeneration
s@StartRecommendationReportGeneration' {} Maybe [Group]
a -> StartRecommendationReportGeneration
s {$sel:groupIdFilter:StartRecommendationReportGeneration' :: Maybe [Group]
groupIdFilter = Maybe [Group]
a} :: StartRecommendationReportGeneration) 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
startRecommendationReportGeneration_outputFormat :: Lens.Lens' StartRecommendationReportGeneration (Prelude.Maybe OutputFormat)
startRecommendationReportGeneration_outputFormat :: Lens' StartRecommendationReportGeneration (Maybe OutputFormat)
startRecommendationReportGeneration_outputFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRecommendationReportGeneration' {Maybe OutputFormat
outputFormat :: Maybe OutputFormat
$sel:outputFormat:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe OutputFormat
outputFormat} -> Maybe OutputFormat
outputFormat) (\s :: StartRecommendationReportGeneration
s@StartRecommendationReportGeneration' {} Maybe OutputFormat
a -> StartRecommendationReportGeneration
s {$sel:outputFormat:StartRecommendationReportGeneration' :: Maybe OutputFormat
outputFormat = Maybe OutputFormat
a} :: StartRecommendationReportGeneration)
instance
Core.AWSRequest
StartRecommendationReportGeneration
where
type
AWSResponse StartRecommendationReportGeneration =
StartRecommendationReportGenerationResponse
request :: (Service -> Service)
-> StartRecommendationReportGeneration
-> Request StartRecommendationReportGeneration
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 StartRecommendationReportGeneration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse StartRecommendationReportGeneration)))
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 -> Int -> StartRecommendationReportGenerationResponse
StartRecommendationReportGenerationResponse'
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
"id")
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
StartRecommendationReportGeneration
where
hashWithSalt :: Int -> StartRecommendationReportGeneration -> Int
hashWithSalt
Int
_salt
StartRecommendationReportGeneration' {Maybe [Group]
Maybe OutputFormat
outputFormat :: Maybe OutputFormat
groupIdFilter :: Maybe [Group]
$sel:outputFormat:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe OutputFormat
$sel:groupIdFilter:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe [Group]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Group]
groupIdFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OutputFormat
outputFormat
instance
Prelude.NFData
StartRecommendationReportGeneration
where
rnf :: StartRecommendationReportGeneration -> ()
rnf StartRecommendationReportGeneration' {Maybe [Group]
Maybe OutputFormat
outputFormat :: Maybe OutputFormat
groupIdFilter :: Maybe [Group]
$sel:outputFormat:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe OutputFormat
$sel:groupIdFilter:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe [Group]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Group]
groupIdFilter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OutputFormat
outputFormat
instance
Data.ToHeaders
StartRecommendationReportGeneration
where
toHeaders :: StartRecommendationReportGeneration -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Data.ToJSON
StartRecommendationReportGeneration
where
toJSON :: StartRecommendationReportGeneration -> Value
toJSON StartRecommendationReportGeneration' {Maybe [Group]
Maybe OutputFormat
outputFormat :: Maybe OutputFormat
groupIdFilter :: Maybe [Group]
$sel:outputFormat:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe OutputFormat
$sel:groupIdFilter:StartRecommendationReportGeneration' :: StartRecommendationReportGeneration -> Maybe [Group]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"groupIdFilter" 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 [Group]
groupIdFilter,
(Key
"outputFormat" 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 OutputFormat
outputFormat
]
)
instance
Data.ToPath
StartRecommendationReportGeneration
where
toPath :: StartRecommendationReportGeneration -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const
ByteString
"/start-recommendation-report-generation"
instance
Data.ToQuery
StartRecommendationReportGeneration
where
toQuery :: StartRecommendationReportGeneration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartRecommendationReportGenerationResponse = StartRecommendationReportGenerationResponse'
{
StartRecommendationReportGenerationResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
StartRecommendationReportGenerationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartRecommendationReportGenerationResponse
-> StartRecommendationReportGenerationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRecommendationReportGenerationResponse
-> StartRecommendationReportGenerationResponse -> Bool
$c/= :: StartRecommendationReportGenerationResponse
-> StartRecommendationReportGenerationResponse -> Bool
== :: StartRecommendationReportGenerationResponse
-> StartRecommendationReportGenerationResponse -> Bool
$c== :: StartRecommendationReportGenerationResponse
-> StartRecommendationReportGenerationResponse -> Bool
Prelude.Eq, ReadPrec [StartRecommendationReportGenerationResponse]
ReadPrec StartRecommendationReportGenerationResponse
Int -> ReadS StartRecommendationReportGenerationResponse
ReadS [StartRecommendationReportGenerationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRecommendationReportGenerationResponse]
$creadListPrec :: ReadPrec [StartRecommendationReportGenerationResponse]
readPrec :: ReadPrec StartRecommendationReportGenerationResponse
$creadPrec :: ReadPrec StartRecommendationReportGenerationResponse
readList :: ReadS [StartRecommendationReportGenerationResponse]
$creadList :: ReadS [StartRecommendationReportGenerationResponse]
readsPrec :: Int -> ReadS StartRecommendationReportGenerationResponse
$creadsPrec :: Int -> ReadS StartRecommendationReportGenerationResponse
Prelude.Read, Int -> StartRecommendationReportGenerationResponse -> ShowS
[StartRecommendationReportGenerationResponse] -> ShowS
StartRecommendationReportGenerationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRecommendationReportGenerationResponse] -> ShowS
$cshowList :: [StartRecommendationReportGenerationResponse] -> ShowS
show :: StartRecommendationReportGenerationResponse -> String
$cshow :: StartRecommendationReportGenerationResponse -> String
showsPrec :: Int -> StartRecommendationReportGenerationResponse -> ShowS
$cshowsPrec :: Int -> StartRecommendationReportGenerationResponse -> ShowS
Prelude.Show, forall x.
Rep StartRecommendationReportGenerationResponse x
-> StartRecommendationReportGenerationResponse
forall x.
StartRecommendationReportGenerationResponse
-> Rep StartRecommendationReportGenerationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartRecommendationReportGenerationResponse x
-> StartRecommendationReportGenerationResponse
$cfrom :: forall x.
StartRecommendationReportGenerationResponse
-> Rep StartRecommendationReportGenerationResponse x
Prelude.Generic)
newStartRecommendationReportGenerationResponse ::
Prelude.Int ->
StartRecommendationReportGenerationResponse
newStartRecommendationReportGenerationResponse :: Int -> StartRecommendationReportGenerationResponse
newStartRecommendationReportGenerationResponse
Int
pHttpStatus_ =
StartRecommendationReportGenerationResponse'
{ $sel:id:StartRecommendationReportGenerationResponse' :: Maybe Text
id =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartRecommendationReportGenerationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startRecommendationReportGenerationResponse_id :: Lens.Lens' StartRecommendationReportGenerationResponse (Prelude.Maybe Prelude.Text)
startRecommendationReportGenerationResponse_id :: Lens' StartRecommendationReportGenerationResponse (Maybe Text)
startRecommendationReportGenerationResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRecommendationReportGenerationResponse' {Maybe Text
id :: Maybe Text
$sel:id:StartRecommendationReportGenerationResponse' :: StartRecommendationReportGenerationResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: StartRecommendationReportGenerationResponse
s@StartRecommendationReportGenerationResponse' {} Maybe Text
a -> StartRecommendationReportGenerationResponse
s {$sel:id:StartRecommendationReportGenerationResponse' :: Maybe Text
id = Maybe Text
a} :: StartRecommendationReportGenerationResponse)
startRecommendationReportGenerationResponse_httpStatus :: Lens.Lens' StartRecommendationReportGenerationResponse Prelude.Int
startRecommendationReportGenerationResponse_httpStatus :: Lens' StartRecommendationReportGenerationResponse Int
startRecommendationReportGenerationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRecommendationReportGenerationResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartRecommendationReportGenerationResponse' :: StartRecommendationReportGenerationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartRecommendationReportGenerationResponse
s@StartRecommendationReportGenerationResponse' {} Int
a -> StartRecommendationReportGenerationResponse
s {$sel:httpStatus:StartRecommendationReportGenerationResponse' :: Int
httpStatus = Int
a} :: StartRecommendationReportGenerationResponse)
instance
Prelude.NFData
StartRecommendationReportGenerationResponse
where
rnf :: StartRecommendationReportGenerationResponse -> ()
rnf StartRecommendationReportGenerationResponse' {Int
Maybe Text
httpStatus :: Int
id :: Maybe Text
$sel:httpStatus:StartRecommendationReportGenerationResponse' :: StartRecommendationReportGenerationResponse -> Int
$sel:id:StartRecommendationReportGenerationResponse' :: StartRecommendationReportGenerationResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus