{-# 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.CreateDatasetGroup
(
CreateDatasetGroup (..),
newCreateDatasetGroup,
createDatasetGroup_datasetArns,
createDatasetGroup_tags,
createDatasetGroup_datasetGroupName,
createDatasetGroup_domain,
CreateDatasetGroupResponse (..),
newCreateDatasetGroupResponse,
createDatasetGroupResponse_datasetGroupArn,
createDatasetGroupResponse_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 CreateDatasetGroup = CreateDatasetGroup'
{
CreateDatasetGroup -> Maybe [Text]
datasetArns :: Prelude.Maybe [Prelude.Text],
CreateDatasetGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateDatasetGroup -> Text
datasetGroupName :: Prelude.Text,
CreateDatasetGroup -> Domain
domain :: Domain
}
deriving (CreateDatasetGroup -> CreateDatasetGroup -> Bool
(CreateDatasetGroup -> CreateDatasetGroup -> Bool)
-> (CreateDatasetGroup -> CreateDatasetGroup -> Bool)
-> Eq CreateDatasetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDatasetGroup -> CreateDatasetGroup -> Bool
$c/= :: CreateDatasetGroup -> CreateDatasetGroup -> Bool
== :: CreateDatasetGroup -> CreateDatasetGroup -> Bool
$c== :: CreateDatasetGroup -> CreateDatasetGroup -> Bool
Prelude.Eq, Int -> CreateDatasetGroup -> ShowS
[CreateDatasetGroup] -> ShowS
CreateDatasetGroup -> String
(Int -> CreateDatasetGroup -> ShowS)
-> (CreateDatasetGroup -> String)
-> ([CreateDatasetGroup] -> ShowS)
-> Show CreateDatasetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDatasetGroup] -> ShowS
$cshowList :: [CreateDatasetGroup] -> ShowS
show :: CreateDatasetGroup -> String
$cshow :: CreateDatasetGroup -> String
showsPrec :: Int -> CreateDatasetGroup -> ShowS
$cshowsPrec :: Int -> CreateDatasetGroup -> ShowS
Prelude.Show, (forall x. CreateDatasetGroup -> Rep CreateDatasetGroup x)
-> (forall x. Rep CreateDatasetGroup x -> CreateDatasetGroup)
-> Generic CreateDatasetGroup
forall x. Rep CreateDatasetGroup x -> CreateDatasetGroup
forall x. CreateDatasetGroup -> Rep CreateDatasetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDatasetGroup x -> CreateDatasetGroup
$cfrom :: forall x. CreateDatasetGroup -> Rep CreateDatasetGroup x
Prelude.Generic)
newCreateDatasetGroup ::
Prelude.Text ->
Domain ->
CreateDatasetGroup
newCreateDatasetGroup :: Text -> Domain -> CreateDatasetGroup
newCreateDatasetGroup Text
pDatasetGroupName_ Domain
pDomain_ =
CreateDatasetGroup' :: Maybe [Text] -> Maybe [Tag] -> Text -> Domain -> CreateDatasetGroup
CreateDatasetGroup'
{ $sel:datasetArns:CreateDatasetGroup' :: Maybe [Text]
datasetArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDatasetGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:datasetGroupName:CreateDatasetGroup' :: Text
datasetGroupName = Text
pDatasetGroupName_,
$sel:domain:CreateDatasetGroup' :: Domain
domain = Domain
pDomain_
}
createDatasetGroup_datasetArns :: Lens.Lens' CreateDatasetGroup (Prelude.Maybe [Prelude.Text])
createDatasetGroup_datasetArns :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateDatasetGroup -> f CreateDatasetGroup
createDatasetGroup_datasetArns = (CreateDatasetGroup -> Maybe [Text])
-> (CreateDatasetGroup -> Maybe [Text] -> CreateDatasetGroup)
-> Lens
CreateDatasetGroup CreateDatasetGroup (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetGroup' {Maybe [Text]
datasetArns :: Maybe [Text]
$sel:datasetArns:CreateDatasetGroup' :: CreateDatasetGroup -> Maybe [Text]
datasetArns} -> Maybe [Text]
datasetArns) (\s :: CreateDatasetGroup
s@CreateDatasetGroup' {} Maybe [Text]
a -> CreateDatasetGroup
s {$sel:datasetArns:CreateDatasetGroup' :: Maybe [Text]
datasetArns = Maybe [Text]
a} :: CreateDatasetGroup) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateDatasetGroup -> f CreateDatasetGroup)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateDatasetGroup
-> f CreateDatasetGroup
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
createDatasetGroup_tags :: Lens.Lens' CreateDatasetGroup (Prelude.Maybe [Tag])
createDatasetGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDatasetGroup -> f CreateDatasetGroup
createDatasetGroup_tags = (CreateDatasetGroup -> Maybe [Tag])
-> (CreateDatasetGroup -> Maybe [Tag] -> CreateDatasetGroup)
-> Lens
CreateDatasetGroup CreateDatasetGroup (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDatasetGroup' :: CreateDatasetGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDatasetGroup
s@CreateDatasetGroup' {} Maybe [Tag]
a -> CreateDatasetGroup
s {$sel:tags:CreateDatasetGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDatasetGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDatasetGroup -> f CreateDatasetGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDatasetGroup
-> f CreateDatasetGroup
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
createDatasetGroup_datasetGroupName :: Lens.Lens' CreateDatasetGroup Prelude.Text
createDatasetGroup_datasetGroupName :: (Text -> f Text) -> CreateDatasetGroup -> f CreateDatasetGroup
createDatasetGroup_datasetGroupName = (CreateDatasetGroup -> Text)
-> (CreateDatasetGroup -> Text -> CreateDatasetGroup)
-> Lens CreateDatasetGroup CreateDatasetGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetGroup' {Text
datasetGroupName :: Text
$sel:datasetGroupName:CreateDatasetGroup' :: CreateDatasetGroup -> Text
datasetGroupName} -> Text
datasetGroupName) (\s :: CreateDatasetGroup
s@CreateDatasetGroup' {} Text
a -> CreateDatasetGroup
s {$sel:datasetGroupName:CreateDatasetGroup' :: Text
datasetGroupName = Text
a} :: CreateDatasetGroup)
createDatasetGroup_domain :: Lens.Lens' CreateDatasetGroup Domain
createDatasetGroup_domain :: (Domain -> f Domain) -> CreateDatasetGroup -> f CreateDatasetGroup
createDatasetGroup_domain = (CreateDatasetGroup -> Domain)
-> (CreateDatasetGroup -> Domain -> CreateDatasetGroup)
-> Lens CreateDatasetGroup CreateDatasetGroup Domain Domain
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetGroup' {Domain
domain :: Domain
$sel:domain:CreateDatasetGroup' :: CreateDatasetGroup -> Domain
domain} -> Domain
domain) (\s :: CreateDatasetGroup
s@CreateDatasetGroup' {} Domain
a -> CreateDatasetGroup
s {$sel:domain:CreateDatasetGroup' :: Domain
domain = Domain
a} :: CreateDatasetGroup)
instance Core.AWSRequest CreateDatasetGroup where
type
AWSResponse CreateDatasetGroup =
CreateDatasetGroupResponse
request :: CreateDatasetGroup -> Request CreateDatasetGroup
request = Service -> CreateDatasetGroup -> Request CreateDatasetGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDatasetGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDatasetGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDatasetGroup))
-> Logger
-> Service
-> Proxy CreateDatasetGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDatasetGroup)))
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 -> CreateDatasetGroupResponse
CreateDatasetGroupResponse'
(Maybe Text -> Int -> CreateDatasetGroupResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDatasetGroupResponse)
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
"DatasetGroupArn")
Either String (Int -> CreateDatasetGroupResponse)
-> Either String Int -> Either String CreateDatasetGroupResponse
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 CreateDatasetGroup
instance Prelude.NFData CreateDatasetGroup
instance Core.ToHeaders CreateDatasetGroup where
toHeaders :: CreateDatasetGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateDatasetGroup -> 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.CreateDatasetGroup" ::
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 CreateDatasetGroup where
toJSON :: CreateDatasetGroup -> Value
toJSON CreateDatasetGroup' {Maybe [Text]
Maybe [Tag]
Text
Domain
domain :: Domain
datasetGroupName :: Text
tags :: Maybe [Tag]
datasetArns :: Maybe [Text]
$sel:domain:CreateDatasetGroup' :: CreateDatasetGroup -> Domain
$sel:datasetGroupName:CreateDatasetGroup' :: CreateDatasetGroup -> Text
$sel:tags:CreateDatasetGroup' :: CreateDatasetGroup -> Maybe [Tag]
$sel:datasetArns:CreateDatasetGroup' :: CreateDatasetGroup -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DatasetArns" 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]
datasetArns,
(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
"DatasetGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetGroupName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Domain" Text -> Domain -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Domain
domain)
]
)
instance Core.ToPath CreateDatasetGroup where
toPath :: CreateDatasetGroup -> ByteString
toPath = ByteString -> CreateDatasetGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateDatasetGroup where
toQuery :: CreateDatasetGroup -> QueryString
toQuery = QueryString -> CreateDatasetGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDatasetGroupResponse = CreateDatasetGroupResponse'
{
CreateDatasetGroupResponse -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
CreateDatasetGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDatasetGroupResponse -> CreateDatasetGroupResponse -> Bool
(CreateDatasetGroupResponse -> CreateDatasetGroupResponse -> Bool)
-> (CreateDatasetGroupResponse
-> CreateDatasetGroupResponse -> Bool)
-> Eq CreateDatasetGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDatasetGroupResponse -> CreateDatasetGroupResponse -> Bool
$c/= :: CreateDatasetGroupResponse -> CreateDatasetGroupResponse -> Bool
== :: CreateDatasetGroupResponse -> CreateDatasetGroupResponse -> Bool
$c== :: CreateDatasetGroupResponse -> CreateDatasetGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateDatasetGroupResponse]
ReadPrec CreateDatasetGroupResponse
Int -> ReadS CreateDatasetGroupResponse
ReadS [CreateDatasetGroupResponse]
(Int -> ReadS CreateDatasetGroupResponse)
-> ReadS [CreateDatasetGroupResponse]
-> ReadPrec CreateDatasetGroupResponse
-> ReadPrec [CreateDatasetGroupResponse]
-> Read CreateDatasetGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDatasetGroupResponse]
$creadListPrec :: ReadPrec [CreateDatasetGroupResponse]
readPrec :: ReadPrec CreateDatasetGroupResponse
$creadPrec :: ReadPrec CreateDatasetGroupResponse
readList :: ReadS [CreateDatasetGroupResponse]
$creadList :: ReadS [CreateDatasetGroupResponse]
readsPrec :: Int -> ReadS CreateDatasetGroupResponse
$creadsPrec :: Int -> ReadS CreateDatasetGroupResponse
Prelude.Read, Int -> CreateDatasetGroupResponse -> ShowS
[CreateDatasetGroupResponse] -> ShowS
CreateDatasetGroupResponse -> String
(Int -> CreateDatasetGroupResponse -> ShowS)
-> (CreateDatasetGroupResponse -> String)
-> ([CreateDatasetGroupResponse] -> ShowS)
-> Show CreateDatasetGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDatasetGroupResponse] -> ShowS
$cshowList :: [CreateDatasetGroupResponse] -> ShowS
show :: CreateDatasetGroupResponse -> String
$cshow :: CreateDatasetGroupResponse -> String
showsPrec :: Int -> CreateDatasetGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateDatasetGroupResponse -> ShowS
Prelude.Show, (forall x.
CreateDatasetGroupResponse -> Rep CreateDatasetGroupResponse x)
-> (forall x.
Rep CreateDatasetGroupResponse x -> CreateDatasetGroupResponse)
-> Generic CreateDatasetGroupResponse
forall x.
Rep CreateDatasetGroupResponse x -> CreateDatasetGroupResponse
forall x.
CreateDatasetGroupResponse -> Rep CreateDatasetGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDatasetGroupResponse x -> CreateDatasetGroupResponse
$cfrom :: forall x.
CreateDatasetGroupResponse -> Rep CreateDatasetGroupResponse x
Prelude.Generic)
newCreateDatasetGroupResponse ::
Prelude.Int ->
CreateDatasetGroupResponse
newCreateDatasetGroupResponse :: Int -> CreateDatasetGroupResponse
newCreateDatasetGroupResponse Int
pHttpStatus_ =
CreateDatasetGroupResponse' :: Maybe Text -> Int -> CreateDatasetGroupResponse
CreateDatasetGroupResponse'
{ $sel:datasetGroupArn:CreateDatasetGroupResponse' :: Maybe Text
datasetGroupArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDatasetGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createDatasetGroupResponse_datasetGroupArn :: Lens.Lens' CreateDatasetGroupResponse (Prelude.Maybe Prelude.Text)
createDatasetGroupResponse_datasetGroupArn :: (Maybe Text -> f (Maybe Text))
-> CreateDatasetGroupResponse -> f CreateDatasetGroupResponse
createDatasetGroupResponse_datasetGroupArn = (CreateDatasetGroupResponse -> Maybe Text)
-> (CreateDatasetGroupResponse
-> Maybe Text -> CreateDatasetGroupResponse)
-> Lens
CreateDatasetGroupResponse
CreateDatasetGroupResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetGroupResponse' {Maybe Text
datasetGroupArn :: Maybe Text
$sel:datasetGroupArn:CreateDatasetGroupResponse' :: CreateDatasetGroupResponse -> Maybe Text
datasetGroupArn} -> Maybe Text
datasetGroupArn) (\s :: CreateDatasetGroupResponse
s@CreateDatasetGroupResponse' {} Maybe Text
a -> CreateDatasetGroupResponse
s {$sel:datasetGroupArn:CreateDatasetGroupResponse' :: Maybe Text
datasetGroupArn = Maybe Text
a} :: CreateDatasetGroupResponse)
createDatasetGroupResponse_httpStatus :: Lens.Lens' CreateDatasetGroupResponse Prelude.Int
createDatasetGroupResponse_httpStatus :: (Int -> f Int)
-> CreateDatasetGroupResponse -> f CreateDatasetGroupResponse
createDatasetGroupResponse_httpStatus = (CreateDatasetGroupResponse -> Int)
-> (CreateDatasetGroupResponse
-> Int -> CreateDatasetGroupResponse)
-> Lens
CreateDatasetGroupResponse CreateDatasetGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDatasetGroupResponse' :: CreateDatasetGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDatasetGroupResponse
s@CreateDatasetGroupResponse' {} Int
a -> CreateDatasetGroupResponse
s {$sel:httpStatus:CreateDatasetGroupResponse' :: Int
httpStatus = Int
a} :: CreateDatasetGroupResponse)
instance Prelude.NFData CreateDatasetGroupResponse