{-# 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_tags,
createForecastExportJob_forecastExportJobName,
createForecastExportJob_forecastArn,
createForecastExportJob_destination,
CreateForecastExportJobResponse (..),
newCreateForecastExportJobResponse,
createForecastExportJobResponse_forecastExportJobArn,
createForecastExportJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Forecast.Types
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 CreateForecastExportJob = CreateForecastExportJob'
{
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
(CreateForecastExportJob -> CreateForecastExportJob -> Bool)
-> (CreateForecastExportJob -> CreateForecastExportJob -> Bool)
-> Eq CreateForecastExportJob
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
(Int -> CreateForecastExportJob -> ShowS)
-> (CreateForecastExportJob -> String)
-> ([CreateForecastExportJob] -> ShowS)
-> Show CreateForecastExportJob
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.
CreateForecastExportJob -> Rep CreateForecastExportJob x)
-> (forall x.
Rep CreateForecastExportJob x -> CreateForecastExportJob)
-> Generic CreateForecastExportJob
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' :: Maybe [Tag]
-> Text -> Text -> DataDestination -> CreateForecastExportJob
CreateForecastExportJob'
{ $sel:tags:CreateForecastExportJob' :: Maybe [Tag]
tags = Maybe [Tag]
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_tags :: Lens.Lens' CreateForecastExportJob (Prelude.Maybe [Tag])
createForecastExportJob_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateForecastExportJob -> f CreateForecastExportJob
createForecastExportJob_tags = (CreateForecastExportJob -> Maybe [Tag])
-> (CreateForecastExportJob
-> Maybe [Tag] -> CreateForecastExportJob)
-> Lens
CreateForecastExportJob
CreateForecastExportJob
(Maybe [Tag])
(Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateForecastExportJob -> f CreateForecastExportJob)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateForecastExportJob
-> f CreateForecastExportJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
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 :: (Text -> f Text)
-> CreateForecastExportJob -> f CreateForecastExportJob
createForecastExportJob_forecastExportJobName = (CreateForecastExportJob -> Text)
-> (CreateForecastExportJob -> Text -> CreateForecastExportJob)
-> Lens CreateForecastExportJob CreateForecastExportJob Text Text
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 :: (Text -> f Text)
-> CreateForecastExportJob -> f CreateForecastExportJob
createForecastExportJob_forecastArn = (CreateForecastExportJob -> Text)
-> (CreateForecastExportJob -> Text -> CreateForecastExportJob)
-> Lens CreateForecastExportJob CreateForecastExportJob Text Text
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 :: (DataDestination -> f DataDestination)
-> CreateForecastExportJob -> f CreateForecastExportJob
createForecastExportJob_destination = (CreateForecastExportJob -> DataDestination)
-> (CreateForecastExportJob
-> DataDestination -> CreateForecastExportJob)
-> Lens
CreateForecastExportJob
CreateForecastExportJob
DataDestination
DataDestination
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 :: CreateForecastExportJob -> Request CreateForecastExportJob
request = Service
-> CreateForecastExportJob -> Request CreateForecastExportJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateForecastExportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateForecastExportJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateForecastExportJob))
-> Logger
-> Service
-> Proxy CreateForecastExportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateForecastExportJob)))
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 -> Int -> CreateForecastExportJobResponse
CreateForecastExportJobResponse'
(Maybe Text -> Int -> CreateForecastExportJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateForecastExportJobResponse)
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
"ForecastExportJobArn")
Either String (Int -> CreateForecastExportJobResponse)
-> Either String Int
-> Either String CreateForecastExportJobResponse
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 CreateForecastExportJob
instance Prelude.NFData CreateForecastExportJob
instance Core.ToHeaders CreateForecastExportJob where
toHeaders :: CreateForecastExportJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateForecastExportJob -> 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
"AmazonForecast.CreateForecastExportJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateForecastExportJob where
toJSON :: CreateForecastExportJob -> Value
toJSON CreateForecastExportJob' {Maybe [Tag]
Text
DataDestination
destination :: DataDestination
forecastArn :: Text
forecastExportJobName :: Text
tags :: Maybe [Tag]
$sel:destination:CreateForecastExportJob' :: CreateForecastExportJob -> DataDestination
$sel:forecastArn:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:forecastExportJobName:CreateForecastExportJob' :: CreateForecastExportJob -> Text
$sel:tags:CreateForecastExportJob' :: CreateForecastExportJob -> Maybe [Tag]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ForecastExportJobName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
forecastExportJobName
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ForecastArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
forecastArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Destination" Text -> DataDestination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataDestination
destination)
]
)
instance Core.ToPath CreateForecastExportJob where
toPath :: CreateForecastExportJob -> ByteString
toPath = ByteString -> CreateForecastExportJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateForecastExportJob where
toQuery :: CreateForecastExportJob -> QueryString
toQuery = QueryString -> CreateForecastExportJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateForecastExportJobResponse
-> CreateForecastExportJobResponse -> Bool)
-> (CreateForecastExportJobResponse
-> CreateForecastExportJobResponse -> Bool)
-> Eq CreateForecastExportJobResponse
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]
(Int -> ReadS CreateForecastExportJobResponse)
-> ReadS [CreateForecastExportJobResponse]
-> ReadPrec CreateForecastExportJobResponse
-> ReadPrec [CreateForecastExportJobResponse]
-> Read 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
(Int -> CreateForecastExportJobResponse -> ShowS)
-> (CreateForecastExportJobResponse -> String)
-> ([CreateForecastExportJobResponse] -> ShowS)
-> Show CreateForecastExportJobResponse
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.
CreateForecastExportJobResponse
-> Rep CreateForecastExportJobResponse x)
-> (forall x.
Rep CreateForecastExportJobResponse x
-> CreateForecastExportJobResponse)
-> Generic CreateForecastExportJobResponse
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' :: Maybe Text -> Int -> CreateForecastExportJobResponse
CreateForecastExportJobResponse'
{ $sel:forecastExportJobArn:CreateForecastExportJobResponse' :: Maybe Text
forecastExportJobArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateForecastExportJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createForecastExportJobResponse_forecastExportJobArn :: Lens.Lens' CreateForecastExportJobResponse (Prelude.Maybe Prelude.Text)
createForecastExportJobResponse_forecastExportJobArn :: (Maybe Text -> f (Maybe Text))
-> CreateForecastExportJobResponse
-> f CreateForecastExportJobResponse
createForecastExportJobResponse_forecastExportJobArn = (CreateForecastExportJobResponse -> Maybe Text)
-> (CreateForecastExportJobResponse
-> Maybe Text -> CreateForecastExportJobResponse)
-> Lens
CreateForecastExportJobResponse
CreateForecastExportJobResponse
(Maybe Text)
(Maybe Text)
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 :: (Int -> f Int)
-> CreateForecastExportJobResponse
-> f CreateForecastExportJobResponse
createForecastExportJobResponse_httpStatus = (CreateForecastExportJobResponse -> Int)
-> (CreateForecastExportJobResponse
-> Int -> CreateForecastExportJobResponse)
-> Lens
CreateForecastExportJobResponse
CreateForecastExportJobResponse
Int
Int
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