{-# 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.Athena.UpdateDataCatalog
(
UpdateDataCatalog (..),
newUpdateDataCatalog,
updateDataCatalog_parameters,
updateDataCatalog_description,
updateDataCatalog_name,
updateDataCatalog_type,
UpdateDataCatalogResponse (..),
newUpdateDataCatalogResponse,
updateDataCatalogResponse_httpStatus,
)
where
import Amazonka.Athena.Types
import qualified Amazonka.Core as Core
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 UpdateDataCatalog = UpdateDataCatalog'
{
UpdateDataCatalog -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UpdateDataCatalog -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateDataCatalog -> Text
name :: Prelude.Text,
UpdateDataCatalog -> DataCatalogType
type' :: DataCatalogType
}
deriving (UpdateDataCatalog -> UpdateDataCatalog -> Bool
(UpdateDataCatalog -> UpdateDataCatalog -> Bool)
-> (UpdateDataCatalog -> UpdateDataCatalog -> Bool)
-> Eq UpdateDataCatalog
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDataCatalog -> UpdateDataCatalog -> Bool
$c/= :: UpdateDataCatalog -> UpdateDataCatalog -> Bool
== :: UpdateDataCatalog -> UpdateDataCatalog -> Bool
$c== :: UpdateDataCatalog -> UpdateDataCatalog -> Bool
Prelude.Eq, ReadPrec [UpdateDataCatalog]
ReadPrec UpdateDataCatalog
Int -> ReadS UpdateDataCatalog
ReadS [UpdateDataCatalog]
(Int -> ReadS UpdateDataCatalog)
-> ReadS [UpdateDataCatalog]
-> ReadPrec UpdateDataCatalog
-> ReadPrec [UpdateDataCatalog]
-> Read UpdateDataCatalog
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDataCatalog]
$creadListPrec :: ReadPrec [UpdateDataCatalog]
readPrec :: ReadPrec UpdateDataCatalog
$creadPrec :: ReadPrec UpdateDataCatalog
readList :: ReadS [UpdateDataCatalog]
$creadList :: ReadS [UpdateDataCatalog]
readsPrec :: Int -> ReadS UpdateDataCatalog
$creadsPrec :: Int -> ReadS UpdateDataCatalog
Prelude.Read, Int -> UpdateDataCatalog -> ShowS
[UpdateDataCatalog] -> ShowS
UpdateDataCatalog -> String
(Int -> UpdateDataCatalog -> ShowS)
-> (UpdateDataCatalog -> String)
-> ([UpdateDataCatalog] -> ShowS)
-> Show UpdateDataCatalog
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDataCatalog] -> ShowS
$cshowList :: [UpdateDataCatalog] -> ShowS
show :: UpdateDataCatalog -> String
$cshow :: UpdateDataCatalog -> String
showsPrec :: Int -> UpdateDataCatalog -> ShowS
$cshowsPrec :: Int -> UpdateDataCatalog -> ShowS
Prelude.Show, (forall x. UpdateDataCatalog -> Rep UpdateDataCatalog x)
-> (forall x. Rep UpdateDataCatalog x -> UpdateDataCatalog)
-> Generic UpdateDataCatalog
forall x. Rep UpdateDataCatalog x -> UpdateDataCatalog
forall x. UpdateDataCatalog -> Rep UpdateDataCatalog x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDataCatalog x -> UpdateDataCatalog
$cfrom :: forall x. UpdateDataCatalog -> Rep UpdateDataCatalog x
Prelude.Generic)
newUpdateDataCatalog ::
Prelude.Text ->
DataCatalogType ->
UpdateDataCatalog
newUpdateDataCatalog :: Text -> DataCatalogType -> UpdateDataCatalog
newUpdateDataCatalog Text
pName_ DataCatalogType
pType_ =
UpdateDataCatalog' :: Maybe (HashMap Text Text)
-> Maybe Text -> Text -> DataCatalogType -> UpdateDataCatalog
UpdateDataCatalog'
{ $sel:parameters:UpdateDataCatalog' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateDataCatalog' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateDataCatalog' :: Text
name = Text
pName_,
$sel:type':UpdateDataCatalog' :: DataCatalogType
type' = DataCatalogType
pType_
}
updateDataCatalog_parameters :: Lens.Lens' UpdateDataCatalog (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateDataCatalog_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateDataCatalog -> f UpdateDataCatalog
updateDataCatalog_parameters = (UpdateDataCatalog -> Maybe (HashMap Text Text))
-> (UpdateDataCatalog
-> Maybe (HashMap Text Text) -> UpdateDataCatalog)
-> Lens
UpdateDataCatalog
UpdateDataCatalog
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataCatalog' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: UpdateDataCatalog
s@UpdateDataCatalog' {} Maybe (HashMap Text Text)
a -> UpdateDataCatalog
s {$sel:parameters:UpdateDataCatalog' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: UpdateDataCatalog) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateDataCatalog -> f UpdateDataCatalog)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateDataCatalog
-> f UpdateDataCatalog
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateDataCatalog_description :: Lens.Lens' UpdateDataCatalog (Prelude.Maybe Prelude.Text)
updateDataCatalog_description :: (Maybe Text -> f (Maybe Text))
-> UpdateDataCatalog -> f UpdateDataCatalog
updateDataCatalog_description = (UpdateDataCatalog -> Maybe Text)
-> (UpdateDataCatalog -> Maybe Text -> UpdateDataCatalog)
-> Lens
UpdateDataCatalog UpdateDataCatalog (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataCatalog' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDataCatalog
s@UpdateDataCatalog' {} Maybe Text
a -> UpdateDataCatalog
s {$sel:description:UpdateDataCatalog' :: Maybe Text
description = Maybe Text
a} :: UpdateDataCatalog)
updateDataCatalog_name :: Lens.Lens' UpdateDataCatalog Prelude.Text
updateDataCatalog_name :: (Text -> f Text) -> UpdateDataCatalog -> f UpdateDataCatalog
updateDataCatalog_name = (UpdateDataCatalog -> Text)
-> (UpdateDataCatalog -> Text -> UpdateDataCatalog)
-> Lens UpdateDataCatalog UpdateDataCatalog Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataCatalog' {Text
name :: Text
$sel:name:UpdateDataCatalog' :: UpdateDataCatalog -> Text
name} -> Text
name) (\s :: UpdateDataCatalog
s@UpdateDataCatalog' {} Text
a -> UpdateDataCatalog
s {$sel:name:UpdateDataCatalog' :: Text
name = Text
a} :: UpdateDataCatalog)
updateDataCatalog_type :: Lens.Lens' UpdateDataCatalog DataCatalogType
updateDataCatalog_type :: (DataCatalogType -> f DataCatalogType)
-> UpdateDataCatalog -> f UpdateDataCatalog
updateDataCatalog_type = (UpdateDataCatalog -> DataCatalogType)
-> (UpdateDataCatalog -> DataCatalogType -> UpdateDataCatalog)
-> Lens
UpdateDataCatalog UpdateDataCatalog DataCatalogType DataCatalogType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataCatalog' {DataCatalogType
type' :: DataCatalogType
$sel:type':UpdateDataCatalog' :: UpdateDataCatalog -> DataCatalogType
type'} -> DataCatalogType
type') (\s :: UpdateDataCatalog
s@UpdateDataCatalog' {} DataCatalogType
a -> UpdateDataCatalog
s {$sel:type':UpdateDataCatalog' :: DataCatalogType
type' = DataCatalogType
a} :: UpdateDataCatalog)
instance Core.AWSRequest UpdateDataCatalog where
type
AWSResponse UpdateDataCatalog =
UpdateDataCatalogResponse
request :: UpdateDataCatalog -> Request UpdateDataCatalog
request = Service -> UpdateDataCatalog -> Request UpdateDataCatalog
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDataCatalog
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDataCatalog)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateDataCatalog))
-> Logger
-> Service
-> Proxy UpdateDataCatalog
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDataCatalog)))
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 -> UpdateDataCatalogResponse
UpdateDataCatalogResponse'
(Int -> UpdateDataCatalogResponse)
-> Either String Int -> Either String UpdateDataCatalogResponse
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 UpdateDataCatalog
instance Prelude.NFData UpdateDataCatalog
instance Core.ToHeaders UpdateDataCatalog where
toHeaders :: UpdateDataCatalog -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDataCatalog -> 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
"AmazonAthena.UpdateDataCatalog" ::
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 UpdateDataCatalog where
toJSON :: UpdateDataCatalog -> Value
toJSON UpdateDataCatalog' {Maybe Text
Maybe (HashMap Text Text)
Text
DataCatalogType
type' :: DataCatalogType
name :: Text
description :: Maybe Text
parameters :: Maybe (HashMap Text Text)
$sel:type':UpdateDataCatalog' :: UpdateDataCatalog -> DataCatalogType
$sel:name:UpdateDataCatalog' :: UpdateDataCatalog -> Text
$sel:description:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe Text
$sel:parameters:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Parameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
parameters,
(Text
"Description" 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
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> DataCatalogType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataCatalogType
type')
]
)
instance Core.ToPath UpdateDataCatalog where
toPath :: UpdateDataCatalog -> ByteString
toPath = ByteString -> UpdateDataCatalog -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateDataCatalog where
toQuery :: UpdateDataCatalog -> QueryString
toQuery = QueryString -> UpdateDataCatalog -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDataCatalogResponse = UpdateDataCatalogResponse'
{
UpdateDataCatalogResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool
(UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool)
-> (UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool)
-> Eq UpdateDataCatalogResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool
$c/= :: UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool
== :: UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool
$c== :: UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDataCatalogResponse]
ReadPrec UpdateDataCatalogResponse
Int -> ReadS UpdateDataCatalogResponse
ReadS [UpdateDataCatalogResponse]
(Int -> ReadS UpdateDataCatalogResponse)
-> ReadS [UpdateDataCatalogResponse]
-> ReadPrec UpdateDataCatalogResponse
-> ReadPrec [UpdateDataCatalogResponse]
-> Read UpdateDataCatalogResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDataCatalogResponse]
$creadListPrec :: ReadPrec [UpdateDataCatalogResponse]
readPrec :: ReadPrec UpdateDataCatalogResponse
$creadPrec :: ReadPrec UpdateDataCatalogResponse
readList :: ReadS [UpdateDataCatalogResponse]
$creadList :: ReadS [UpdateDataCatalogResponse]
readsPrec :: Int -> ReadS UpdateDataCatalogResponse
$creadsPrec :: Int -> ReadS UpdateDataCatalogResponse
Prelude.Read, Int -> UpdateDataCatalogResponse -> ShowS
[UpdateDataCatalogResponse] -> ShowS
UpdateDataCatalogResponse -> String
(Int -> UpdateDataCatalogResponse -> ShowS)
-> (UpdateDataCatalogResponse -> String)
-> ([UpdateDataCatalogResponse] -> ShowS)
-> Show UpdateDataCatalogResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDataCatalogResponse] -> ShowS
$cshowList :: [UpdateDataCatalogResponse] -> ShowS
show :: UpdateDataCatalogResponse -> String
$cshow :: UpdateDataCatalogResponse -> String
showsPrec :: Int -> UpdateDataCatalogResponse -> ShowS
$cshowsPrec :: Int -> UpdateDataCatalogResponse -> ShowS
Prelude.Show, (forall x.
UpdateDataCatalogResponse -> Rep UpdateDataCatalogResponse x)
-> (forall x.
Rep UpdateDataCatalogResponse x -> UpdateDataCatalogResponse)
-> Generic UpdateDataCatalogResponse
forall x.
Rep UpdateDataCatalogResponse x -> UpdateDataCatalogResponse
forall x.
UpdateDataCatalogResponse -> Rep UpdateDataCatalogResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDataCatalogResponse x -> UpdateDataCatalogResponse
$cfrom :: forall x.
UpdateDataCatalogResponse -> Rep UpdateDataCatalogResponse x
Prelude.Generic)
newUpdateDataCatalogResponse ::
Prelude.Int ->
UpdateDataCatalogResponse
newUpdateDataCatalogResponse :: Int -> UpdateDataCatalogResponse
newUpdateDataCatalogResponse Int
pHttpStatus_ =
UpdateDataCatalogResponse' :: Int -> UpdateDataCatalogResponse
UpdateDataCatalogResponse'
{ $sel:httpStatus:UpdateDataCatalogResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateDataCatalogResponse_httpStatus :: Lens.Lens' UpdateDataCatalogResponse Prelude.Int
updateDataCatalogResponse_httpStatus :: (Int -> f Int)
-> UpdateDataCatalogResponse -> f UpdateDataCatalogResponse
updateDataCatalogResponse_httpStatus = (UpdateDataCatalogResponse -> Int)
-> (UpdateDataCatalogResponse -> Int -> UpdateDataCatalogResponse)
-> Lens UpdateDataCatalogResponse UpdateDataCatalogResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataCatalogResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDataCatalogResponse' :: UpdateDataCatalogResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDataCatalogResponse
s@UpdateDataCatalogResponse' {} Int
a -> UpdateDataCatalogResponse
s {$sel:httpStatus:UpdateDataCatalogResponse' :: Int
httpStatus = Int
a} :: UpdateDataCatalogResponse)
instance Prelude.NFData UpdateDataCatalogResponse