{-# 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.Forecast.CreateForecastExportJob
(
CreateForecastExportJob (..),
newCreateForecastExportJob,
createForecastExportJob_format,
createForecastExportJob_tags,
createForecastExportJob_forecastExportJobName,
createForecastExportJob_forecastArn,
createForecastExportJob_destination,
CreateForecastExportJobResponse (..),
newCreateForecastExportJobResponse,
createForecastExportJobResponse_forecastExportJobArn,
createForecastExportJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Forecast.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateForecastExportJob = CreateForecastExportJob'
{
CreateForecastExportJob -> Maybe Text
format :: Prelude.Maybe Prelude.Text,
CreateForecastExportJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateForecastExportJob -> Text
forecastExportJobName :: Prelude.Text,
CreateForecastExportJob -> Text
forecastArn :: Prelude.Text,
CreateForecastExportJob -> DataDestination
destination :: DataDestination
}
deriving (CreateForecastExportJob -> CreateForecastExportJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateForecastExportJob -> CreateForecastExportJob -> Bool
$c/= :: CreateForecastExportJob -> CreateForecastExportJob -> Bool
== :: CreateForecastExportJob -> CreateForecastExportJob -> Bool
$c== :: CreateForecastExportJob -> CreateForecastExportJob -> Bool
Prelude.Eq, Int -> CreateForecastExportJob -> ShowS
[CreateForecastExportJob] -> ShowS
CreateForecastExportJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateForecastExportJob] -> ShowS
$cshowList :: [CreateForecastExportJob] -> ShowS
show :: CreateForecastExportJob -> String
$cshow :: CreateForecastExportJob -> String
showsPrec :: Int -> CreateForecastExportJob -> ShowS
$cshowsPrec :: Int -> CreateForecastExportJob -> ShowS
Prelude.Show, forall x. Rep CreateForecastExportJob x -> CreateForecastExportJob
forall x. CreateForecastExportJob -> Rep CreateForecastExportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateForecastExportJob x -> CreateForecastExportJob
$cfrom :: forall x. CreateForecastExportJob -> Rep CreateForecastExportJob x
Prelude.Generic)
newCreateForecastExportJob ::
Prelude.Text ->
Prelude.Text ->
DataDestination ->
CreateForecastExportJob
newCreateForecastExportJob :: Text -> Text -> DataDestination -> CreateForecastExportJob
newCreateForecastExportJob
Text
pForecastExportJobName_
Text
pForecastArn_
DataDestination
pDestination_ =
CreateForecastExportJob'
{ $sel:format:CreateForecastExportJob' :: Maybe Text
format = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateForecastExportJob' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:forecastExportJobName:CreateForecastExportJob' :: Text
forecastExportJobName = Text
pForecastExportJobName_,
$sel:forecastArn:CreateForecastExportJob' :: Text
forecastArn = Text
pForecastArn_,
$sel:destination:CreateForecastExportJob' :: DataDestination
destination = DataDestination
pDestination_
}
createForecastExportJob_format :: Lens.Lens' CreateForecastExportJob (Prelude.Maybe Prelude.Text)
createForecastExportJob_format :: Lens' CreateForecastExportJob (Maybe Text)
createForecastExportJob_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecastExportJob' {Maybe Text
format :: Maybe Text
$sel:format:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe Text
format} -> Maybe Text
format) (\s :: CreateForecastExportJob
s@CreateForecastExportJob' {} Maybe Text
a -> CreateForecastExportJob
s {$sel:format:CreateForecastExportJob' :: Maybe Text
format = Maybe Text
a} :: CreateForecastExportJob)
createForecastExportJob_tags :: Lens.Lens' CreateForecastExportJob (Prelude.Maybe [Tag])
createForecastExportJob_tags :: Lens' CreateForecastExportJob (Maybe [Tag])
createForecastExportJob_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecastExportJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateForecastExportJob
s@CreateForecastExportJob' {} Maybe [Tag]
a -> CreateForecastExportJob
s {$sel:tags:CreateForecastExportJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateForecastExportJob) 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
createForecastExportJob_forecastExportJobName :: Lens.Lens' CreateForecastExportJob Prelude.Text
createForecastExportJob_forecastExportJobName :: Lens' CreateForecastExportJob Text
createForecastExportJob_forecastExportJobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecastExportJob' {Text
forecastExportJobName :: Text
$sel:forecastExportJobName:CreateForecastExportJob' :: CreateForecastExportJob -> Text
forecastExportJobName} -> Text
forecastExportJobName) (\s :: CreateForecastExportJob
s@CreateForecastExportJob' {} Text
a -> CreateForecastExportJob
s {$sel:forecastExportJobName:CreateForecastExportJob' :: Text
forecastExportJobName = Text
a} :: CreateForecastExportJob)
createForecastExportJob_forecastArn :: Lens.Lens' CreateForecastExportJob Prelude.Text
createForecastExportJob_forecastArn :: Lens' CreateForecastExportJob Text
createForecastExportJob_forecastArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecastExportJob' {Text
forecastArn :: Text
$sel:forecastArn:CreateForecastExportJob' :: CreateForecastExportJob -> Text
forecastArn} -> Text
forecastArn) (\s :: CreateForecastExportJob
s@CreateForecastExportJob' {} Text
a -> CreateForecastExportJob
s {$sel:forecastArn:CreateForecastExportJob' :: Text
forecastArn = Text
a} :: CreateForecastExportJob)
createForecastExportJob_destination :: Lens.Lens' CreateForecastExportJob DataDestination
createForecastExportJob_destination :: Lens' CreateForecastExportJob DataDestination
createForecastExportJob_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecastExportJob' {DataDestination
destination :: DataDestination
$sel:destination:CreateForecastExportJob' :: CreateForecastExportJob -> DataDestination
destination} -> DataDestination
destination) (\s :: CreateForecastExportJob
s@CreateForecastExportJob' {} DataDestination
a -> CreateForecastExportJob
s {$sel:destination:CreateForecastExportJob' :: DataDestination
destination = DataDestination
a} :: CreateForecastExportJob)
instance Core.AWSRequest CreateForecastExportJob where
type
AWSResponse CreateForecastExportJob =
CreateForecastExportJobResponse
request :: (Service -> Service)
-> CreateForecastExportJob -> Request CreateForecastExportJob
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 CreateForecastExportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateForecastExportJob)))
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 -> CreateForecastExportJobResponse
CreateForecastExportJobResponse'
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
"ForecastExportJobArn")
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 CreateForecastExportJob where
hashWithSalt :: Int -> CreateForecastExportJob -> Int
hashWithSalt Int
_salt CreateForecastExportJob' {Maybe [Tag]
Maybe Text
Text
DataDestination
destination :: DataDestination
forecastArn :: Text
forecastExportJobName :: Text
tags :: Maybe [Tag]
format :: Maybe Text
$sel:destination:CreateForecastExportJob' :: CreateForecastExportJob -> DataDestination
$sel:forecastArn:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:forecastExportJobName:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:tags:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe [Tag]
$sel:format:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
forecastExportJobName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
forecastArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DataDestination
destination
instance Prelude.NFData CreateForecastExportJob where
rnf :: CreateForecastExportJob -> ()
rnf CreateForecastExportJob' {Maybe [Tag]
Maybe Text
Text
DataDestination
destination :: DataDestination
forecastArn :: Text
forecastExportJobName :: Text
tags :: Maybe [Tag]
format :: Maybe Text
$sel:destination:CreateForecastExportJob' :: CreateForecastExportJob -> DataDestination
$sel:forecastArn:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:forecastExportJobName:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:tags:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe [Tag]
$sel:format:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
forecastExportJobName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
forecastArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DataDestination
destination
instance Data.ToHeaders CreateForecastExportJob where
toHeaders :: CreateForecastExportJob -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonForecast.CreateForecastExportJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateForecastExportJob where
toJSON :: CreateForecastExportJob -> Value
toJSON CreateForecastExportJob' {Maybe [Tag]
Maybe Text
Text
DataDestination
destination :: DataDestination
forecastArn :: Text
forecastExportJobName :: Text
tags :: Maybe [Tag]
format :: Maybe Text
$sel:destination:CreateForecastExportJob' :: CreateForecastExportJob -> DataDestination
$sel:forecastArn:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:forecastExportJobName:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:tags:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe [Tag]
$sel:format:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
format,
(Key
"Tags" 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 [Tag]
tags,
forall a. a -> Maybe a
Prelude.Just
( Key
"ForecastExportJobName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
forecastExportJobName
),
forall a. a -> Maybe a
Prelude.Just (Key
"ForecastArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
forecastArn),
forall a. a -> Maybe a
Prelude.Just (Key
"Destination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DataDestination
destination)
]
)
instance Data.ToPath CreateForecastExportJob where
toPath :: CreateForecastExportJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateForecastExportJob where
toQuery :: CreateForecastExportJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateForecastExportJobResponse = CreateForecastExportJobResponse'
{
CreateForecastExportJobResponse -> Maybe Text
forecastExportJobArn :: Prelude.Maybe Prelude.Text,
CreateForecastExportJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateForecastExportJobResponse
-> CreateForecastExportJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateForecastExportJobResponse
-> CreateForecastExportJobResponse -> Bool
$c/= :: CreateForecastExportJobResponse
-> CreateForecastExportJobResponse -> Bool
== :: CreateForecastExportJobResponse
-> CreateForecastExportJobResponse -> Bool
$c== :: CreateForecastExportJobResponse
-> CreateForecastExportJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateForecastExportJobResponse]
ReadPrec CreateForecastExportJobResponse
Int -> ReadS CreateForecastExportJobResponse
ReadS [CreateForecastExportJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateForecastExportJobResponse]
$creadListPrec :: ReadPrec [CreateForecastExportJobResponse]
readPrec :: ReadPrec CreateForecastExportJobResponse
$creadPrec :: ReadPrec CreateForecastExportJobResponse
readList :: ReadS [CreateForecastExportJobResponse]
$creadList :: ReadS [CreateForecastExportJobResponse]
readsPrec :: Int -> ReadS CreateForecastExportJobResponse
$creadsPrec :: Int -> ReadS CreateForecastExportJobResponse
Prelude.Read, Int -> CreateForecastExportJobResponse -> ShowS
[CreateForecastExportJobResponse] -> ShowS
CreateForecastExportJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateForecastExportJobResponse] -> ShowS
$cshowList :: [CreateForecastExportJobResponse] -> ShowS
show :: CreateForecastExportJobResponse -> String
$cshow :: CreateForecastExportJobResponse -> String
showsPrec :: Int -> CreateForecastExportJobResponse -> ShowS
$cshowsPrec :: Int -> CreateForecastExportJobResponse -> ShowS
Prelude.Show, forall x.
Rep CreateForecastExportJobResponse x
-> CreateForecastExportJobResponse
forall x.
CreateForecastExportJobResponse
-> Rep CreateForecastExportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateForecastExportJobResponse x
-> CreateForecastExportJobResponse
$cfrom :: forall x.
CreateForecastExportJobResponse
-> Rep CreateForecastExportJobResponse x
Prelude.Generic)
newCreateForecastExportJobResponse ::
Prelude.Int ->
CreateForecastExportJobResponse
newCreateForecastExportJobResponse :: Int -> CreateForecastExportJobResponse
newCreateForecastExportJobResponse Int
pHttpStatus_ =
CreateForecastExportJobResponse'
{ $sel:forecastExportJobArn:CreateForecastExportJobResponse' :: Maybe Text
forecastExportJobArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateForecastExportJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createForecastExportJobResponse_forecastExportJobArn :: Lens.Lens' CreateForecastExportJobResponse (Prelude.Maybe Prelude.Text)
createForecastExportJobResponse_forecastExportJobArn :: Lens' CreateForecastExportJobResponse (Maybe Text)
createForecastExportJobResponse_forecastExportJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecastExportJobResponse' {Maybe Text
forecastExportJobArn :: Maybe Text
$sel:forecastExportJobArn:CreateForecastExportJobResponse' :: CreateForecastExportJobResponse -> Maybe Text
forecastExportJobArn} -> Maybe Text
forecastExportJobArn) (\s :: CreateForecastExportJobResponse
s@CreateForecastExportJobResponse' {} Maybe Text
a -> CreateForecastExportJobResponse
s {$sel:forecastExportJobArn:CreateForecastExportJobResponse' :: Maybe Text
forecastExportJobArn = Maybe Text
a} :: CreateForecastExportJobResponse)
createForecastExportJobResponse_httpStatus :: Lens.Lens' CreateForecastExportJobResponse Prelude.Int
createForecastExportJobResponse_httpStatus :: Lens' CreateForecastExportJobResponse Int
createForecastExportJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecastExportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateForecastExportJobResponse' :: CreateForecastExportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateForecastExportJobResponse
s@CreateForecastExportJobResponse' {} Int
a -> CreateForecastExportJobResponse
s {$sel:httpStatus:CreateForecastExportJobResponse' :: Int
httpStatus = Int
a} :: CreateForecastExportJobResponse)
instance
Prelude.NFData
CreateForecastExportJobResponse
where
rnf :: CreateForecastExportJobResponse -> ()
rnf CreateForecastExportJobResponse' {Int
Maybe Text
httpStatus :: Int
forecastExportJobArn :: Maybe Text
$sel:httpStatus:CreateForecastExportJobResponse' :: CreateForecastExportJobResponse -> Int
$sel:forecastExportJobArn:CreateForecastExportJobResponse' :: CreateForecastExportJobResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
forecastExportJobArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus