{-# 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.UpdateDatasetGroup
(
UpdateDatasetGroup (..),
newUpdateDatasetGroup,
updateDatasetGroup_datasetGroupArn,
updateDatasetGroup_datasetArns,
UpdateDatasetGroupResponse (..),
newUpdateDatasetGroupResponse,
updateDatasetGroupResponse_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 UpdateDatasetGroup = UpdateDatasetGroup'
{
UpdateDatasetGroup -> Text
datasetGroupArn :: Prelude.Text,
UpdateDatasetGroup -> [Text]
datasetArns :: [Prelude.Text]
}
deriving (UpdateDatasetGroup -> UpdateDatasetGroup -> Bool
(UpdateDatasetGroup -> UpdateDatasetGroup -> Bool)
-> (UpdateDatasetGroup -> UpdateDatasetGroup -> Bool)
-> Eq UpdateDatasetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDatasetGroup -> UpdateDatasetGroup -> Bool
$c/= :: UpdateDatasetGroup -> UpdateDatasetGroup -> Bool
== :: UpdateDatasetGroup -> UpdateDatasetGroup -> Bool
$c== :: UpdateDatasetGroup -> UpdateDatasetGroup -> Bool
Prelude.Eq, ReadPrec [UpdateDatasetGroup]
ReadPrec UpdateDatasetGroup
Int -> ReadS UpdateDatasetGroup
ReadS [UpdateDatasetGroup]
(Int -> ReadS UpdateDatasetGroup)
-> ReadS [UpdateDatasetGroup]
-> ReadPrec UpdateDatasetGroup
-> ReadPrec [UpdateDatasetGroup]
-> Read UpdateDatasetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDatasetGroup]
$creadListPrec :: ReadPrec [UpdateDatasetGroup]
readPrec :: ReadPrec UpdateDatasetGroup
$creadPrec :: ReadPrec UpdateDatasetGroup
readList :: ReadS [UpdateDatasetGroup]
$creadList :: ReadS [UpdateDatasetGroup]
readsPrec :: Int -> ReadS UpdateDatasetGroup
$creadsPrec :: Int -> ReadS UpdateDatasetGroup
Prelude.Read, Int -> UpdateDatasetGroup -> ShowS
[UpdateDatasetGroup] -> ShowS
UpdateDatasetGroup -> String
(Int -> UpdateDatasetGroup -> ShowS)
-> (UpdateDatasetGroup -> String)
-> ([UpdateDatasetGroup] -> ShowS)
-> Show UpdateDatasetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDatasetGroup] -> ShowS
$cshowList :: [UpdateDatasetGroup] -> ShowS
show :: UpdateDatasetGroup -> String
$cshow :: UpdateDatasetGroup -> String
showsPrec :: Int -> UpdateDatasetGroup -> ShowS
$cshowsPrec :: Int -> UpdateDatasetGroup -> ShowS
Prelude.Show, (forall x. UpdateDatasetGroup -> Rep UpdateDatasetGroup x)
-> (forall x. Rep UpdateDatasetGroup x -> UpdateDatasetGroup)
-> Generic UpdateDatasetGroup
forall x. Rep UpdateDatasetGroup x -> UpdateDatasetGroup
forall x. UpdateDatasetGroup -> Rep UpdateDatasetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDatasetGroup x -> UpdateDatasetGroup
$cfrom :: forall x. UpdateDatasetGroup -> Rep UpdateDatasetGroup x
Prelude.Generic)
newUpdateDatasetGroup ::
Prelude.Text ->
UpdateDatasetGroup
newUpdateDatasetGroup :: Text -> UpdateDatasetGroup
newUpdateDatasetGroup Text
pDatasetGroupArn_ =
UpdateDatasetGroup' :: Text -> [Text] -> UpdateDatasetGroup
UpdateDatasetGroup'
{ $sel:datasetGroupArn:UpdateDatasetGroup' :: Text
datasetGroupArn =
Text
pDatasetGroupArn_,
$sel:datasetArns:UpdateDatasetGroup' :: [Text]
datasetArns = [Text]
forall a. Monoid a => a
Prelude.mempty
}
updateDatasetGroup_datasetGroupArn :: Lens.Lens' UpdateDatasetGroup Prelude.Text
updateDatasetGroup_datasetGroupArn :: (Text -> f Text) -> UpdateDatasetGroup -> f UpdateDatasetGroup
updateDatasetGroup_datasetGroupArn = (UpdateDatasetGroup -> Text)
-> (UpdateDatasetGroup -> Text -> UpdateDatasetGroup)
-> Lens UpdateDatasetGroup UpdateDatasetGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDatasetGroup' {Text
datasetGroupArn :: Text
$sel:datasetGroupArn:UpdateDatasetGroup' :: UpdateDatasetGroup -> Text
datasetGroupArn} -> Text
datasetGroupArn) (\s :: UpdateDatasetGroup
s@UpdateDatasetGroup' {} Text
a -> UpdateDatasetGroup
s {$sel:datasetGroupArn:UpdateDatasetGroup' :: Text
datasetGroupArn = Text
a} :: UpdateDatasetGroup)
updateDatasetGroup_datasetArns :: Lens.Lens' UpdateDatasetGroup [Prelude.Text]
updateDatasetGroup_datasetArns :: ([Text] -> f [Text]) -> UpdateDatasetGroup -> f UpdateDatasetGroup
updateDatasetGroup_datasetArns = (UpdateDatasetGroup -> [Text])
-> (UpdateDatasetGroup -> [Text] -> UpdateDatasetGroup)
-> Lens UpdateDatasetGroup UpdateDatasetGroup [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDatasetGroup' {[Text]
datasetArns :: [Text]
$sel:datasetArns:UpdateDatasetGroup' :: UpdateDatasetGroup -> [Text]
datasetArns} -> [Text]
datasetArns) (\s :: UpdateDatasetGroup
s@UpdateDatasetGroup' {} [Text]
a -> UpdateDatasetGroup
s {$sel:datasetArns:UpdateDatasetGroup' :: [Text]
datasetArns = [Text]
a} :: UpdateDatasetGroup) (([Text] -> f [Text])
-> UpdateDatasetGroup -> f UpdateDatasetGroup)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> UpdateDatasetGroup
-> f UpdateDatasetGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UpdateDatasetGroup where
type
AWSResponse UpdateDatasetGroup =
UpdateDatasetGroupResponse
request :: UpdateDatasetGroup -> Request UpdateDatasetGroup
request = Service -> UpdateDatasetGroup -> Request UpdateDatasetGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDatasetGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDatasetGroup)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateDatasetGroup))
-> Logger
-> Service
-> Proxy UpdateDatasetGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDatasetGroup)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateDatasetGroupResponse
UpdateDatasetGroupResponse'
(Int -> UpdateDatasetGroupResponse)
-> Either String Int -> Either String UpdateDatasetGroupResponse
forall (f :: * -> *) a b. Functor 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 UpdateDatasetGroup
instance Prelude.NFData UpdateDatasetGroup
instance Core.ToHeaders UpdateDatasetGroup where
toHeaders :: UpdateDatasetGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDatasetGroup -> 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.UpdateDatasetGroup" ::
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 UpdateDatasetGroup where
toJSON :: UpdateDatasetGroup -> Value
toJSON UpdateDatasetGroup' {[Text]
Text
datasetArns :: [Text]
datasetGroupArn :: Text
$sel:datasetArns:UpdateDatasetGroup' :: UpdateDatasetGroup -> [Text]
$sel:datasetGroupArn:UpdateDatasetGroup' :: UpdateDatasetGroup -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DatasetGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetGroupArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatasetArns" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
datasetArns)
]
)
instance Core.ToPath UpdateDatasetGroup where
toPath :: UpdateDatasetGroup -> ByteString
toPath = ByteString -> UpdateDatasetGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateDatasetGroup where
toQuery :: UpdateDatasetGroup -> QueryString
toQuery = QueryString -> UpdateDatasetGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDatasetGroupResponse = UpdateDatasetGroupResponse'
{
UpdateDatasetGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDatasetGroupResponse -> UpdateDatasetGroupResponse -> Bool
(UpdateDatasetGroupResponse -> UpdateDatasetGroupResponse -> Bool)
-> (UpdateDatasetGroupResponse
-> UpdateDatasetGroupResponse -> Bool)
-> Eq UpdateDatasetGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDatasetGroupResponse -> UpdateDatasetGroupResponse -> Bool
$c/= :: UpdateDatasetGroupResponse -> UpdateDatasetGroupResponse -> Bool
== :: UpdateDatasetGroupResponse -> UpdateDatasetGroupResponse -> Bool
$c== :: UpdateDatasetGroupResponse -> UpdateDatasetGroupResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDatasetGroupResponse]
ReadPrec UpdateDatasetGroupResponse
Int -> ReadS UpdateDatasetGroupResponse
ReadS [UpdateDatasetGroupResponse]
(Int -> ReadS UpdateDatasetGroupResponse)
-> ReadS [UpdateDatasetGroupResponse]
-> ReadPrec UpdateDatasetGroupResponse
-> ReadPrec [UpdateDatasetGroupResponse]
-> Read UpdateDatasetGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDatasetGroupResponse]
$creadListPrec :: ReadPrec [UpdateDatasetGroupResponse]
readPrec :: ReadPrec UpdateDatasetGroupResponse
$creadPrec :: ReadPrec UpdateDatasetGroupResponse
readList :: ReadS [UpdateDatasetGroupResponse]
$creadList :: ReadS [UpdateDatasetGroupResponse]
readsPrec :: Int -> ReadS UpdateDatasetGroupResponse
$creadsPrec :: Int -> ReadS UpdateDatasetGroupResponse
Prelude.Read, Int -> UpdateDatasetGroupResponse -> ShowS
[UpdateDatasetGroupResponse] -> ShowS
UpdateDatasetGroupResponse -> String
(Int -> UpdateDatasetGroupResponse -> ShowS)
-> (UpdateDatasetGroupResponse -> String)
-> ([UpdateDatasetGroupResponse] -> ShowS)
-> Show UpdateDatasetGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDatasetGroupResponse] -> ShowS
$cshowList :: [UpdateDatasetGroupResponse] -> ShowS
show :: UpdateDatasetGroupResponse -> String
$cshow :: UpdateDatasetGroupResponse -> String
showsPrec :: Int -> UpdateDatasetGroupResponse -> ShowS
$cshowsPrec :: Int -> UpdateDatasetGroupResponse -> ShowS
Prelude.Show, (forall x.
UpdateDatasetGroupResponse -> Rep UpdateDatasetGroupResponse x)
-> (forall x.
Rep UpdateDatasetGroupResponse x -> UpdateDatasetGroupResponse)
-> Generic UpdateDatasetGroupResponse
forall x.
Rep UpdateDatasetGroupResponse x -> UpdateDatasetGroupResponse
forall x.
UpdateDatasetGroupResponse -> Rep UpdateDatasetGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDatasetGroupResponse x -> UpdateDatasetGroupResponse
$cfrom :: forall x.
UpdateDatasetGroupResponse -> Rep UpdateDatasetGroupResponse x
Prelude.Generic)
newUpdateDatasetGroupResponse ::
Prelude.Int ->
UpdateDatasetGroupResponse
newUpdateDatasetGroupResponse :: Int -> UpdateDatasetGroupResponse
newUpdateDatasetGroupResponse Int
pHttpStatus_ =
UpdateDatasetGroupResponse' :: Int -> UpdateDatasetGroupResponse
UpdateDatasetGroupResponse'
{ $sel:httpStatus:UpdateDatasetGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateDatasetGroupResponse_httpStatus :: Lens.Lens' UpdateDatasetGroupResponse Prelude.Int
updateDatasetGroupResponse_httpStatus :: (Int -> f Int)
-> UpdateDatasetGroupResponse -> f UpdateDatasetGroupResponse
updateDatasetGroupResponse_httpStatus = (UpdateDatasetGroupResponse -> Int)
-> (UpdateDatasetGroupResponse
-> Int -> UpdateDatasetGroupResponse)
-> Lens
UpdateDatasetGroupResponse UpdateDatasetGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDatasetGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDatasetGroupResponse' :: UpdateDatasetGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDatasetGroupResponse
s@UpdateDatasetGroupResponse' {} Int
a -> UpdateDatasetGroupResponse
s {$sel:httpStatus:UpdateDatasetGroupResponse' :: Int
httpStatus = Int
a} :: UpdateDatasetGroupResponse)
instance Prelude.NFData UpdateDatasetGroupResponse