{-# 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_description,
updateDataCatalog_parameters,
updateDataCatalog_name,
updateDataCatalog_type,
UpdateDataCatalogResponse (..),
newUpdateDataCatalogResponse,
updateDataCatalogResponse_httpStatus,
)
where
import Amazonka.Athena.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateDataCatalog = UpdateDataCatalog'
{
UpdateDataCatalog -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateDataCatalog -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UpdateDataCatalog -> Text
name :: Prelude.Text,
UpdateDataCatalog -> DataCatalogType
type' :: DataCatalogType
}
deriving (UpdateDataCatalog -> UpdateDataCatalog -> Bool
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]
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
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. 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'
{ $sel:description:UpdateDataCatalog' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:parameters:UpdateDataCatalog' :: Maybe (HashMap Text Text)
parameters = forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateDataCatalog' :: Text
name = Text
pName_,
$sel:type':UpdateDataCatalog' :: DataCatalogType
type' = DataCatalogType
pType_
}
updateDataCatalog_description :: Lens.Lens' UpdateDataCatalog (Prelude.Maybe Prelude.Text)
updateDataCatalog_description :: Lens' UpdateDataCatalog (Maybe Text)
updateDataCatalog_description = 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_parameters :: Lens.Lens' UpdateDataCatalog (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateDataCatalog_parameters :: Lens' UpdateDataCatalog (Maybe (HashMap Text Text))
updateDataCatalog_parameters = 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) 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
updateDataCatalog_name :: Lens.Lens' UpdateDataCatalog Prelude.Text
updateDataCatalog_name :: Lens' UpdateDataCatalog Text
updateDataCatalog_name = 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 :: Lens' UpdateDataCatalog DataCatalogType
updateDataCatalog_type = 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 :: (Service -> Service)
-> UpdateDataCatalog -> Request UpdateDataCatalog
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 UpdateDataCatalog
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDataCatalog)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateDataCatalogResponse
UpdateDataCatalogResponse'
forall (f :: * -> *) a b. Functor 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 UpdateDataCatalog where
hashWithSalt :: Int -> UpdateDataCatalog -> Int
hashWithSalt Int
_salt UpdateDataCatalog' {Maybe Text
Maybe (HashMap Text Text)
Text
DataCatalogType
type' :: DataCatalogType
name :: Text
parameters :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:type':UpdateDataCatalog' :: UpdateDataCatalog -> DataCatalogType
$sel:name:UpdateDataCatalog' :: UpdateDataCatalog -> Text
$sel:parameters:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe (HashMap Text Text)
$sel:description:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
parameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DataCatalogType
type'
instance Prelude.NFData UpdateDataCatalog where
rnf :: UpdateDataCatalog -> ()
rnf UpdateDataCatalog' {Maybe Text
Maybe (HashMap Text Text)
Text
DataCatalogType
type' :: DataCatalogType
name :: Text
parameters :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:type':UpdateDataCatalog' :: UpdateDataCatalog -> DataCatalogType
$sel:name:UpdateDataCatalog' :: UpdateDataCatalog -> Text
$sel:parameters:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe (HashMap Text Text)
$sel:description:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
parameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DataCatalogType
type'
instance Data.ToHeaders UpdateDataCatalog where
toHeaders :: UpdateDataCatalog -> 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
"AmazonAthena.UpdateDataCatalog" ::
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 UpdateDataCatalog where
toJSON :: UpdateDataCatalog -> Value
toJSON UpdateDataCatalog' {Maybe Text
Maybe (HashMap Text Text)
Text
DataCatalogType
type' :: DataCatalogType
name :: Text
parameters :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:type':UpdateDataCatalog' :: UpdateDataCatalog -> DataCatalogType
$sel:name:UpdateDataCatalog' :: UpdateDataCatalog -> Text
$sel:parameters:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe (HashMap Text Text)
$sel:description:UpdateDataCatalog' :: UpdateDataCatalog -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Description" 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
description,
(Key
"Parameters" 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 (HashMap Text Text)
parameters,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DataCatalogType
type')
]
)
instance Data.ToPath UpdateDataCatalog where
toPath :: UpdateDataCatalog -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateDataCatalog where
toQuery :: UpdateDataCatalog -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateDataCatalogResponse = UpdateDataCatalogResponse'
{
UpdateDataCatalogResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDataCatalogResponse -> UpdateDataCatalogResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:UpdateDataCatalogResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateDataCatalogResponse_httpStatus :: Lens.Lens' UpdateDataCatalogResponse Prelude.Int
updateDataCatalogResponse_httpStatus :: Lens' UpdateDataCatalogResponse Int
updateDataCatalogResponse_httpStatus = 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 where
rnf :: UpdateDataCatalogResponse -> ()
rnf UpdateDataCatalogResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDataCatalogResponse' :: UpdateDataCatalogResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus